/* GRAMMAR PRACTICE TESTS - SHARED CSS */
/* © 2025 Hakan Zehir - All Tests Common Styles */

:root {
    --primary: #2563eb; /* Default - will be overridden by category */
    --accent: #059669;
    --warning: #d97706;
    --danger: #ef4444;
    --info: #0891b2;
    --success: #22c55e;
    --card-radius: 8px;
    --transition: all 0.3s ease;
    
    /* Grammar Category Colors - Updated Structure (7 Categories) */
    --tenses-primary: #ff6b35;
    --tenses-rgb: 255, 107, 53;
    --advanced-primary: #6200ea;
    --advanced-rgb: 98, 0, 234;
    --modal-verbs-primary: #00bcd4;
    --modal-verbs-rgb: 0, 188, 212;
    --nouns-articles-primary: #2196f3;
    --nouns-articles-rgb: 33, 150, 243;
    --vocabulary-primary: #4caf50;
    --vocabulary-rgb: 76, 175, 80;
    --communication-primary: #e91e63;
    --communication-rgb: 233, 30, 99;
    --conditionals-primary: #ffc107;
    --conditionals-rgb: 255, 193, 7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100vw;
    height: 100vh;
    background: #00000F;
    overflow-x: hidden;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #ffffff;
}

/* STARS AND FIREFLIES CANVAS */
.stars, .fireflies, .fireflies-front {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.stars { z-index: 0; }
.fireflies { z-index: 1; }
.fireflies-front { z-index: 2; }

/* MAIN LAYOUT CONTAINER */
.main-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

/* HEADER SECTION */
.header-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(15, 15, 40, 0.3);
    border-radius: var(--card-radius);
    padding: 21px 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* TOP NAVIGATION HEADER */
.top-navigation-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    background: rgba(15, 15, 40, 0.3);
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    z-index: 20;
}

/* Navigation Buttons */
.top-navigation-header .home-btn {
    position: static;
    background: rgba(15, 15, 40, 0.3);
    border: 1px solid rgba(96, 165, 250, 0.4);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin-left: 20px;
}

.top-navigation-header .home-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.top-navigation-header .home-icon {
    width: 20px;
    height: 20px;
    color: #60a5fa;
    transition: var(--transition);
}

.top-navigation-header .home-btn:hover .home-icon {
    color: var(--primary);
}

.subjects-btn {
    background: rgba(15, 15, 40, 0.3);
    border: 1px solid rgba(96, 165, 250, 0.4);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: var(--transition);
    color: #60a5fa;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin-left: 10px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subjects-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.header-copyright {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fbbf24;
    pointer-events: none;
}

/* GRAMMAR TEST HEADER */
.grammar-test-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    background: rgba(15, 15, 40, 0.3);
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    z-index: 20;
}

.grammar-test-title {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary); /* Dynamic category color */
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

/* LOGO CONTAINER */
.logo-container {
    margin-bottom: 16px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.logo-container img {
    max-width: 240px; /* Standart: Grammar Index ile ayni */
    width: 240px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 20px rgba(var(--primary-rgb), 0.4));
}

.logo-fallback {
    color: var(--primary);
    font-size: 2.8em;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5);
    margin-bottom: 12px;
    display: none;
    letter-spacing: 2px;
    text-align: center;
    width: 100%;
}

