/* =============================================
   3. Sinif Test Sistemi - Ana Stil Dosyasi
   Cocuklara uygun renkli ve egitici tasarim
   ============================================= */

:root {
    --primary: #4A90D9;
    --secondary: #F5A623;
    --success: #27AE60;
    --danger: #E74C3C;
    --warning: #F39C12;
    --purple: #8E44AD;
    --teal: #16A085;
    --dark: #2C3E50;
    --light: #F8F9FA;
    --border: #E0E0E0;
    --radius: 12px;
    --shadow: 0 3px 12px rgba(0,0,0,0.08);
}

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

html, body {
    font-family: 'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
}

/* ===== Navigasyon ===== */
.navbar {
    background: linear-gradient(135deg, #4A90D9, #6C5CE7);
    padding: 12px 24px;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .brand {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .brand .logo { font-size: 28px; }

.navbar .links { display: flex; align-items: center; gap: 16px; }

.navbar .links a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.navbar .links a:hover { opacity: 0.8; }

.navbar .badge {
    background: var(--secondary);
    color: #fff;
    border-radius: 20px;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 13px;
}

/* ===== Container ve layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 30px 20px; }

.page-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.page-subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 30px;
    font-size: 16px;
}

/* ===== Ders Kartlari ===== */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.subject-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--dark);
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.subject-card .icon {
    font-size: 48px;
    margin-bottom: 15px;
    text-align: center;
}

.subject-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--dark);
}

.subject-card p {
    color: #777;
    font-size: 14px;
    margin-bottom: 15px;
}

.subject-card .meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #999;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ===== Test Baslatma ===== */
.test-form {
    background: #fff;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.test-form label {
    display: block;
    font-weight: 600;
    margin: 18px 0 8px;
    color: #555;
}

.test-form select, .test-form input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    color: var(--dark);
}

.test-form select:focus, .test-form input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Butonlar ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: #3A7BC8; }

