/* =========================================
   DİJİTAL SPORUM - MASTER CSS (FULL)
   ========================================= */

/* 1. DEĞİŞKENLER VE TEMEL AYARLAR */
:root {
    --bg-color: #F5F0EB;       /* Krem Arka Plan */
    --primary: #8D6E63;        /* Ana Kahve */
    --primary-light: #D7CCC8;  /* Açık Kahve */
    --primary-dark: #5D4037;   /* Koyu Kahve */
    --text-dark: #3E2723;      /* Koyu Yazı */
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(141, 110, 99, 0.15);
    --radius: 12px;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 70px;
}

body {
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

*, *:before, *:after { box-sizing: border-box; }
a { text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

/* 2. GİRİŞ EKRANI (LOGIN) */
.login-box {
    width: 100%;
    max-width: 400px;
    margin: 5vh auto;
    text-align: center;
}
/* Login sayfası body'sine özel sınıf eklenebilir veya genel body kullanılır */

/* 3. INPUTLAR VE FORMLAR (MODERN) */
input[type="text"], 
input[type="password"], 
input[type="date"], 
input[type="number"], 
input[type="email"], 
select, 
textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    background: #FAFAFA;
    color: var(--text-dark);
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
    display: block;
}

input:focus, select:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1);
}

/* 4. BUTONLAR */
.btn {
    background-color: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    transition: 0.3s;
}
.btn:hover { background-color: var(--primary-dark); transform: translateY(-2px); }

