:root {
    --primary-color: #4F46E5;
    /* Indigo 600 */
    --primary-hover: #4338CA;
    /* Indigo 700 */
    --background-color: #F9FAFB;
    /* Gray 50 */
    --surface-color: #FFFFFF;
    --text-main: #111827;
    /* Gray 900 */
    --text-secondary: #4B5563;
    /* Gray 600 */
    --border-color: #E5E7EB;
    /* Gray 200 */
    --success-color: #10B981;
    /* Emerald 500 */
    --error-color: #EF4444;
    /* Red 500 */
    --accent-bg: #EEF2FF;
    /* Indigo 50 */

    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --font-family: 'Inter', sans-serif;
}

body.dark-mode {
    --background-color: #111827;
    /* Gray 900 */
    --surface-color: #1F2937;
    /* Gray 800 */
    --text-main: #F9FAFB;
    /* Gray 50 */
    --text-secondary: #9CA3AF;
    /* Gray 400 */
    --border-color: #374151;
    /* Gray 700 */
    --accent-bg: #312E81;
    /* Indigo 900 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Metin kopyalamayı engelle */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Form alanlarında seçime izin ver */
input,
textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

.app-container {
    width: 100%;
    max-width: 600px;
    background: var(--surface-color);
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-md);
    overflow-x: hidden;
}

@media (min-width: 640px) {
    .app-container {
        min-height: auto;
        height: 90vh;
        border-radius: var(--radius-lg);
        margin: 2rem;
        overflow-y: auto;
    }
}

/* Screen Management */
.screen {
    display: none;
    padding: 2rem;
    height: 100%;
    flex-direction: column;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography & Common */
h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--accent-bg);
    color: var(--primary-color);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Buttons */
.primary-btn,
.secondary-btn {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-btn {
    background-color: white;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}

.secondary-btn:hover {
    background-color: var(--background-color);
    border-color: var(--text-secondary);
}

/* Home Screen */
.home-header {
    margin-bottom: 2rem;
    text-align: center;
}

.subject-grid {
    display: grid;
    gap: 1rem;
}

.subject-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.subject-card:hover:not(.disabled) {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.subject-card.disabled {
    opacity: 0.6;
    cursor: default;
    background-color: var(--background-color);
}

.card-icon {
    font-size: 2rem;
    background: var(--accent-bg);
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-content p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-secondary);
}

.card-badge {
    display: inline-block;
    font-size: 0.75rem;
    background: var(--background-color);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.card-action {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Intro Screen */
.nav-back {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

.nav-back:hover {
    color: var(--primary-color);
}

#intro-screen .content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.info-item {
    font-weight: 500;
}

.question-container {
    flex: 1;
}

.question-text {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    padding: 1rem 1.25rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: left;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--accent-bg);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background-color: var(--accent-bg);
    color: var(--primary-color);
    font-weight: 500;
}

/* Result Screen */
.score-card {
    background: var(--accent-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 2rem;
}

.score-circle {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
}

.score-details {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    border-radius: 8px;
    display: inline-block;
}

.mistake-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--error-color);
}

.mistake-question {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.answer-row.wrong {
    color: var(--error-color);
}

.answer-row.correct {
    color: var(--success-color);
}

.bam-box {
    margin-top: 1rem;
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.bam-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hidden {
    display: none;
}

.option-btn:active {
    transform: scale(0.98);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background-color: var(--accent-bg);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    /* Odak halkası */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar {
    /* Mevcut kodlarına ek olarak: */
    transition: width 0.5s ease-in-out;
    background: linear-gradient(90deg, var(--primary-color), #818cf8);
}

/* --- Navigation Core Styles --- */
.main-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--surface-color);
    /* Changed from rgba(255, 255, 255, 0.9) */
    backdrop-filter: blur(10px);
    /* Keeps blur but background is now dynamic */
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    opacity: 0.95;
    /* Slight transparency for blur effect */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Menu Desktop Styles --- */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.arrow-icon {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

/* --- Dropdown Menu (Mega Menu Style) --- */
.has-dropdown {
    position: relative;
    padding-bottom: 0;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.has-dropdown:hover .arrow-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 320px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--accent-bg);
    color: var(--primary-color);
}

.item-icon {
    font-size: 1.25rem;
    background: var(--surface-color);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.item-content {
    display: flex;
    flex-direction: column;
}

.item-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Mobile Nav Styles --- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: 0.3s;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        left: 0;
        width: 100%;
        background: var(--surface-color);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        display: none;
        align-items: stretch;
    }

    .nav-menu.active {
        display: flex;
        animation: fadeIn 0.2s;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        background: var(--background-color);
        margin-top: 0.5rem;
        display: none;
    }

    .has-dropdown.active .dropdown-menu {
        display: block;
    }

    .has-dropdown>a {
        justify-content: space-between;
    }

    .dropdown-item {
        padding: 0.75rem;
    }

    .app-container {
        margin-top: 80px;
        /* Header için boşluk */
    }

}

/* --- Hero Section & Stats Styles --- */
.hero-section {
    text-align: center;
    padding: 2.5rem 1.5rem;
    /* Reduced padding */
    background-color: var(--surface-color);
    /* Education/Tech Dot Pattern */
    background-image: radial-gradient(#d1d5db 1px, transparent 1px);
    background-size: 24px 24px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    /* Reduced margin */
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Decorative background glow */
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 8s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1) translate(20px, 20px);
        opacity: 0.8;
    }
}

.hero-title {
    position: relative;
    font-size: 2rem;
    /* Reduced size */
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    z-index: 1;
}

.hero-subtitle {
    position: relative;
    font-size: 1rem;
    /* Reduced size */
    color: var(--text-secondary);
    max-width: 450px;
    /* Slightly narrower */
    margin: 0 auto 2rem;
    line-height: 1.5;
    z-index: 1;
}

.stats-container {
    position: relative;
    display: inline-flex;
    background: var(--surface-color);
    padding: 0.75rem 2rem;
    /* Compact padding */
    border-radius: 100px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(229, 231, 235, 0.8);
    backdrop-filter: blur(8px);
    gap: 2rem;
    /* Reduced gap */
    z-index: 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.25rem;
    /* Reduced size */
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    /* Added standard property */
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Subject Card Modernization */
.subject-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    background: linear-gradient(var(--surface-color), var(--surface-color)) padding-box,
        linear-gradient(135deg, var(--border-color), var(--background-color)) border-box;
}

.subject-card:hover:not(.disabled) {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    background: linear-gradient(var(--surface-color), var(--surface-color)) padding-box,
        linear-gradient(135deg, var(--primary-color), #c084fc) border-box;
}

.card-icon {
    font-size: 2rem;
    background: var(--surface-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.subject-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center alignment looks better with centered hero */
    margin-bottom: 2rem;
    position: relative;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: inline-block;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-bg);
}