@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --navy: #1B2A4A;
    --navy-light: #2E4270;
    --ink: #22283A;
    --ink-light: #6B7280;
    --line: #E7E9EE;
    --bg: #FFFFFF;
    --panel: #F7F8FA;
    --pen-red: #C0392B;
    --check-green: #1E8E5A;
    --pending-amber: #C77700;
    --card-shadow: 0 1px 3px rgba(20,25,40,0.06);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.5;
}

h1, h2, h3 { color: var(--ink); margin: 0 0 6px; font-weight: 800; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }

a { color: var(--navy); }

/* ===== Basit sayfalar (login vb.) için eski .wrap ===== */
.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 18px 60px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--line);
    padding-bottom: 14px;
}
.topbar .who { font-size: 0.95rem; color: var(--ink-light); }

.login-box { max-width: 380px; margin: 8vh auto; text-align: center; }
.login-box .icon { font-size: 2.6rem; }

/* ===== Sidebar uygulama düzeni (öğretmen paneli) ===== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; }
.sidebar-brand .dot {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--navy); color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
}
.sidebar-brand .txt { font-weight: 800; font-size: 1.02rem; line-height: 1.15; color: var(--ink); }
.sidebar-brand .txt small { display:block; font-weight:600; font-size:0.72rem; color: var(--ink-light); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.92rem;
}
.side-nav a:hover { background: var(--panel); }
.side-nav a.active { background: var(--navy); color: #fff; }
.side-nav .logout-link { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--ink-light); }

.main-content { flex: 1; padding: 26px 32px 60px; max-width: 1100px; }
.page-topbar {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px; margin-bottom: 22px;
}
.page-topbar .who { font-size: 0.9rem; color: var(--ink-light); }

@media (max-width: 780px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); }
    .side-nav { flex-direction: row; flex-wrap: wrap; }
    .main-content { padding: 20px 16px 50px; }
}

/* ===== Ortak bileşenler ===== */
.btn {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn.secondary { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn.danger { background: var(--pen-red); }
.btn.small { padding: 6px 14px; font-size: 0.85rem; }

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 20px 22px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
}

input[type=text], input[type=password], input[type=file], input[type=date],
input[type=time], input[type=number], select, textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 2px solid var(--line);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    margin-top: 6px;
    margin-bottom: 16px;
    background: var(--panel);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--navy);
}
label { font-weight: 700; font-size: 0.92rem; color: var(--ink-light); }

.error {
    background: #FBEAE6; color: var(--pen-red);
    padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600;
}
.success {
    background: #E6F3EC; color: var(--check-green);
    padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600;
}

