/* --- Genel Ayarlar ve Modern Dokunuşlar --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --primary-color: #4a6cf7;
    --dark-blue: #343a40;
    --light-gray: #f4f7f6;
    --text-color: #333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --card-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Giriş Sayfası Stilleri (login.php) --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.login-container {
    padding: 2.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    box-sizing: border-box;
}
.login-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--dark-blue);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
}
.btn {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.btn:hover { background-color: #3957d8; }
.error { color: #dc3545; text-align: center; margin-top: 1rem; font-size: 0.9rem; }


/* --- Ana Arayüz Stilleri (index.php, karne.php, vb.) --- */

/* Üst Bar */
.top-bar {
    background: #fff;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.top-bar h2 { margin: 0; font-size: 1.2rem; }
.top-bar .logout-link { color: var(--text-light); text-decoration: none; }

/* Mobil Menü Butonu (Başlangıçta gizli) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.container { display: flex; }

/* Kenar Çubuğu (Sidebar) */
.sidebar {
    width: 260px;
    background: var(--dark-blue);
    color: white;
    min-height: calc(100vh - 57px);
    padding: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out;
}
.sidebar h3 { border-bottom: 1px solid #495057; padding-bottom: 0.5rem; margin-top:0; font-weight: 500; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li a {
    color: #adb5bd;
    text-decoration: none;
    display: block;
    padding: 0.75rem 0.5rem;
    transition: all 0.2s ease;
    border-radius: 6px;
}
.sidebar ul li a:hover { color: #fff; background-color: #495057; }
.sidebar .sub-menu { padding-left: 1.5rem; }
.sidebar .sub-menu a { font-size: 0.9em; }
.sidebar .sidebar-link {
    font-weight: 500;
    color: #adb5bd;
    text-decoration: none;
    padding: 0.75rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.sidebar .sidebar-link:hover { color: #fff; background-color: #495057; }
.sidebar .sidebar-link.active { color: #fff; font-weight: 600; }

/* Ana İçerik Alanı */
.main-content-area {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}
.content-card, .welcome-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--card-shadow);
}
.content-body img { max-width: 100%; height: auto; border-radius: 8px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }


/* --- RESPONSIVE KURALLARI (Mobil Uyumluluk) --- */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 1001;
        transform: translateX(-100%); /* Başlangıçta ekranın dışında */
        padding-top: 5rem;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    .sidebar.active {
        transform: translateX(0); /* Aktif olunca ekranın içine kayar */
    }
    .main-content-area {
        padding: 1.5rem;
    }
    .menu-toggle {
        display: block; /* Mobil menü butonunu görünür yap */
    }
    /* Menü açıldığında içeriğin üstünü karartmak için overlay */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    .overlay.active {
        display: block;
    }
}

/* --- Karne Sayfası Filtre Formu Stilleri --- */
.filter-form {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.filter-form .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

/* --- RESPONSIVE TABLO (KART GÖRÜNÜMÜ) --- */
/* Sadece mobil cihazlarda (600px ve altı) geçerli olacak kurallar */
@media (max-width: 600px) {
    .table-wrapper table thead {
        /* Tablo başlığını gizle */
        display: none;
    }
    .table-wrapper table tr {
        /* Her bir satırı bir kart gibi göster */
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        box-shadow: var(--card-shadow);
    }
    .table-wrapper table td {
        /* Hücreleri alt alta göstermek için flex yerine block kullanıyoruz */
        display: block;
        text-align: left; /* Metni sola yaslıyoruz */
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid #f0f0f0;
    }
    .table-wrapper table tr td:last-child {
        border-bottom: none;
    }
    .table-wrapper table td::before {
        /* data-label'daki başlık metnini içeriğin başına ekle */
        content: attr(data-label);
        font-weight: 600;
        display: block; /* Başlığın kendi satırında olmasını sağla */
        margin-bottom: 0.25rem; /* Başlık ile içerik arasına boşluk koy */
        color: var(--text-light); /* Başlığı biraz daha soluk yap */
        font-size: 0.8em; /* Başlığı biraz küçült */
    }
}
/* --- YENİ: Alıştırma Sayfası Stilleri --- */
.grup-listesi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}
.grup-karti {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.grup-karti:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.grup-karti strong {
    color: var(--primary-color);
}
.grup-karti span {
    font-size: 0.9em;
    color: var(--text-light);
}

.kelime-secim-listesi {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.kelime-secim-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.kelime-secim-item:last-child {
    border-bottom: none;
}
.kelime-secim-item input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
}
.btn-link {
    display: inline-block;
    margin-left: 1rem;
    color: var(--text-light);
    text-decoration: none;
}

/* Flashcard Stilleri */
.flashcard-container {
    perspective: 1000px;
    margin-top: 2rem;
}
.flashcard {
    width: 100%;
    min-height: 250px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    background-color: #fff;
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
}
.flashcard.is-flipped {
    transform: rotateY(180deg);
}
.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.5rem;
    padding: 1rem;
    box-sizing: border-box;
}
.flashcard-front {
    color: var(--dark-blue);
}
.flashcard-back {
    color: var(--primary-color);
    transform: rotateY(180deg);
}
.flashcard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}
.btn-nav {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}
.btn-nav:hover {
    background-color: var(--light-gray);
    border-color: #ccc;
}

/* --- Sidebar Kapatma (X) Butonu Stilleri --- */
.close-menu-btn {
    display: none; /* Varsayılan olarak masaüstünde gizli */
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-menu-btn:hover {
    color: #fff;
}

/* Sadece mobil görünümde (992px ve altı) butonu göster */
@media (max-width: 992px) {
    .close-menu-btn {
        display: block;
    }
}

/* --- Dropdown Menü Stilleri (GÜNCELLENMİŞ) --- */
.sidebar .sidebar-link {
    display: flex;
    justify-content: flex-start; /* Varsayılan olarak tüm ikon ve metinleri sola yasla */
    align-items: center;
    gap: 0.75rem; /* İkon ve metin arasına boşluk ekle */
}

/* SADECE alt menüsü olan linkler için ikonu sağa it */
.sidebar li.has-submenu > a.sidebar-link {
    justify-content: space-between;
}

.sidebar .sub-menu {
    padding-left: 1rem;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}
.sidebar li.active > .sub-menu {
    max-height: 900px; /* İçeriğin sığacağı bir yükseklik */
}
.sidebar .dropdown-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease-in-out;
}
.sidebar li.active > .sidebar-link .dropdown-icon {
    transform: rotate(180deg);
}
.sidebar .sidebar-link.active-page {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

/* --- YENİ: Responsive Google Sheets Iframe Stilleri --- */
.responsive-iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 75%; 
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.responsive-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- YENİ: Öğrenci Paneli İstatistik Kutuları Stilleri --- */
/* --- YENİ: Öğrenci Paneli İstatistik Kutuları Stilleri (Son Düzeltme) --- */

/* Bu dış konteyner, genişliği ve hizalamayı kontrol eder */
.stats-wrapper {
    max-width: 900px;
    margin: 2rem auto 0;
}

/* Bu iç grid ise sadece elemanları sıralar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Kutuların mobil cihazlarda alt alta gelmesini sağla */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-card .icon {
    font-size: 1.8rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* İkon renkleri */
.stat-card .icon.bg-primary { background-color: var(--primary-color); }
.stat-card .icon.bg-success { background-color: #198754; }
.stat-card .icon.bg-warning { background-color: #fd7e14; }
.stat-card .icon.bg-info { background-color: #0dcaf0; }

.stat-card .info .title {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    font-weight: 500;
}

.stat-card .info .value {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0.25rem 0 0 0;
}

/* --- YENİ: Buton Gibi Görünen Linkler İçin Düzeltme --- */
a.btn {
    text-decoration: none; /* Alt çizgiyi kaldırır */
    display: flex; /* İçeriği (ikon ve metin) ortalamak için */
    justify-content: center; /* İçeriği yatayda ortala */
    align-items: center; /* İçeriği dikeyde ortala */
}