.btn-delete {
    background-color: #ffebee;
    color: #c62828;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}
.btn-delete:hover { background-color: #c62828; color: white; }

/* 5. SIDEBAR (SOL MENÜ) */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid #E0E0E0;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s ease;
    display: flex; flex-direction: column;
}

.sidebar.collapsed { width: var(--sidebar-width-collapsed); }

.sidebar-header { 
    padding: 20px; 
    font-weight: bold; 
    color: var(--primary); 
    border-bottom: 1px solid #eee; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    height: 70px;
    white-space: nowrap;
    overflow: hidden; 
}

.sidebar-menu { padding: 15px; flex-grow: 1; overflow-y: auto; }
.sidebar-menu li { margin-bottom: 5px; }

.sidebar-menu a { 
    display: flex; 
    align-items: center; 
    padding: 12px; 
    color: var(--text-dark); 
    border-radius: 8px; 
    white-space: nowrap; 
    overflow: hidden; 
}

.sidebar-menu a i { 
    min-width: 25px; 
    text-align: center; 
    margin-right: 10px; 
    color: var(--primary); 
    font-size: 18px; 
}

.sidebar-menu a:hover, .sidebar-menu a.active { background-color: #FAF8F6; color: var(--primary-dark); }
.sidebar-menu a.active i { color: var(--primary-dark); }
.sidebar.collapsed .sidebar-text { display: none; }

/* 6. ANA İÇERİK (MAIN CONTENT) */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: margin-left 0.3s ease;
}
.sidebar.collapsed + .main-content { margin-left: var(--sidebar-width-collapsed); }
.top-bar { margin-bottom: 20px; }
.menu-toggle-btn { background: none; border: none; font-size: 24px; color: var(--primary); cursor: pointer; }

/* 7. DASHBOARD GRID (ANA PANEL KARTLARI) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.5);
    transition: 0.3s;
}
.stat-card:hover { transform: translateY(-3px); }

.stat-info h3 { margin: 0 0 5px 0; font-size: 28px; color: var(--text-dark); }
.stat-info p { margin: 0; color: #888; font-size: 14px; }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}

/* 8. GENEL KARTLAR VE TABLO */
.card { 
    background: var(--white); 
    padding: 20px; 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    border: 1px solid rgba(255,255,255,0.5); 
    margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; }
table th { font-weight: 600; font-size: 14px; padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
table td { font-size: 14px; color: #555; padding: 12px; border-bottom: 1px solid #f9f9f9; }

/* 9. ÖZEL BİLEŞENLER (Dosya Yükleme, Switch, Radyo) */

/* Dosya Yükleme Kutusu */
.file-upload-wrapper {
    position: relative; width: 100%; height: 48px; 
    border: 2px dashed var(--primary-light); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; 
    background: #faf8f6; cursor: pointer; color: var(--primary); 
    font-weight: 500; font-size: 13px; gap: 8px;
}
.file-upload-wrapper:hover { border-color: var(--primary); background: #fff; }
.file-upload-wrapper input[type="file"] { position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Toggle Switch */
.switch-container { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 5px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* Radyo Grubu */
.radio-group { display: flex; gap: 20px; margin-bottom: 15px; align-items: center; }
.radio-group label { cursor: pointer; display: flex; align-items: center; gap: 5px; font-weight: 500; font-size: 14px; }
.radio-group input { width: auto; margin: 0; }

/* 10. MODAL (AÇILIR PENCERE - DÜZELTİLMİŞ) */
.modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); 
    z-index: 99999; /* En üstte durması için yüksek değer */
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white); 
    padding: 30px; 
    border-radius: 16px; 
    width: 600px; 
    max-width: 90%; 
    max-height: 90vh; 
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); 
    position: relative; 
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.close-modal { position: absolute; top: 20px; right: 20px; font-size: 24px; color: #999; cursor: pointer; }
.close-modal:hover { color: red; }

/* 11. ÖĞRENCİ DETAY (SPLIT LAYOUT) */
.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    align-items: start;
}

/* Sol Profil Kartı */
.profile-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(141, 110, 99, 0.1);
    position: sticky;
    top: 20px; 
}

.profile-img-box {
    width: 120px; height: 120px; margin: 0 auto 15px;
    border-radius: 50%; overflow: hidden;
    border: 4px solid var(--bg-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.profile-img-box img { width: 100%; height: 100%; object-fit: cover; }

.profile-name { font-size: 20px; font-weight: 700; color: var(--primary-dark); margin: 0; }
.profile-group { color: #888; font-size: 14px; margin-top: 5px; font-weight: 500; }

.profile-badge { display: inline-block; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: bold; margin: 15px 0; }
.active-badge { background: #E8F5E9; color: #2E7D32; }
.passive-badge { background: #FFEBEE; color: #C62828; }

.profile-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }

/* Sağ Detay Kartı */
.detail-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    border: 1px solid rgba(141, 110, 99, 0.1);
    min-height: 500px;
}

/* 12. SEKMELER (TABS) */
.tab-nav { display: flex; gap: 20px; border-bottom: 2px solid #eee; margin-bottom: 0; padding: 20px 20px 0 20px; }
.tab-link { padding: 10px 0; cursor: pointer; font-weight: 600; color: #888; border-bottom: 3px solid transparent; transition: 0.3s; }
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; animation: fadeIn 0.4s; }
.tab-pane.active { display: block; }

/* 13. ANİMASYONLAR */
.fade-in { animation: fadeIn 0.6s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* 14. RESPONSIVE */
@media (max-width: 900px) {
    .profile-container { grid-template-columns: 1fr; }
    .profile-card { position: static; }
    .sidebar { position: fixed; transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.active { transform: translateX(0); } /* Mobil menü için */
    .main-content { margin-left: 0; }
}
/* --- MODAL DÜZELTMESİ (BOŞLUK SORUNU İÇİN) --- */

/* Modal açıldığında sayfayı kilitle */
body.modal-open {
    overflow: hidden !important;
    height: 100vh;
}

/* Overlay'i (Siyah Perdeyi) Garanti Altına Al */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;   /* Ekranın tamamı */
    height: 100vh;  /* Ekranın tamamı */
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none; /* JS ile flex yapılacak */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    overflow: hidden; /* Taşmayı engelle */
}
/* --- YOKLAMA MODÜLÜ (PROFESYONEL BUTONLAR) --- */

/* Yoklama Kartı (Öğrenci Satırı) */
.att-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: 0.2s;
}
.att-row:hover { background: #faf8f6; }

/* Öğrenci Bilgisi */
.att-student { display: flex; align-items: center; gap: 12px; flex-grow: 1; }
.att-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #eee; }

/* Radyo Buton Grubu (Segmented Control) */
.att-options {
    display: flex;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.att-radio { display: none; } /* Orjinal radyoyu gizle */

.att-label {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    transition: 0.2s;
    display: flex; align-items: center; gap: 5px;
}

/* Seçilince Renk Değişimi */
.att-radio:checked + .lbl-present { background: #E8F5E9; color: #2E7D32; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.att-radio:checked + .lbl-absent  { background: #FFEBEE; color: #C62828; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.att-radio:checked + .lbl-late    { background: #FFF3E0; color: #EF6C00; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.att-radio:checked + .lbl-excused { background: #E3F2FD; color: #1565C0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Hover Efektleri */
.lbl-present:hover { background: #e8f5e9; }
.lbl-absent:hover  { background: #ffebee; }
.lbl-late:hover    { background: #fff3e0; }
.lbl-excused:hover { background: #e3f2fd; }

/* Takvim Kartı */
.date-card {
    text-align: center;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: 0.2s;
}
.date-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.date-day { font-size: 24px; font-weight: bold; color: var(--primary); }
.date-month { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.date-status { margin-top: 5px; font-size: 11px; padding: 3px 8px; border-radius: 10px; background: #eee; display: inline-block; }
/* YOKLAMA BUTONLARI (TIKLAMA SORUNU ÇÖZÜMÜ) */
.att-options {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
    position: relative;
    z-index: 10; /* En üstte olsun */
}

.att-radio {
    display: none; /* Radyo butonunu gizle */
}

.att-label {
    padding: 8px 15px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    color: #666;
    transition: 0.2s;
    background: #fff;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none; /* Metin seçimini engelle */
    pointer-events: auto; /* Tıklamayı garanti et */
}

.gallery-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}
/* Seçili Durumlar (Renklendirme) */
.att-radio:checked + .lbl-present { background: #E8F5E9; color: #2E7D32; border-color: #2E7D32; }
.att-radio:checked + .lbl-absent  { background: #FFEBEE; color: #C62828; border-color: #C62828; }
.att-radio:checked + .lbl-late    { background: #FFF3E0; color: #EF6C00; border-color: #EF6C00; }
.att-radio:checked + .lbl-excused { background: #E3F2FD; color: #1565C0; border-color: #1565C0; }

/* Hover Efekti */
.att-label:hover { background: #fafafa; }

/* ====================================
   MOBİL SIDEBAR DÜZELTMESİ
   ==================================== */

/* Overlay (Siyah Perde) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobil için düzeltmeler */
@media (max-width: 900px) {
    /* Sidebar varsayılan gizli */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    /* Sidebar açıldığında */
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Main content sola kaymasın */
    .main-content {
        margin-left: 0 !important;
    }
    
    /* Toggle butonu mobilde görünsün */
    .menu-toggle-btn {
        display: block;
        font-size: 24px;
        padding: 10px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--primary);
    }
    
    /* Body scroll kilidi (menü açıkken) */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Desktop'ta overlay gizli */
@media (min-width: 901px) {
    .sidebar-overlay {
        display: none !important;
    }
}