.hw-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hw-item .status-badge {
    flex-shrink: 0; padding: 8px 16px; border-radius: 999px;
    font-weight: 800; font-size: 0.85rem; white-space: nowrap;
}
.status-badge.done { background: #E6F3EC; color: var(--check-green); }
.status-badge.pending { background: #FBF1E0; color: var(--pending-amber); }

.hw-desc { color: var(--ink-light); margin-top: 4px; white-space: pre-wrap; }
.hw-date { font-size: 0.8rem; color: var(--ink-light); margin-top: 8px; }

.upload-row { margin-top: 12px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.upload-row input[type=file] { margin-bottom: 0; flex: 1; min-width: 200px; }

.thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 0.9rem; color: var(--ink-light); text-transform: uppercase; letter-spacing: .02em; }

.matrix-table { overflow-x: auto; }
.matrix-table table { min-width: 600px; }
.mark { font-size: 1.2rem; }
.mark.yes { color: var(--check-green); }
.mark.no { color: var(--line); }

.empty { text-align: center; color: var(--ink-light); padding: 30px 10px; }
.footer-note { text-align: center; color: var(--ink-light); font-size: 0.85rem; margin-top: 30px; }

/* ===== Haftalık tablo (takvim) ===== */
.week-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.week-range { color: var(--ink-light); font-size: 0.85rem; margin-left: auto; }

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 10px;
    overflow-x: auto;
}
.week-day {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    min-height: 140px;
    padding: 8px;
}
.week-day.today { border-color: var(--navy); background: #EEF1F8; }
.week-day-head { font-weight: 800; font-size: 0.78rem; color: var(--ink-light); text-transform: uppercase; }
.week-day-num { font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.week-day.today .week-day-num { color: var(--navy); }

.chip {
    display: block;
    border-radius: 8px;
    padding: 5px 7px;
    margin-bottom: 5px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}
.chip.lesson { background: #E7EDFB; color: var(--navy); }
.chip.hw-pending { background: #FBF1E0; color: var(--pending-amber); }
.chip.hw-done { background: #E6F3EC; color: var(--check-green); }
.chip small { display: block; font-weight: 600; opacity: 0.85; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 0.78rem; color: var(--ink-light); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ===== Zoom kutusu ===== */
.zoom-box {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    background: var(--navy); color: #fff;
    border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px;
}
.zoom-box.idle { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.zoom-box .btn { background: #fff; color: var(--navy); }
.zoom-box.idle .btn { background: var(--navy); color: #fff; }

/* ===== Deneme kutucukları (D/Y/Boş) ===== */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 12px 0 18px; }
.exam-q { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.exam-q .qnum { font-weight: 800; width: 26px; flex-shrink: 0; }
.exam-q .opts { display: flex; gap: 6px; }
.exam-q label { display: flex; align-items: center; gap: 3px; font-weight: 700; font-size: 0.78rem; color: var(--ink-light); cursor: pointer; }
.exam-q input[type=radio] { margin: 0; width: auto; }
.exam-summary { display: flex; gap: 18px; font-weight: 800; }
.exam-summary .d { color: var(--check-green); }
.exam-summary .y { color: var(--pen-red); }
.exam-summary .b { color: var(--ink-light); }

/* ===== Tik kutuları (konu takibi) ===== */
.tick-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tick-row label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.tick-row input[type=checkbox] { width: auto; margin: 0; }

.mini-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.mini-form > div { flex: 1; min-width: 140px; }

/* ===== Modern giriş ekranı (öğrenci) ===== */
.login-screen {
    min-height: 100vh;
    display: flex;
}
.login-side {
    flex: 1;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.login-side .deco {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.login-side .deco.d1 { width: 320px; height: 320px; top: -120px; left: -100px; }
.login-side .deco.d2 { width: 220px; height: 220px; bottom: -80px; right: -60px; }
.login-side .deco.d3 { width: 140px; height: 140px; bottom: 20%; left: 10%; background: rgba(255,255,255,0.05); }
.login-side .brand-mark {
    width: 84px; height: 84px; border-radius: 22px;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; font-weight: 800; margin-bottom: 22px;
    border: 2px solid rgba(255,255,255,0.35);
    position: relative; z-index: 1;
}
.login-side h1 { font-size: 1.9rem; margin-bottom: 10px; position: relative; z-index: 1; }
.login-side p { opacity: .88; max-width: 320px; line-height: 1.6; position: relative; z-index: 1; }

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #fff;
}
.login-card-modern { width: 100%; max-width: 380px; }
.login-card-modern h2 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card-modern .sub { color: var(--ink-light); margin-bottom: 26px; font-size: 0.92rem; }
.login-card-modern label { display: block; margin-bottom: 6px; }
.login-card-modern input { font-size: 1.02rem; padding: 13px 14px; }
.login-card-modern .btn { width: 100%; padding: 13px; font-size: 1rem; margin-top: 4px; }
.login-card-modern .footer-note { margin-top: 20px; }

@media (max-width: 820px) {
    .login-screen { flex-direction: column; }
    .login-side { padding: 36px 24px; min-height: 200px; }
    .login-side .brand-mark { width: 64px; height: 64px; font-size: 1.5rem; margin-bottom: 14px; }
    .login-side h1 { font-size: 1.4rem; }
    .login-side p { display: none; }
}

/* ===== Hatırlatma kutusu ===== */
.reminder-box {
    background: #FFF7E6;
    border: 1px solid var(--pending-amber);
    color: var(--ink);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
}
.reminder-box strong { color: var(--pending-amber); }
.reminder-box ul { margin: 8px 0 0; padding-left: 20px; }
.reminder-box li { margin-bottom: 4px; }
