/* Memory Training App CSS - Enhanced Vietnamese Style Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Memory Footer */
.memory-footer {
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.4;
    background: linear-gradient(135deg, #c9302c 0%, #d4772a 100%);
}
.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.footer-content i {
    color: #ffd700;
    font-size: 14px;
}
.footer-separator {
    color: #cbd5e1;
    font-weight: normal;
}
.footer-brand {
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 25%, #b22222 50%, #8b0000 75%, #654321 100%) !important;
    min-height: 100vh !important;
    color: #333 !important;
    line-height: 1.6 !important;
    overflow-x: hidden !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

.hidden {
    display: none !important;
}

/* Modern glass morphism background overlay */
.container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(201, 48, 44, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(220, 20, 60, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* App Title */
.app-title {
    text-align: center;
    color: #ffffff;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffd700 0%, #ffeb3b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.app-title::before {
    content: '\f5dc';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffeb3b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ffeb3b);
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

/* Enhanced Information Section */
.info-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(201, 48, 44, 0.1);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.05);
}

.info-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.info-tab {
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(201, 48, 44, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.info-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 48, 44, 0.4);
}

.info-tab.active {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

.info-tab svg {
    margin-right: 8px;
}

.info-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.info-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.info-content h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.info-content h3 svg {
    margin-right: 10px;
    color: #c9302c;
}

.info-content p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.knowledge-card {
    background: linear-gradient(135deg, rgba(201, 48, 44, 0.05) 0%, rgba(184, 134, 11, 0.05) 100%);
    border: 1px solid rgba(201, 48, 44, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.knowledge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.knowledge-card h4 {
    color: #c9302c;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.knowledge-card h4 svg {
    margin-right: 10px;
    min-width: 20px;
}

.knowledge-card p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.technique-list {
    list-style: none;
    padding: 0;
}

.technique-list li {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1.2rem;
    margin: 0.5rem 0;
    border-radius: 12px;
    border-left: 4px solid #c9302c;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.technique-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left-color: #b8860b;
}

.technique-list strong {
    color: #c9302c;
    font-weight: 600;
}

.real-world-example {
    background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin: 1rem 0;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.real-world-example h5 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.real-world-example h5 svg {
    margin-right: 10px;
}

.real-world-example p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.competition-info {
    background: linear-gradient(135deg, #dc143c 0%, #b22222 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin: 1rem 0;
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.competition-info h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.competition-info h4 svg {
    margin-right: 10px;
}

.competition-info p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.level-badge {
    display: inline-block;
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.2rem 0.5rem 0.2rem 0;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.difficulty-indicator {
    display: flex;
    gap: 0.3rem;
    margin: 0.5rem 0;
    align-items: center;
}

.difficulty-star {
    width: 16px;
    height: 16px;
    color: #ffd700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.difficulty-star.empty {
    color: #e2e8f0;
}

.progress-indicator {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    border-left: 4px solid #b8860b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.progress-indicator strong {
    color: #b8860b;
    display: flex;
    align-items: center;
}

.progress-indicator strong svg {
    margin-right: 8px;
}

/* Level Selection */
.level-selection {
    text-align: center;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.level-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: left 0.6s ease;
}

.level-card:hover::before {
    left: 100%;
}

.level-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 20px rgba(201, 48, 44, 0.2);
    border-color: rgba(201, 48, 44, 0.3);
}

.level-card:active {
    transform: translateY(-4px) scale(1.01);
}

.level-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.7);
    filter: grayscale(0.3);
}

.level-card.disabled:hover {
    transform: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.level-number {
    position: absolute;
    top: -15px;
    right: -15px;
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 
        0 8px 20px rgba(201, 48, 44, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.level-card h3 {
    color: #2d3748;
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.level-card h3::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: #c9302c;
}

.level-card[data-level="1"] h3::before {
    content: '\f5dc'; /* fa-brain */
}

.level-card[data-level="2"] h3::before {
    content: '\f03e'; /* fa-image */
}

.level-card[data-level="3"] h3::before {
    content: '\f279'; /* fa-map */
}

.level-card[data-level="4"] h3::before {
    content: '\f0d0'; /* fa-building */
}

.level-card p {
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1rem;
}

.level-age {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
}

.level-age::before {
    content: '\f1ae';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}

.level-info-toggle {
    background: rgba(184, 134, 11, 0.1);
    border: 2px solid #b8860b;
    color: #b8860b;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
    white-space: nowrap;
}

.level-info-toggle:hover {
    background: #b8860b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.3);
}

.level-info-toggle svg {
    margin-right: 8px;
}

/* Test Selection & Settings */
.test-selection, .test-settings {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.test-selection h2, .test-settings h2 {
    color: #2d3748;
    margin-bottom: 2.5rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.test-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(201, 48, 44, 0.1);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.test-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #c9302c, #dc143c);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.test-card:hover::after {
    transform: scaleX(1);
}

.test-card:hover {
    transform: translateY(-5px);
    border-color: rgba(201, 48, 44, 0.3);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.1),
        0 5px 15px rgba(201, 48, 44, 0.2);
}

.test-card h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.test-card h4::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #c9302c;
    min-width: 20px;
}

.test-card p {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.test-example {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 1rem;
    border-radius: 12px;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #2d3748;
    border: 1px solid rgba(201, 48, 44, 0.1);
    margin-top: 1rem;
}

/* Buttons */
.back-btn {
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(201, 48, 44, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn::before {
    content: '\f060';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 48, 44, 0.4);
}

.back-btn:active {
    transform: translateY(0);
}

/* Settings */
.settings-content {
    display: grid;
    gap: 3rem;
}

.settings-form {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(201, 48, 44, 0.1);
}

.setting-group {
    margin-bottom: 2rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.setting-group input, .setting-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(201, 48, 44, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.setting-group input:focus, .setting-group select:focus {
    outline: none;
    border-color: #c9302c;
    box-shadow: 0 0 0 3px rgba(201, 48, 44, 0.1);
    background: rgba(255, 255, 255, 1);
}

.setting-group small {
    display: block;
    margin-top: 0.5rem;
    color: #718096;
    font-size: 0.9rem;
}

.settings-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

.timer-settings {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(201, 48, 44, 0.1);
    backdrop-filter: blur(10px);
}

.timer-settings label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
}

.timer-settings label::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 1.1rem;
    color: #c9302c;
}

.timer-settings label:first-of-type::before {
    content: '\f017'; /* fa-clock */
}

.timer-settings label:last-of-type::before {
    content: '\f252'; /* fa-hourglass */
}

.timer-settings input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #c9302c;
}

.timer-settings input[type="number"] {
    width: 100px;
    padding: 0.8rem;
    border: 2px solid rgba(201, 48, 44, 0.2);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.fullscreen-btn, .start-btn {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(184, 134, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fullscreen-btn::before {
    content: '\f065';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}

.start-btn {
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    font-size: 1.3rem;
    padding: 1.5rem 3rem;
    box-shadow: 
        0 8px 25px rgba(201, 48, 44, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-btn::before {
    content: '\f135';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}

.fullscreen-btn:hover, .start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(184, 134, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-btn:hover {
    box-shadow: 
        0 12px 35px rgba(201, 48, 44, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Test Area */
.test-area {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.05);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(201, 48, 44, 0.1);
}

.test-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
}

.test-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.test-info span {
    background: linear-gradient(135deg, #b8860b, #daa520);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.test-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
}

.question-area {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.question-text {
    font-size: 3.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 3rem;
    line-height: 1.2;
    transition: all 0.4s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Memory Flash special effects */
.question-text.memory-flash {
    font-size: 5rem;
    color: #c9302c;
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: scale(1.1);
    text-shadow: 0 4px 20px rgba(201, 48, 44, 0.3);
    animation: memoryPulse 0.3s ease-in-out;
}

@keyframes memoryPulse {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
}

.answer-input {
    font-size: 2.5rem;
    padding: 1.5rem;
    border: 3px solid rgba(201, 48, 44, 0.3);
    border-radius: 20px;
    text-align: center;
    width: 400px;
    max-width: 90%;
    transition: all 0.3s ease;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.answer-input:focus {
    outline: none;
    border-color: #c9302c;
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.15),
        0 0 0 4px rgba(201, 48, 44, 0.1);
    background: rgba(255, 255, 255, 1);
}

.test-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(201, 48, 44, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}

#pauseBtn::before {
    content: '\f04c'; /* fa-pause */
}

#nextBtn::before {
    content: '\f054'; /* fa-chevron-right */
}

#skipBtn::before {
    content: '\f051'; /* fa-step-forward */
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(201, 48, 44, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    transform: translateY(-1px);
}

.control-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 6px 20px rgba(201, 48, 44, 0.2);
}

.timer-display {
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid rgba(201, 48, 44, 0.1);
    margin-top: auto;
}

.timer {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: white;
    padding: 1.5rem 3rem;
    border-radius: 30px;
    display: inline-block;
    box-shadow: 
        0 8px 25px rgba(184, 134, 11, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-family: 'Fira Code', monospace;
}

/* Results Area */
.results-area {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.05);
}

.results-area h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 3rem;
    font-size: 2.2rem;
    font-weight: 700;
}

.results-area h2::before {
    content: '\f389';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 15px;
    color: #ffd700;
}

.results-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 4rem;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(201, 48, 44, 0.1) 0%, rgba(184, 134, 11, 0.1) 100%);
    border-radius: 24px;
    border: 1px solid rgba(201, 48, 44, 0.2);
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 
        0 10px 30px rgba(201, 48, 44, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.score-circle::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(135deg, #c9302c, #dc143c);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
    opacity: 0.3;
}

.score-details {
    font-size: 1.3rem;
    color: #2d3748;
    font-weight: 600;
}

.score-details div {
    margin-bottom: 0.8rem;
    padding: 0.5rem 0;
}

.score-details div::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    width: 20px;
    display: inline-block;
}

.score-details div:nth-child(1)::before {
    content: '\f00c';
    color: #b8860b;
}

.score-details div:nth-child(2)::before {
    content: '\f00d';
    color: #c9302c;
}

.score-details div:nth-child(3)::before {
    content: '\f017';
    color: #ffd700;
}

.score-details div:nth-child(4)::before {
    content: '\f05b';
    color: #b8860b;
}

.results-history {
    margin-bottom: 3rem;
}

.results-history h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.results-history h3::before {
    content: '\f0cb';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: #c9302c;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(201, 48, 44, 0.1);
    backdrop-filter: blur(10px);
}

.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c9302c, #dc143c);
    border-radius: 4px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.history-item.correct {
    border-left-color: #b8860b;
    background: rgba(184, 134, 11, 0.05);
}

.history-item.wrong {
    border-left-color: #c9302c;
    background: rgba(201, 48, 44, 0.05);
}

.history-question {
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

.history-answer {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.95rem;
}

.history-answer span {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.retry-btn, .home-btn {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(184, 134, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.retry-btn::before {
    content: '\f01e';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}

.home-btn::before {
    content: '\f015';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 8px;
}

.retry-btn:hover, .home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(184, 134, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Help Button and Modal System */
.help-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(201, 48, 44, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.help-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(201, 48, 44, 0.5);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(10px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #c9302c;
}

.modal-content h2 {
    color: #2d3748;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
}

.modal-content h2 svg {
    margin-right: 10px;
    color: #c9302c;
}

/* Fullscreen styles */
.test-area.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #c9302c 0%, #dc143c 25%, #b22222 50%, #8b0000 75%, #654321 100%);
    z-index: 1000;
    border-radius: 0;
    padding: 2rem;
    margin: 0;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.test-area.fullscreen .test-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    flex-shrink: 0;
    min-height: 80px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.test-area.fullscreen .test-header h2 {
    color: white;
}

.test-area.fullscreen .test-display {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.test-area.fullscreen .test-controls {
    flex-shrink: 0;
    margin: 2rem 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-area.fullscreen .timer-display {
    flex-shrink: 0;
    padding: 2rem 0;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-area.fullscreen .question-text {
    font-size: 6rem;
    margin-bottom: 4rem;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.test-area.fullscreen .question-text.memory-flash {
    font-size: 8rem;
    transform: scale(1.2);
    background: linear-gradient(135deg, #ffd700 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.test-area.fullscreen .answer-input {
    font-size: 3.5rem;
    width: 600px;
    padding: 2rem;
    margin: 0 auto !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

.test-area.fullscreen .control-btn {
    font-size: 1.3rem;
    padding: 1.5rem 3rem;
}

.test-area.fullscreen .timer {
    font-size: 3rem;
    padding: 2rem 4rem;
    box-shadow: 
        0 10px 30px rgba(184, 134, 11, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .app-title {
        font-size: 2.5rem;
    }
    
    .level-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .test-grid {
        grid-template-columns: 1fr;
    }
    
    .question-text {
        font-size: 2.5rem !important;
    }
    
    .answer-input {
        font-size: 2rem !important;
        width: 300px !important;
        margin: 0 auto !important;
    }
    
    .test-area.fullscreen .test-header {
        min-height: 60px;
    }
    
    .test-area.fullscreen .test-controls {
        min-height: 80px;
        margin: 1rem 0;
    }
    
    .test-area.fullscreen .timer-display {
        min-height: 100px;
        padding: 1rem 0;
    }
    
    .test-area.fullscreen .question-text {
        font-size: 4rem;
        margin-bottom: 2rem;
    }
    
    .test-area.fullscreen .question-text.memory-flash {
        font-size: 5rem;
        transform: scale(1.1);
    }
    
    .test-area.fullscreen .answer-input {
        font-size: 2.5rem;
        width: 350px;
        padding: 1.5rem;
    }
    
    .test-area.fullscreen .timer {
        font-size: 2.2rem;
        padding: 1.5rem 2.5rem;
    }
    
    .test-area.fullscreen .control-btn {
        font-size: 1.1rem;
        padding: 1.2rem 2rem;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 2rem;
    }
    
    .settings-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .timer-settings {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .test-controls {
        flex-wrap: wrap;
    }
    
    .control-btn {
        flex: 1;
        min-width: 140px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .retry-btn, .home-btn, .back-btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
        padding: 2rem;
    }
    
    .info-tabs {
        flex-direction: column;
    }
    
    .info-tab {
        text-align: center;
    }
    
    .help-button {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .level-info-toggle {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.7rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .level-card {
        padding: 2rem;
    }
    
    .question-text {
        font-size: 2rem !important;
    }
    
    .answer-input {
        font-size: 1.8rem !important;
        width: 280px !important;
    }
    
    .test-area.fullscreen .question-text {
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }
    
    .test-area.fullscreen .question-text.memory-flash {
        font-size: 4rem;
    }
    
    .test-area.fullscreen .answer-input {
        font-size: 2.2rem;
        width: 300px;
    }
    
    .test-area.fullscreen .timer {
        font-size: 2rem;
        padding: 1.2rem 2rem;
    }
    
    .test-area.fullscreen .control-btn {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
    
    .info-section {
        padding: 1.5rem;
    }
    
    .knowledge-card {
        padding: 1.2rem;
    }
    
    .app-title {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}