/* QUIZ CONTAINER */
.quiz-container {
    background: rgba(15, 15, 40, 0.3);
    border-radius: var(--card-radius);
    padding: 32px;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.question-header {
    font-size: 1.125rem;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 600;
    padding: 12px 16px;
    background: rgba(3, 7, 18, 0.8);
    border-radius: 6px;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 0 1px rgba(var(--primary-rgb), 0.15);
}

.question {
    font-size: 1.125rem;
    margin-bottom: 32px;
    line-height: 1.6;
    background: rgba(15, 15, 40, 0.3);
    padding: 24px;
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

.options {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
}

.option {
    background: rgba(15, 15, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--card-radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.125rem;
    line-height: 1.5;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

.option:hover {
    background: rgba(17, 24, 39, 0.9);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: none;
}

.option.correct {
    background: rgba(3, 7, 18, 0.6) !important;
    border-color: rgba(var(--primary-rgb), 0.15) !important;
    color: #22c55e !important;
    box-shadow: 0 0 2px 2px rgba(34, 197, 94, 0.8), 0 0 1px rgba(var(--primary-rgb), 0.15) !important;
    animation: correctPulse 0.6s ease-out;
}

.option.correct,
.option.correct *,
.option.correct strong {
    color: #22c55e !important;
}

.option.wrong {
    background: rgba(3, 7, 18, 0.6) !important;
    border-color: rgba(var(--primary-rgb), 0.15) !important;
    color: #ef4444 !important;
    box-shadow: 0 0 2px 2px rgba(239, 68, 68, 0.8), 0 0 1px rgba(var(--primary-rgb), 0.15) !important;
    animation: wrongShake 0.6s ease-out;
}

.option.wrong,
.option.wrong *,
.option.wrong strong {
    color: #ef4444 !important;
}

.option.disabled {
    cursor: not-allowed;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.next-button {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

.next-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.1), transparent);
    transition: left 0.5s ease;
}

.next-button:hover::before {
    left: 100%;
}

.next-button:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
}

.next-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.2);
}

.next-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: transparent;
    color: #6b7280;
    border-color: #6b7280;
    box-shadow: none;
}

.next-button:disabled::before {
    display: none;
}