.btn-success { background: var(--success); }
.btn-success:hover { background: #219A54; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #C0392B; }

.btn-secondary { background: #95A5A6; }
.btn-secondary:hover { background: #7F8C8D; }

.btn-warning { background: var(--warning); }
.btn-warning:hover { background: #E67E22; }

.btn-block { width: 100%; text-align: center; }

.btn-lg { padding: 16px 32px; font-size: 18px; }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }

/* ===== Quiz Sayfasi ===== */
.quiz-container { max-width: 800px; margin: 0 auto; }

.quiz-header {
    background: #fff;
    border-radius: var(--radius);
    padding: 15px 25px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.question-counter {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.timer {
    background: var(--dark);
    color: #fff;
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 16px;
    min-width: 90px;
    text-align: center;
}

.timer.warning { background: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.question-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.question-card h2 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 25px;
    line-height: 1.6;
}

.difficulty-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.difficulty-kolay { background: #e8f5e9; color: #2e7d32; }
.difficulty-orta { background: #fff3e0; color: #e65100; }
.difficulty-zor { background: #fce4ec; color: #c62828; }

.option-list { display: flex; flex-direction: column; gap: 12px; }

.option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.option:hover { border-color: var(--primary); background: #f5faff; }

.option input { display: none; }

.option.selected {
    border-color: var(--primary);
    background: #eaf3fd;
    font-weight: 600;
}

.option .circle {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    border: 2px solid #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #888;
}

.option.selected .circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.question-tracker {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tracker-item {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #777;
    transition: all 0.2s;
    text-decoration: none;
}

.tracker-item.current { border-color: var(--primary); color: var(--primary); background: #eaf3fd; }
.tracker-item.answered { background: var(--success); border-color: var(--success); color: #fff; }

/* ===== Sonuc Sayfasi ===== */
.result-container { max-width: 700px; margin: 0 auto; text-align: center; }

.result-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 800;
    color: #fff;
    border: 8px solid rgba(255,255,255,0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.result-100 { background: linear-gradient(135deg, #f5af19, #f12711); }
.result-90 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.result-70 { background: linear-gradient(135deg, #4A90D9, #6C5CE7); }
.result-50 { background: linear-gradient(135deg, #F5A623, #E67E22); }
.result-low { background: linear-gradient(135deg, #E74C3C, #C0392B); }

.result-title { font-size: 32px; font-weight: 700; margin-bottom: 10px; }

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.stat-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-box .stat-value { font-size: 32px; font-weight: 800; }
.stat-box .stat-label { font-size: 13px; color: #888; margin-top: 5px; }
.stat-box.correct .stat-value { color: var(--success); }
.stat-box.wrong .stat-value { color: var(--danger); }
.stat-box.empty .stat-value { color: #95A5A6; }
.stat-box.time .stat-value { color: var(--primary); }

.achievement-banner {
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: #fff;
    padding: 15px 25px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 18px;
    margin: 20px 0;
    box-shadow: var(--shadow);
    animation: bounceIn 0.6s;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== Liste ve tablolar ===== */
.table-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 25px;
}

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

.table-card th {
    background: var(--dark);
    color: #fff;
    padding: 14px 18px;
    text-align: left;
    font-size: 14px;
}

.table-card td {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.table-card tr:hover td { background: #f8f9fa; }

.score-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
}

.score-badge.high { background: var(--success); }
.score-badge.mid { background: var(--warning); }
.score-badge.low { background: var(--danger); }

/* ===== Formlar ===== */
.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 460px;
    margin: 40px auto;
}

.auth-card h2 { margin-bottom: 20px; text-align: center; color: var(--dark); }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
    font-size: 14px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--dark);
    font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea { min-height: 100px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* ===== Bildirimler ===== */
.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-success { background: #eafaf1; border-color: var(--success); color: #27ae60; }
.alert-danger { background: #fdecea; border-color: var(--danger); color: #c0392b; }
.alert-info { background: #eaf2f8; border-color: var(--primary); color: #2980b9; }
.alert-warning { background: #fef5e7; border-color: var(--warning); color: #e67e22; }

/* ===== Panel/Dashboard ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-card .stat-icon { font-size: 36px; margin-bottom: 10px; }
.stat-card .stat-number { font-size: 32px; font-weight: 800; color: var(--dark); }
.stat-card .stat-name { font-size: 14px; color: #888; margin-top: 5px; }

/* ===== Dashboard ders performansi ===== */
.subject-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.subject-row .subject-icon { font-size: 26px; }
.subject-row .subject-info { flex: 1; }
.subject-row .subject-name { font-weight: 600; }
.subject-row .subject-stats { font-size: 13px; color: #888; }

.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: #eee;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--success), #2ecc71);
    transition: width 0.5s;
}

/* ===== Rozet grid ===== */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.badge-item {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.badge-item .badge-icon { font-size: 40px; margin-bottom: 8px; }
.badge-item .badge-name { font-weight: 600; font-size: 14px; }
.badge-item .badge-desc { font-size: 12px; color: #888; margin-top: 5px; }
.badge-item.locked { opacity: 0.45; filter: grayscale(1); }

/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: #aaa;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 14px;
}

/* ===== Admin ===== */
.admin-layout { display: flex; gap: 25px; align-items: flex-start; }

.admin-sidebar {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    min-width: 220px;
}

.admin-sidebar h4 { margin-bottom: 15px; color: var(--dark); font-size: 15px; text-transform: uppercase; }

.admin-sidebar a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.admin-sidebar a:hover, .admin-sidebar a.active { background: #eaf3fd; color: var(--primary); }

.admin-content { flex: 1; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; }

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
}

.pagination a:hover { background: #eaf3fd; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .empty-icon { font-size: 64px; margin-bottom: 15px; opacity: 0.4; }
.empty-state h3 { color: #888; margin-bottom: 10px; }

/* ===== Topic chips ===== */
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }

.topic-chip {
    padding: 6px 16px;
    border-radius: 20px;
    background: #fff;
    border: 2px solid var(--border);
    color: var(--dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.topic-chip:hover, .topic-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 10px; }
    .form-row { grid-template-columns: 1fr; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { min-width: 100%; }
    .page-title { font-size: 24px; }
    .quiz-nav { flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .container { padding: 15px 12px; }
    .question-card { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ===== Parola goster / gizle ===== */
.password-wrapper {
    position: relative;
    display: block;
}

.password-wrapper input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    -webkit-tap-highlight-color: transparent;
}

.toggle-password:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}

.toggle-password:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    display: block;
}

.toggle-password .ico-eye-off { display: none; }
.password-wrapper.is-visible .ico-eye { display: none; }
.password-wrapper.is-visible .ico-eye-off { display: block; }

@media (max-width: 480px) {
    .toggle-password { width: 34px; height: 34px; right: 5px; }
}