:root {
    --gold: #D4AF37; /* A classic gold color */
    --dark-gold: #B8860B;
    --soft-white: #F8F8F8;
    --dark-text: #2c3e50;
    --light-text: #34495e;
    --danger-red: #c82333;
    --success-green: #218838;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, var(--gold), var(--soft-white) 50%);
    color: var(--dark-text);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    margin: 20px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px; /* Mobile-first max-width */
    text-align: center;
    box-sizing: border-box;
}

h1, h2, h3 {
    color: var(--dark-text);
    font-weight: 700;
}

h1 {
    font-size: 1.5em;
}

h2 {
    font-size: 1.3em;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

h3 {
    font-size: 1.1em;
    color: var(--dark-gold);
}

.screen {
    margin-top: 15px;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--gold);
    outline: none;
}

.btn {
    background-color: var(--gold);
    color: var(--dark-text);
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    margin: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: var(--dark-gold);
    color: white;
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: #eee;
    color: var(--light-text);
}

.btn.secondary:hover {
    background-color: #ddd;
}

.btn.danger {
    background-color: #dc3545;
    color: white;
}
.btn.danger:hover {
    background-color: #c82333;
}

.btn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

#participant-list {
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #fff;
}

.participant-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    transition: background-color 0.2s ease;
}

.participant-card:hover {
    background-color: #FFFBEA;
}

.participant-card-name {
    font-weight: 600;
}

.participant-card-id {
    font-size: 0.8em;
    color: #777;
}

.select-participant-btn {
    background-color: var(--success-green);
    color: white;
    padding: 6px 12px;
    font-size: 0.9em;
}

.select-participant-btn:hover {
    background-color: #1e7e34;
}

#question-container {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

#options-container label {
    display: block;
    background-color: #fafafa;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#options-container label:hover {
    border-color: var(--gold);
    background-color: #FFFBEA;
}

#options-container label.option-correct {
    background-color: #e9f7ef;
    border-color: var(--success-green);
    color: #1e7e34;
    font-weight: 600;
}

#options-container label.option-incorrect {
    background-color: #fbe9e7;
    border-color: var(--danger-red);
    color: var(--danger-red);
    font-weight: 600;
}

#explanation-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #FFFBEA;
    border: 1px solid var(--gold);
    border-radius: 8px;
    color: var(--dark-text);
    text-align: left;
    font-size: 0.9em;
}

.test-status {
    margin-left: 15px;
    font-weight: bold;
    color: var(--success-green);
}

#admin-panel {
    border: 1px solid #ddd;
    background-color: #fafafa;
}

#password-modal {
    background-color: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-sizing: border-box;
}

#password-modal h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
}


.ranking-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Larger screens */
@media (min-width: 768px) {
    .container {
        padding: 40px;
        max-width: 800px;
    }
    .ranking-container {
        flex-direction: row;
        justify-content: space-around;
        gap: 20px;
    }
}

/* New Ranking Table Styles */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}

.ranking-table th, .ranking-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ranking-table th {
    font-weight: 600;
    color: var(--light-text);
    background-color: #f9f9f9;
}

.ranking-table tr:last-child td {
    border-bottom: none;
}

.ranking-table .rank-col {
    text-align: center;
    width: 40px;
    font-weight: 700;
}

.ranking-table .score-col {
    text-align: center;
    width: 60px;
    font-weight: 700;
}

.rank-icon {
    font-size: 1.4em;
    vertical-align: middle;
}

/* Footer Styles */
footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.8em;
    font-weight: 400;
    display: flex; /* Add flexbox to footer */
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center horizontally */
    justify-content: center; /* Center vertically */
}

.footer-logo {
    max-width: 60px; /* Make the logo small */
    height: auto;
    margin-bottom: 10px; /* Space between logo and text */
}