/* EXPLANATION SECTION */
.explanation-section {
    background: rgba(15, 15, 40, 0.3);
    border-radius: var(--card-radius);
    padding: 28px;
    margin-top: 20px;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    border-left: 4px solid #f59e0b;
    display: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.explanation-section.visible {
    display: block;
}

.explanation-title {
    color: #f59e0b;
    margin-bottom: 16px;
    font-size: 1.375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.explanation-content {
    font-size: 1.125rem;
    line-height: 1.7;
}

/* STATISTICS SECTION */
.statistics-section {
    background: rgba(15, 15, 40, 0.3);
    border-radius: var(--card-radius);
    padding: 28px;
    margin-top: 20px;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
}

.statistics-section.visible {
    display: block;
}

.statistics-title {
    color: #f59e0b;
    margin-bottom: 20px;
    font-size: 1.375rem;
    font-weight: 600;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(3, 7, 18, 0.8);
    border-radius: var(--card-radius);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
}

.stat-item.correct {
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-item.wrong {
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-item.correct .stat-number {
    color: #22c55e;
}

.stat-item.wrong .stat-number {
    color: #ef4444;
}

.stat-label {
    font-size: 0.875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accuracy-bar {
    width: 100%;
    height: 8px;
    background: rgba(3, 7, 18, 0.8);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #eab308, #22c55e, #10b981, #06b6d4, #3b82f6, #6366f1, #8b5cf6, #a855f7);
    width: 0%;
    transition: width 0.5s ease;
}

.accuracy-text {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: #22c55e;
}

.completion {
    text-align: center;
    padding: 60px 24px;
}

.completion h2 {
    color: var(--success);
    margin-bottom: 24px;
    font-size: 2.5rem;
    font-weight: 700;
}

.completion p {
    font-size: 1.375rem;
    margin: 24px 0;
}

/* LOADING AND ERROR STATES */
.loading {
    text-align: center;
    font-size: 1.5rem;
    margin: 60px 0;
    color: var(--primary);
    font-weight: 600;
}

.error {
    text-align: center;
    color: var(--danger);
    font-size: 1.25rem;
    margin: 60px 0;
    font-weight: 600;
}

/* FOOTER SECTION */
.footer-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    margin-top: 20px;
    background: rgba(15, 15, 40, 0.3);
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
}

.footer-copyright {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fbbf24;
    text-align: center;
}

/* ANSWER EFFECTS ANIMATION */
.answer-effect {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: answer-fall linear;
    top: -50px;
    box-shadow: 0 0 10px currentColor;
}

.answer-effect.correct {
    background: var(--success);
    color: var(--success);
}

.answer-effect.wrong {
    background: var(--danger);
    color: var(--danger);
}

@keyframes answer-fall {
    0% {
        transform: translateY(0px) translateX(0px);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) translateX(50px);
        opacity: 0;
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .main-container {
        padding: 20px;
        max-width: 100%;
    }
    
    .top-navigation-header {
        padding: 10px 0;
        margin-bottom: 20px;
    }
    
    .top-navigation-header .home-btn {
        width: 32px;
        height: 32px;
        padding: 5px;
        margin-left: 15px;
    }
    
    .top-navigation-header .home-icon {
        width: 18px;
        height: 18px;
    }
    
    .subjects-btn {
        height: 32px;
        padding: 5px 10px;
        font-size: 13px;
        margin-left: 8px;
    }
    
    .header-copyright {
        font-size: 0.75rem;
    }
    
    .grammar-test-header {
        padding: 10px 0;
        margin-bottom: 20px;
    }
    
    .grammar-test-title {
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .logo-container img {
        max-width: 135px; /* Mobil (700px ve altı): 240px (320px * 0.75 - 25% smaller) */
        width: 135px;
    }
    
    .header-wrap {
        padding: 14px 28px;
        margin-bottom: 20px;
    }
    
    .logo-fallback {
        font-size: 2.4em;
        margin-bottom: 10px;
    }
    
    .loading {
        font-size: 1.25rem;
        margin: 50px 0;
    }
    
    .error {
        font-size: 1.125rem;
        margin: 50px 0;
    }
    
    .quiz-container {
        padding: 28px;
        margin-bottom: 0;
    }
    
    .explanation-section {
        padding: 28px;
        margin-top: 20px;
        margin-bottom: 0;
    }
    
    .statistics-section {
        padding: 24px;
        margin-top: 20px;
        margin-bottom: 0;
    }
    
    .question-header {
        font-size: 1rem;
        padding: 10px 14px;
        margin-bottom: 18px;
    }
    
    .question {
        font-size: 1rem;
        padding: 22px;
        margin-bottom: 28px;
    }
    
    .option {
        padding: 18px;
        font-size: 1rem;
    }
    
    .options {
        gap: 14px;
        margin-bottom: 28px;
    }
    
    .next-button {
        padding: 12px 26px;
        font-size: 0.8rem;
        min-width: 160px;
        letter-spacing: 0.5px;
    }
    
    .explanation-title {
        font-size: 1.25rem;
        margin-bottom: 14px;
    }
    
    .explanation-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .completion {
        padding: 50px 20px;
    }
    
    .completion h2 {
        font-size: 2.25rem;
        margin-bottom: 20px;
    }
    
    .completion p {
        font-size: 1.25rem;
        margin: 20px 0;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stats-grid {
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .footer-header {
        padding: 10px 0;
        margin-top: 20px;
    }
    
    .footer-copyright {
        font-size: 0.75rem;
    }
}

/* KÜÇÜK MOBİL EKRANLAR İÇİN EK OPTİMİZASYON */
@media (max-width: 480px) {
    .logo-container img {
        max-width: 135px; /* Küçük mobil (480px ve altı): 180px (240px * 0.75 - 25% smaller) */
        width: 135px;
    }
    
    .header-wrap {
        padding: 12px 24px;
    }
    
    .grammar-test-title {
        font-size: 1.25rem;
    }
    
    .main-container {
        padding: 15px;
    }
}
/* Baslik logosu backglow — standart (kaynak: lexitest) */
.logo-container img, .header-wrap img, .header img, .title-logo, .title-img, .main-title-image {
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
    filter: drop-shadow(0 0 20px color-mix(in srgb, var(--primary, #3b82f6) 40%, transparent));
}
