/* Digit Span Test Styles */
:root {
    --primary-color: #4e73df;
    --secondary-color: #1cc88a;
    --success-color: #1cc88a;
    --danger-color: #e74a3b;
    --warning-color: #f6c23e;
    --info-color: #36b9cc;
    --dark-color: #5a5c69;
    --light-color: #f8f9fc;
    --border-color: #e3e6f0;
    --shadow-color: rgba(0, 0, 0, 0.15);
}

.dst-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--dark-color);
    background-color: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 0.15rem 1.75rem 0 var(--shadow-color);
}

.dst-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-weight: 700;
}

.dst-container h3 {
    text-align: center;
    margin: 1.5rem 0;
    color: var(--dark-color);
    font-weight: 600;
}

/* User Selection Styles */
.dst-user-selection {
    margin-bottom: 20px;
}

.dst-user-cards {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.dst-user-card {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0.15rem 1.75rem 0 var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dst-user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem 0 var(--shadow-color);
}

.dst-user-card[data-user="1"] {
    border-top: 4px solid var(--primary-color);
}

.dst-user-card[data-user="2"] {
    border-top: 4px solid var(--secondary-color);
}

.dst-user-avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.dst-user-info {
    width: 100%;
    margin-bottom: 15px;
}

.dst-user-name {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 16px;
}

.dst-user-scores {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.dst-score {
    background: var(--light-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.dst-select-user-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    width: 100%;
}

.dst-user-card[data-user="2"] .dst-select-user-btn {
    background: var(--secondary-color);
}

.dst-select-user-btn:hover {
    opacity: 0.9;
}

/* Active User Display */
.dst-active-user {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 0.1rem 0.5rem 0 var(--shadow-color);
}

.dst-user-avatar-small {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.dst-active-user-name {
    font-weight: 600;
    font-size: 16px;
}

/* Leaderboard Styles */
.dst-leaderboard {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0.15rem 1.75rem 0 var(--shadow-color);
    margin-top: 30px;
}

.dst-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dst-leaderboard-table th,
.dst-leaderboard-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.dst-leaderboard-table th {
    background-color: var(--light-color);
    font-weight: 600;
}

.dst-leaderboard-table tr:nth-child(even) {
    background-color: var(--light-color);
}

.dst-leaderboard-table tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

/* Settings Styles */
.dst-settings {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0.15rem 1.75rem 0 var(--shadow-color);
}

.dst-setting-group {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.dst-setting-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dst-setting-group label {
    margin-right: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
}

.dst-setting-group input[type="radio"] {
    margin-right: 8px;
}

/* Test Area Styles */
.dst-test-area {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0.15rem 1.75rem 0 var(--shadow-color);
    text-align: center;
}

.dst-display {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    background: var(--light-color);
    border-radius: 8px;
}

.dst-digit {
    font-size: 120px;
    font-weight: bold;
    color: var(--dark-color);
    transition: opacity 0.3s ease;
}

.dst-controls {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.dst-controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    min-width: 120px;
}

.dst-controls button:hover {
    opacity: 0.9;
}

.dst-controls button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.dst-start-btn {
    background: var(--success-color) !important;
}

.dst-repeat-btn {
    background: var(--warning-color) !important;
}

.dst-finish-btn {
    background: var(--danger-color) !important;
}

.dst-input-area {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.dst-answer-input {
    padding: 12px;
    width: 60%;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dst-submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.dst-submit-btn:hover {
    opacity: 0.9;
}

.dst-submit-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.dst-countdown {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    height: 30px;
    margin-bottom: 20px;
}

.dst-results {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    font-size: 16px;
}

.dst-current-level, .dst-max-level {
    background: var(--light-color);
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-weight: 600;
}

/* Animation for digit display */
@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.dst-digit.animate {
    animation: fadeInOut 1s ease;
}

/* Feedback styles */
.dst-feedback {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.dst-feedback-correct {
    background-color: rgba(28, 200, 138, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.dst-feedback-incorrect {
    background-color: rgba(231, 74, 59, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Responsive styles */
@media (max-width: 768px) {
    .dst-user-cards {
        flex-direction: column;
        align-items: center;
    }

    .dst-user-card {
        width: 100%;
        max-width: 100%;
    }

    .dst-digit {
        font-size: 80px;
    }

    .dst-controls {
        flex-direction: column;
    }

    .dst-controls button {
        width: 100%;
        margin-bottom: 10px;
    }

    .dst-input-area {
        flex-direction: column;
    }

    .dst-answer-input {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .dst-submit-btn {
        width: 100%;
        border-radius: 4px;
    }

    .dst-results {
        flex-direction: column;
        gap: 10px;
    }

    .dst-leaderboard-table {
        font-size: 14px;
    }

    .dst-leaderboard-table th,
    .dst-leaderboard-table td {
        padding: 8px 4px;
    }
}

/* Animation for user card selection */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.dst-user-card.selected {
    animation: pulse 0.5s ease;
    border: 2px solid;
    border-top-width: 4px;
}

.dst-user-card[data-user="1"].selected {
    border-color: var(--primary-color);
}

.dst-user-card[data-user="2"].selected {
    border-color: var(--secondary-color);
}
