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

:root {
    --primary: #14B8A6;
    --primary-dark: #0F766E;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #6366F1;
    --dark: #1F2937;
    --gray: #6B7280;
    --light-gray: #F3F4F6;
    --border: #E5E7EB;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Eğlenceli Dersler Renkleri */
    --anaokulu-color: #FF6B6B;
    --ilkokul-color: #4ECDC4;
    --ortaokul-color: #95E1D3;
    --lise-color: #F38181;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-gray);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== TOP HEADER ===== */
.top-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.header-left .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.header-left .logo span {
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 16px;
}

/* Kurum Modu: Navigasyonu Her Zaman Göster */
body.kurum-mode .main-nav {
    display: flex !important;
}

body.kurum-mode .main-nav .tab-btn:not(.inst-nav-btn) {
    display: none !important;
}

body.kurum-mode .main-nav .tab-btn.inst-nav-btn {
    display: inline-block !important;
}


.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
}

.icon-btn:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
    transform: translateY(-2px);
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.profile-trigger:hover {
    background: rgba(20, 184, 166, 0.08);
    /* Hafif turkuaz arka plan */
}

.profile-trigger:active {
    transform: scale(0.98);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.2;
}

.user-class {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

.user-level-badge {
    margin-top: 4px;
    font-size: 0.7rem;
    background: linear-gradient(135deg, #FFD700, #FDB931);
    color: #856404;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 800;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(253, 185, 49, 0.3);
    text-transform: uppercase;
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    justify-content: space-around;
    align-items: center;
}

.mobile-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gray);
}

.mobile-tab span {
    font-size: 0.7rem;
    font-weight: 500;
}

.mobile-tab.active {
    color: var(--primary);
    background: rgba(20, 184, 166, 0.1);
}

/* ===== AUTHENTICATION PAGE ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #f0fdfa 0%, #f8fafc 100%);
    padding: 2rem;
}

.auth-box {
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

.auth-box .logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-box .logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-box .logo p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* Auth Tabs (Genel/Kurum) */
.tab-buttons {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 24px;
}

.tab-buttons .tab-btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    background: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-buttons .tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Form Toggle (Giriş/Kayıt) */
.form-toggle {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid #f1f5f9;
}

.toggle-btn {
    padding: 12px 4px;
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    background: none;
    border: none;
    outline: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: none;
}

.toggle-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-form {
    display: none;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-form.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form h2 {
    display: none;
    /* Already clear from context */
}

.auth-form .btn-primary {
    width: 100%;
    margin-top: 1.5rem;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.forgot-password {
    text-align: center;
    margin-top: 1.25rem;
}

/* Beni Hatırla Modern Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 1rem 0;
    padding: 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    cursor: pointer;
    color: #64748b;
    font-weight: 500;
    user-select: none;
    transition: color 0.3s ease;
}

.checkbox-group:hover label {
    color: var(--primary-dark);
}


.forgot-password a {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Spinner & Alert Fixes */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 32px;
    border-radius: 16px;
    font-size: 1rem;
    display: none;
    text-align: center;
    font-weight: 600;
    z-index: 99999;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: alertPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes alertPop {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 2px solid #22c55e;
    display: block;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 2px solid #ef4444;
    display: block;
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== INFO CARDS GRID ===== */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===== MODERN CARD BASE ===== */
.progress-card,
.success-card,
.leaderboard-widget {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-card:hover,
.success-card:hover,
.leaderboard-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

/* Remove old border-left */
.progress-card {
    border-left: none;
}

.success-card {
    border-left: none;
}

.leaderboard-widget {
    border-left: none;
}

.progress-card h4,
.success-card h4,
.leaderboard-widget h4 {
    margin-bottom: 1.25rem;
    color: #475569;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-info {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    /* Allow wrapping for long numbers/small screens */
}

.progress-info .current {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.progress-info .separator {
    font-size: 1.5rem;
    color: #cbd5e1;
    margin: 0 4px;
    display: inline-block;
    /* Ensure it stays with numbers if possible, but wrapping is OK */
}

.progress-info .target {
    font-size: 1.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.progress-info .unit {
    font-size: 1rem;
    color: #94a3b8;
    margin-left: 0.5rem;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 14px;
    background: #f1f5f9;
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #2dd4bf 100%);
    border-radius: 50px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-stats .percentage {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    background: #f0fdfa;
    padding: 4px 12px;
    border-radius: 50px;
}

.progress-stats .remaining {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* Success Card Specifics */
.success-rate {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.success-detail {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 12px;
    display: inline-block;
}

/* ===== LEADERBOARD WIDGET ===== */
.leaderboard-widget {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--info);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 10px;
}

.widget-header h4 {
    margin: 0;
    color: var(--dark);
}

.leaderboard-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lb-tab {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.lb-tab:hover {
    background: var(--border);
}

.lb-tab.active {
    background: var(--info);
    color: var(--white);
}

.leaderboard-list {
    /* max-height: 300px;  Removed fixed height as we only show 1 item now */
    overflow-y: visible;
    /* No scroll needed for single item */
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.leaderboard-item:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    border-color: #e2e8f0;
}

.leaderboard-item.current-user {
    background: #f0f9ff;
    border: 1.5px solid var(--primary);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.leaderboard-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.leaderboard-rank.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.leaderboard-rank.silver {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.3);
}

.leaderboard-rank.bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(180, 83, 9, 0.3);
}

.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}


.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-detail {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
}

.leaderboard-score {
    font-size: 1rem;
    font-weight: 800;
    color: #0ea5e9;
    background: #f0f9ff;
    padding: 6px 12px;
    border-radius: 10px;
    white-space: nowrap;
}

/* ===== RANKING TABLE STYLES ===== */
.ranking-table-widget {
    padding: 20px;
}

.ranking-table-container {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ranking-table thead tr {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
}

.ranking-table th {
    padding: 12px 16px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.ranking-table th:first-child {
    text-align: left;
    border-radius: 8px 0 0 0;
}

.ranking-table th:last-child {
    border-radius: 0 8px 0 0;
}

.ranking-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.ranking-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.ranking-table tbody tr:hover {
    background: #f0fdfa;
}

.ranking-table td {
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    color: #1e293b;
}

.ranking-table td:first-child {
    text-align: left;
    font-weight: 700;
    color: #475569;
}

.ranking-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 8px;
}

.ranking-table tbody tr:last-child td:last-child {
    border-radius: 0 0 8px 0;
}

.no-data {
    text-align: center;
    color: var(--gray);
    padding: 1rem;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ===== CARD ===== */
.card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    /* Sağa yasla */
    margin-top: 5px;
    margin-bottom: 15px;
}

.checkbox-group label {
    margin-bottom: 0 !important;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

/* Custom Checkbox Styling */
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.card h3 {
    margin-bottom: 2rem;
    color: #1e293b;
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-icon-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* ===== FORMS ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
    font-family: inherit;
    color: #1e293b;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

.form-group input[readonly] {
    background: #f1f5f9;
    color: #64748b;
    border-style: dashed;
    cursor: default;
}

/* ===== ANALYSIS CARDS ===== */
.analysis-sub-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.analysis-sub-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.analysis-sub-card h4 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(20, 184, 166, 0.3);
}

.btn-outline {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-outline.active {
    background: var(--primary);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

.btn-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 250px;
    margin: 24px auto 0;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, #0d9488 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(20, 184, 166, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(20, 184, 166, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.btn-save:active {
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #DC2626;
}

.quick-period-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* ===== FILTER BUTTONS ===== */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
}

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

.data-table thead {
    background: var(--light-gray);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.data-table tbody tr:hover {
    background: var(--light-gray);
}

/* ===== BOOKS GRID ===== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.book-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.book-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.book-card h4 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.book-progress {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--gray);
}

.book-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark);
}

.modal-close {
    background: #ef4444;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

.modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ===== LOADING ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== INSTITUTION PANEL TABS ===== */
.inst-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.inst-tab:hover {
    color: var(--primary);
    background: #f8fafc;
}

.inst-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.inst-tab-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 1rem;
        height: 60px;
    }

    .main-nav {
        display: none;
    }

    .mobile-nav {
        display: flex;
        justify-content: space-around;
    }

    .user-info {
        display: none;
    }

    .main-container {
        padding: 1rem;
        padding-bottom: 80px;
    }

    .info-cards-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .quick-period-buttons,
    .filter-buttons {
        flex-direction: column;
    }

    .book-actions {
        flex-direction: column;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    /* Table Container Mobile Fix */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    /* === KURUM PANELİ MOBİL RESPONSIVE === */
    body.kurum-mode .top-header {
        height: auto !important;
        flex-direction: column;
        padding: 10px 15px !important;
        gap: 10px;
        background: rgba(255, 255, 255, 0.98);
    }

    body.kurum-mode .header-left,
    body.kurum-mode .header-right {
        width: 100%;
        justify-content: space-between;
    }

    body.kurum-mode .logo {
        font-size: 1.2rem;
    }

    body.kurum-mode .main-nav {
        display: flex !important;
        width: 100%;
        overflow-x: auto;
        padding: 5px 2px 10px 2px;
        gap: 10px;
        background: transparent;
        border-radius: 0;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll iOS */
        scrollbar-width: none;
        /* Firefox scrollbar gizle */
    }

    body.kurum-mode .main-nav::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari scrollbar gizle */
    }

    body.kurum-mode .tab-btn {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.85rem;
        background: white !important;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    }

    body.kurum-mode .tab-btn.active {
        background: var(--primary) !important;
        color: white !important;
        border-color: var(--primary);
        box-shadow: 0 4px 10px rgba(20, 184, 166, 0.2);
    }

    /* Kartlar Mobilde */
    body.kurum-mode .card {
        margin-bottom: 15px !important;
        padding: 15px !important;
    }

    body.kurum-mode .info-cards-grid {
        gap: 15px !important;
    }

    /* Tabloları Kart Görünüme Çevir - SADECE RAPOR TABLOLARI */
    body.kurum-mode #inst-report-results table,
    body.kurum-mode #inst-report-results thead,
    body.kurum-mode #inst-report-results tbody,
    body.kurum-mode #inst-report-results th,
    body.kurum-mode #inst-report-results td,
    body.kurum-mode #inst-report-results tr {
        display: block;
    }

    /* Başlık satırını gizle - SADECE RAPORLAR */
    body.kurum-mode #inst-report-results thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    body.kurum-mode #inst-report-results tr {
        border: 1px solid #e2e8f0;
        margin-bottom: 12px;
        border-radius: 12px;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        padding: 10px;
    }

    body.kurum-mode #inst-report-results td {
        border: none;
        position: relative;
        padding-left: 45% !important;
        /* soldan boşluk bırak */
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        text-align: right !important;
        /* içeriği sağa yasla */
        border-bottom: 1px solid #f1f5f9;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-height: 40px;
    }

    body.kurum-mode #inst-report-results td:last-child {
        border-bottom: none;
    }

    body.kurum-mode #inst-report-results td::before {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: #64748b;
        content: attr(data-label);
        font-size: 0.85rem;
    }

    /* Eğer data-label yoksa normal göster (fallback) */
    body.kurum-mode #inst-report-results td:not([data-label]) {
        padding-left: 10px !important;
        text-align: left !important;
        justify-content: flex-start;
    }

    /* ÖĞRENCİ LİSTESİ MOBİL KART GÖRÜNÜMÜ - PREMIUM DESIGN */
    body.kurum-mode .table-container {
        overflow-x: visible !important;
        border: none !important;
        padding: 0 5px;
    }

    body.kurum-mode .data-table {
        display: block !important;
        border: none !important;
        min-width: unset !important;
        width: 100% !important;
    }

    body.kurum-mode .data-table thead {
        display: none !important;
    }

    body.kurum-mode .data-table tbody {
        display: block !important;
    }

    /* Premium Card Design */
    body.kurum-mode .data-table tr {
        display: block !important;
        margin-bottom: 20px;
        border: none;
        border-radius: 16px;
        padding: 0;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.06),
            0 1px 3px rgba(0, 0, 0, 0.04);
        position: relative;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Gradient Top Border Accent */
    body.kurum-mode .data-table tr::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
        opacity: 0.8;
    }

    /* Hover & Active States */
    body.kurum-mode .data-table tr:hover {
        transform: translateY(-2px);
        box-shadow:
            0 8px 30px rgba(0, 0, 0, 0.1),
            0 2px 6px rgba(0, 0, 0, 0.06);
    }

    body.kurum-mode .data-table tr:active {
        transform: translateY(0);
    }

    /* Card Content Wrapper */
    body.kurum-mode .data-table td {
        display: block !important;
        text-align: left !important;
        padding: 10px 18px !important;
        border: none !important;
        position: relative;
        white-space: normal !important;
    }

    /* First td - Student Name (Special Styling) */
    body.kurum-mode .data-table td:first-child {
        padding-top: 18px !important;
        padding-bottom: 4px !important;
        font-size: 1.1rem;
        font-weight: 700;
        color: #0f172a;
        letter-spacing: -0.01em;
    }

    /* Label Styling - Modern Badge Style */
    body.kurum-mode .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #1e293b;
        font-size: 0.65rem;
        display: inline-block;
        margin-bottom: 7px;
        text-transform: uppercase;
        letter-spacing: 1.1px;
        background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
        padding: 4px 10px;
        border-radius: 6px;
        border-left: 3px solid #3b82f6;
    }

    /* Value Text Styling */
    body.kurum-mode .data-table td {
        font-size: 0.92rem;
        color: #334155;
        line-height: 1.5;
        font-weight: 500;
    }

    body.kurum-mode .data-table td:not([data-label])::before {
        content: none;
    }

    /* Status Badge Styling (for Son Giriş column) */
    body.kurum-mode .data-table td:nth-child(3) {
        font-weight: 500;
        color: #475569;
    }

    /* Activity Badge (Bugünkü İlerleme) */
    body.kurum-mode .data-table td:nth-child(4) {
        font-weight: 600;
        color: #059669;
    }

    /* Action Buttons Container */
    body.kurum-mode .data-table td:last-child {
        border-top: 1px solid #e2e8f0;
        padding: 14px 18px 18px 18px !important;
        margin-top: 6px;
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        background: rgba(248, 250, 252, 0.5);
    }

    /* Premium Button Styling */
    body.kurum-mode .data-table td:last-child button {
        margin: 0;
        font-size: 0.875rem;
        font-weight: 500;
        flex: 1 1 auto;
        min-width: 90px;
        padding: 10px 16px;
        border-radius: 10px;
        transition: all 0.2s ease;
        border: 1px solid transparent;
        text-transform: none;
        letter-spacing: 0.02em;
    }

    /* Veri Ekle Button (Green) - Larger Primary Action */
    body.kurum-mode .data-table td:last-child button:first-child {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
        flex: 2.5 1 auto;
        min-width: 130px;
        font-weight: 600;
    }

    body.kurum-mode .data-table td:last-child button:first-child:hover {
        background: linear-gradient(135deg, #059669, #047857);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
        transform: translateY(-1px);
    }

    /* Profil Button (Blue) */
    body.kurum-mode .data-table td:last-child button:nth-child(2) {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white !important;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }

    body.kurum-mode .data-table td:last-child button:nth-child(2):hover {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        transform: translateY(-1px);
        color: white !important;
    }

    /* Other Buttons (if any) */
    body.kurum-mode .data-table td:last-child button:not(:first-child):not(:nth-child(2)) {
        background: white;
        color: #475569;
        border: 1px solid #cbd5e1;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    body.kurum-mode .data-table td:last-child button:not(:first-child):not(:nth-child(2)):hover {
        background: #f8fafc;
        border-color: #94a3b8;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        transform: translateY(-1px);
    }

    /* Smooth transitions for all interactive elements */
    body.kurum-mode .data-table td:last-child button:active {
        transform: scale(0.98) !important;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* Dashboard Grid Mobile */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Widget kartlar mobilde tam genişlik */
    .widget-card,
    .stat-card,
    .info-card {
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Charts mobilde responsive */
    canvas {
        max-height: 250px !important;
        width: 100% !important;
    }

    /* Book cards mobilde */
    .book-card {
        margin-bottom: 1rem;
    }

    .book-card h4 {
        font-size: 1rem;
        word-break: break-word;
    }

    /* Form elements mobilde */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        /* iOS zoom önleme */
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .main-container {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Leaderboard mobilde */
    .leaderboard-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .leaderboard-name {
        font-size: 0.9rem;
    }

    .leaderboard-score {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 1.2rem !important;
    }

    .progress-info .current {
        font-size: 2rem;
    }

    .success-rate {
        font-size: 2.5rem;
    }
}

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background: #E0F2FE;
    color: #0369A1;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #E0E7FF;
    color: #3730A3;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

/* ===== ANALİZ SAYFASI STİLLERİ ===== */
.quick-period-buttons {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.quick-period-buttons .btn {
    flex: 1;
    min-width: 100px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Canvas container'lar için max-height */
canvas {
    max-height: 400px !important;
}

/* Responsive düzenlemeler */
@media (max-width: 768px) {
    .quick-period-buttons {
        flex-direction: column;
    }

    .quick-period-buttons .btn {
        width: 100%;
    }
}

/* ===== İSTATİSTİKLER GÜZELLEŞTİRME ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-item.success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.stat-item.primary {
    background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
}

.stat-item.warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.stat-item.danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.stat-item.info {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Analiz başlık güzelleştirme */
.analysis-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.analysis-header h4 {
    margin: 0;
    color: var(--dark);
}

/* Chart container */
.chart-container {
    position: relative;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 1rem 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* Ranking Styles */
.rank-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    align-items: center;
}

.rank-badge {
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    white-space: nowrap;
    font-weight: 500;
    width: fit-content;
}

.rank-badge.success {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.rank-badge.achievement {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===== TABLE RESPONSIVE ===== */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Ensure table doesn't squash too much */
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .charts-grid {
        grid-template-columns: 1fr !important;
    }

    .chart-container {
        height: 250px !important;
    }

    .card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}


/* ===== HOME PAGE REDESIGN ===== */

/* 1. Welcome Banner */
/* ===== MODERN HEADER REDESIGN ===== */

.dashboard-header-row {
    display: grid;
    grid-template-columns: 1fr;
    /* Tek sütun - Tam genişlik */
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

@media (max-width: 1024px) {
    .dashboard-header-row {
        grid-template-columns: 1fr;
    }
}

/* 1. Quick Action Tiles Module */
.quick-actions-module {
    background: white;
    border-radius: 24px;
    padding: 25px;
    /* Daha ferah */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    /* Daha yumuşak, geniş gölge */
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Hedef kartı ile eşitlenmesi için */
    justify-content: center;
}

.module-header h3 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    color: #334155;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.action-tiles-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 buton yan yana */
    gap: 16px;
    flex: 1;
}

@media (max-width: 768px) {
    .action-tiles-container {
        grid-template-columns: repeat(2, 1fr);
        /* Mobilde 2x2 */
    }
}

.action-tile {
    border: none;
    border-radius: 20px;
    /* Daha yuvarlak */
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy efekt */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    /* Hafif gölge */
}

.tile-icon {
    font-size: 2rem;
    /* Daha büyük ikon */
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.tile-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
}

/* Tile Variants - Daha modern renkler */
.tile-soru {
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    color: #3b82f6;
}

.tile-kitap {
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
    color: #10b981;
}

.tile-kelime {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    color: #f59e0b;
}

.tile-game {
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
    color: #8b5cf6;
}

.action-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.action-tile:active {
    transform: scale(0.95);
}

/* 2. Modern Welcome Banner (Premium Redesign) */
.modern-welcome-banner {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 20px;
    padding: 12px 24px;
    color: #1e293b;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: auto;
    box-shadow: 0 4px 20px rgba(148, 163, 184, 0.1);
}


.modern-welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
    filter: blur(40px);
    border-radius: 50%;
    z-index: 1;
}

.modern-welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.06) 0%, transparent 60%);
    filter: blur(30px);
    border-radius: 50%;
    z-index: 1;
}

.welcome-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 10px;
}

@media (max-width: 900px) {
    .welcome-content {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .welcome-last-login {
        display: none;
    }
}

.welcome-greeting h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    color: #1e293b;
    display: inline-block;
}

.welcome-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    border: 1px solid #e2e8f0;
}



/* Rapor Grid Yapıları */
/* Rapor Grid Yapıları */
.report-full-row-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 kart yan yana */
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .report-full-row-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Orta ekranlarda 3'lü */
    }
}

@media (max-width: 768px) {
    .report-full-row-grid {
        grid-template-columns: 1fr;
        /* Mobilde alt alta */
    }
}

.welcome-badge {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.login-label {
    font-weight: 500;
}

#last-login-date {
    font-weight: 700;
    color: #64748b;
}

.welcome-footer {
    margin-top: 0;
    justify-self: end;
}

.motivation-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 10px;
    max-width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    color: #475569;
}

.quote-icon {
    font-size: 0.9rem;
}

.motivation-quote {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
}

.floating-emoji {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* PROFİL DROPDOWN */
.profile-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 300px;
    z-index: 1000;
    animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-avatar {
    width: 64px;
    height: 64px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 12px auto;
}

#dropdown-name {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
}

#dropdown-email {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 4px;
}

.dropdown-info-box {
    background: #f8fafc;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #f1f5f9;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.info-row:not(:last-child) {
    margin-bottom: 8px;
}

.info-row .label {
    color: #64748b;
}

.info-row strong {
    color: #334155;
}

.dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dropdown-item {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-align: left;
}

.dropdown-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateX(4px);
}

.dropdown-item .item-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-item.logout-btn {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    margin-top: 6px;
}

.dropdown-item.logout-btn:hover {
    background: #ffe4e6;
    border-color: #fda4af;
}

.dropdown-item .badge {
    position: absolute;
    right: 12px;
    background: #ef4444;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.dropdown-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.dropdown-close:hover {
    background: #e2e8f0;
    color: #475569;
    transform: rotate(90deg);
}

/* 2. Dashboard Grid Layout */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Sol geniş, sağ dar */
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .dashboard-grid-layout {
        grid-template-columns: 1fr;
    }
}

.stats-grid-advanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.adv-stat-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s;
}

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

.adv-stat-card .icon-box {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

/* Kart Renk Temaları */
.card-soru .icon-box {
    background: #eff6ff;
    color: #3b82f6;
}

.card-net .icon-box {
    background: #f0fdf4;
    color: #10b981;
}

.card-kitap .icon-box {
    background: #fdf2f8;
    color: #ec4899;
}

.card-kelime .icon-box {
    background: #fff7ed;
    color: #f97316;
}

.adv-stat-card .stat-details span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.adv-stat-card .stat-details h3 {
    font-size: 1.8rem;
    color: #1e293b;
    margin: 5px 0 10px 0;
}

/* Progress Bar in Cards */
.progress-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.card-soru .progress-bar {
    background: #3b82f6;
}

.card-kitap .progress-bar {
    background: #ec4899;
}

.card-kelime .progress-bar {
    background: #f97316;
}

.stat-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Mini Chart Placeholder */
.sparkline {
    width: 100px;
    height: 30px;
    opacity: 0.7;
    color: #10b981;
}

/* 4. Right Column Widgets */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 0.9rem;
}

.goal-item .goal-name {
    font-weight: 600;
    color: #334155;
}

.goal-item .goal-status {
    font-weight: 700;
    color: var(--primary);
}

.activity-timeline {
    border-left: 2px solid #e2e8f0;
    padding-left: 20px;
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e2e8f0;
}

.timeline-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.timeline-content {
    font-size: 0.95rem;
    color: #475569;
}

/* ===== ADVANCED COMPARISON UI ===== */
.comparison-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
}

.bottom-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 1024px) {
    .bottom-grid-container {
        grid-template-columns: 1fr;
    }
}

.metric-comparison-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid #eef2f6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.metric-comparison-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.metric-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
}

.metric-icon {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.comparison-values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.comp-value-card {
    text-align: center;
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    position: relative;
    border: 1px solid transparent;
}

.comp-value-card.user {
    background: #f0fdfa;
    border-color: #ccfbf1;
}

.comp-value-card.class {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.comp-value-card.inst {
    background: #fdf2f8;
    border-color: #fce7f3;
}

.comp-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.comp-number {
    font-size: 1.75rem;
    font-weight: 800;
    display: block;
    line-height: 1.2;
}

.comp-number.user {
    color: #0d9488;
}

.comp-number.class {
    color: #7c3aed;
}

.comp-number.inst {
    color: #db2777;
}

.comp-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Benchmarking Bar */
.benchmarking-section {
    padding-top: 1.5rem;
    border-top: 1px dashed #e2e8f0;
}

.benchmark-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.benchmark-status {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
}

.status-above {
    background: #dcfce7;
    color: #166534;
}

.status-below {
    background: #fee2e2;
    color: #991b1b;
}

.benchmark-bar-outer {
    height: 30px;
    background: #f1f5f9;
    border-radius: 50px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 4px;
    overflow: hidden;
}

.benchmark-marker {
    height: 22px;
    border-radius: 50px;
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    padding: 0 12px;
    position: absolute;
    left: 4px;
}

.marker-user {
    background: #14b8a6;
    z-index: 3;
}

.marker-class {
    background: #9333ea;
    z-index: 2;
    opacity: 0.6;
}

.marker-inst {
    background: #ec4899;
    z-index: 1;
    opacity: 0.3;
}

/* Edit Mode Styles */
.btn-update {
    background: #3b82f6 !important;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2) !important;
}

.btn-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-edit:hover {
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .comparison-values-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== EĞLENCELİ DERSLER (OYUNLAR) ===== */
#eglenceli-dersler .game-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px 0;
}

#eglenceli-dersler .game-card {
    position: relative;
    height: 380px;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

#eglenceli-dersler .game-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    transition: transform 0.4s ease;
}

#eglenceli-dersler .game-card-content {
    position: relative;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
}

#eglenceli-dersler .game-card-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

#eglenceli-dersler .game-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin: 15px 0 8px 0;
    font-family: 'Poppins', sans-serif !important;
}

#eglenceli-dersler .game-card-desc {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

#eglenceli-dersler .game-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 15px;
}

#eglenceli-dersler .game-tag {
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #475569;
    font-weight: 600;
}

#eglenceli-dersler .game-card-arrow {
    align-self: flex-end;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* Colors & Hover */
#eglenceli-dersler .game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

#eglenceli-dersler .game-card:hover .game-card-bg {
    transform: scale(1.05);
}

#eglenceli-dersler .game-card:hover .game-card-icon {
    transform: rotate(10deg) scale(1.1);
}

#eglenceli-dersler .card-anaokulu .game-card-bg {
    background: linear-gradient(135deg, #FFE5E5 0%, #FFB3B3 100%);
}

#eglenceli-dersler .card-anaokulu:hover .game-card-title {
    color: var(--anaokulu-color);
}

#eglenceli-dersler .card-anaokulu:hover .game-tag {
    background: var(--anaokulu-color);
    color: white;
}

#eglenceli-dersler .card-ilkokul .game-card-bg {
    background: linear-gradient(135deg, #E5F9F7 0%, #A8E6E1 100%);
}

#eglenceli-dersler .card-ilkokul:hover .game-card-title {
    color: var(--ilkokul-color);
}

#eglenceli-dersler .card-ilkokul:hover .game-tag {
    background: var(--ilkokul-color);
    color: white;
}

#eglenceli-dersler .card-ortaokul .game-card-bg {
    background: linear-gradient(135deg, #F0FBF9 0%, #C9F2EC 100%);
}

#eglenceli-dersler .card-ortaokul:hover .game-card-title {
    color: var(--ortaokul-color);
}

#eglenceli-dersler .card-ortaokul:hover .game-tag {
    background: var(--ortaokul-color);
    color: white;
}

#eglenceli-dersler .card-lise .game-card-bg {
    background: linear-gradient(135deg, #FFF0F0 0%, #FFD1D1 100%);
}

#eglenceli-dersler .card-lise:hover .game-card-title {
    color: var(--lise-color);
}

#eglenceli-dersler .card-lise:hover .game-tag {
    background: var(--lise-color);
    color: white;
}

/* Info Section Dashboard Version */
#eglenceli-dersler .game-info-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
}

#eglenceli-dersler .game-info-section h2 {
    color: #1e293b;
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Poppins', sans-serif !important;
}

#eglenceli-dersler .game-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

#eglenceli-dersler .game-feature {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    transition: transform 0.3s ease;
}

#eglenceli-dersler .game-feature:hover {
    transform: translateY(-5px);
}

#eglenceli-dersler .game-feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

#eglenceli-dersler .game-feature h3 {
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

#eglenceli-dersler .game-feature p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== MOBİL OPTİMİZASYON - KAPSAMLI İYİLEŞTİRMELER ===== */

/* Global Overflow Fixes */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    box-sizing: border-box;
}

/* Contribution Graph - Mobil Düzeltme */
.contribution-grid {
    max-width: 100%;
    overflow-x: auto;
}

/* Widget Header - Mobil */
.widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

/* Analysis Sub Card - Mobil Overflow */
.analysis-sub-card {
    overflow-x: auto;
    max-width: 100%;
}

/* Stat Cards - Text Wrapping */
.stat-card h3,
.stat-info p,
.adv-stat-card .stat-details span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Temel Mobil Ayarları - Font Zoom'u Önleme */
@media (max-width: 768px) {

    /* Minimum font boyutları - Safari zoom'u önlemek için */
    body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* iOS zoom'u önler */
    }

    /* Touch-friendly butonlar - Minimum 44x44px */
    .btn,
    .btn-primary,
    .btn-outline,
    .btn-save,
    .btn-danger,
    .tab-btn,
    .lb-tab,
    .action-tile,
    .icon-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }

    /* Form İyileştirmeleri */
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Tablo Yatay Scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .data-table {
        min-width: 600px;
    }

    /* İstatistik Kartları - Tek Sütun */
    .stats-grid,
    .stats-grid-advanced,
    .info-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Kart Padding Azaltma */
    .card {
        padding: 16px;
        margin-bottom: 1rem;
    }

    /* Modern Header ve Quick Actions Mobil Düzeltme */
    .dashboard-header-row {
        margin-bottom: 1rem;
        gap: 1rem;
    }

    .quick-actions-module {
        padding: 15px;
        /* 25px -> 15px */
        border-radius: 18px;
    }

    .action-tile {
        padding: 15px 8px;
        /* 20px 10px -> 15px 8px */
        gap: 8px;
    }

    .tile-icon {
        font-size: 1.6rem;
    }

    .tile-text {
        font-size: 0.8rem;
    }

    .module-header h3 {
        margin-bottom: 12px;
        font-size: 1.1rem;
    }

    .progress-card,
    .success-card,
    .leaderboard-widget {
        padding: 18px;
    }

    /* Header Ayarları */
    .top-header {
        padding: 0 1rem;
        height: 60px;
    }

    .header-left .logo {
        font-size: 1.2rem;
    }

    /* Main Container */
    .main-container {
        padding: 1rem;
        padding-bottom: 100px;
        /* Mobile nav için */
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* Tüm ana sayfada taşma önleme */
    .tab-content,
    section,
    .card {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* Dashboard Header Row - Tek Sütun */
    .dashboard-header-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Quick Actions Module - Tam Genişlik */
    .quick-actions-module {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Modal Tam Ekran */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 1.5rem;
    }

    /* Dashboard Grid - Tek Sütun */
    /* Dashboard Grid - 2 Sütun (Kullanıcı İsteği: Daha Kompakt) */
    .dashboard-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Quick Actions - 2x2 Grid */
    .action-tiles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .action-tile {
        padding: 16px 8px;
    }

    .tile-icon {
        font-size: 1.75rem;
    }

    .tile-text {
        font-size: 0.85rem;
    }

    /* Chart Container */
    .chart-container {
        height: auto !important;
        min-height: 250px;
        width: 100%;
        overflow: hidden;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Leaderboard Widget */
    .leaderboard-tabs {
        flex-wrap: wrap;
    }

    .lb-tab {
        font-size: 0.7rem;
        padding: 6px 8px;
    }

    .leaderboard-item {
        padding: 10px 12px;
    }

    .leaderboard-name {
        font-size: 0.9rem;
    }

    .leaderboard-score {
        font-size: 0.9rem;
        padding: 5px 10px;
    }

    /* Progress Info - Küçült */
    .progress-info .current {
        font-size: 2.5rem;
    }

    .progress-info .target {
        font-size: 1.5rem;
    }

    /* Success Rate */
    .success-rate {
        font-size: 2.8rem;
    }

    /* Button Row */
    .quick-period-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .quick-period-buttons .btn {
        font-size: 0.85rem;
        padding: 10px 8px;
    }

    /* Books Grid */
    .books-grid {
        grid-template-columns: 1fr;
    }

    /* Comparison Grid */
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .comparison-values-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .comp-number {
        font-size: 1.5rem;
    }

    /* Bottom Grid */
    .bottom-grid-container {
        grid-template-columns: 1fr;
    }

    /* Activity Timeline */
    .timeline-item {
        margin-bottom: 15px;
    }

    /* Profile Dropdown - Tam Genişlik */
    .profile-dropdown {
        width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    /* Welcome Banner */
    .modern-welcome-banner {
        padding: 16px;
    }

    .welcome-greeting h1 {
        font-size: 1.2rem;
    }

    /* Game Cards */
    #eglenceli-dersler .game-cards-grid {
        grid-template-columns: 1fr;
    }

    #eglenceli-dersler .game-card {
        height: 320px;
    }

    #eglenceli-dersler .game-card-content {
        padding: 20px;
    }

    #eglenceli-dersler .game-card-title {
        font-size: 1.3rem;
    }

    /* Chart Containers - Overflow Fix */
    .charts-grid {
        grid-template-columns: 1fr !important;
    }

    /* Report Grid - Mobil */
    .report-full-row-grid {
        grid-template-columns: 1fr !important;
    }

    /* Filter ve Period Buttons */
    .filter-buttons {
        flex-direction: column;
    }

    .filter-buttons .btn {
        width: 100%;
    }

    /* Analysis Header Mobile */
    .analysis-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Widget Header Mobile Improvement */
    .leaderboard-widget .widget-header {
        flex-direction: column;
        align-items: stretch;
    }

    .leaderboard-tabs {
        justify-content: flex-start;
        width: 100%;
    }

    /* Contribution Graph Container - Alta Doğru Genişle */
    #contribution-graph {
        max-width: 100%;
        overflow-x: hidden !important;
        flex-wrap: wrap !important;
        justify-content: flex-start;
        max-height: none !important;
        height: auto !important;
    }

    .contribution-grid {
        overflow-x: hidden !important;
        flex-wrap: wrap !important;
    }

    /* Goal Items Overflow Fix */
    .goal-item .goal-name {
        max-width: 60%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ===== VİZÜEL ELEMENT MOBİL DÜZELTMELERİ (SCREENSHOT BAZLI) ===== */

    /* Stat Kartları - Tek Sütun (5. görsel sorun) */
    .kitap-stats-cards,
    .reading-stats-grid,
    .book-summary-cards {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Chart ve Card Başlıkları - Word Break */
    .analysis-sub-card h4,
    .card h3,
    .metric-comparison-card h4 {
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* Tablo Sütun Genişlikleri - Daha İyi Okunabilirlik */
    .data-table th,
    .data-table td {
        min-width: 70px;
        font-size: 0.8rem;
        padding: 10px 8px;
        word-break: break-word;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        min-width: 100px;
        /* İlk sütun daha geniş */
    }

    /* Form Submit Butonları - Tam Genişlik ve Daha Büyük */
    form button[type="submit"],
    .btn-save,
    #kitap-form button,
    #soru-form button {
        width: 100% !important;
        min-height: 48px;
        font-size: 1rem;
        margin: 1.5rem auto 0;
    }

    /* Kitap Kartları - Responsive */
    .book-card {
        padding: 1.25rem;
    }

    .book-card h4 {
        font-size: 1.1rem;
        word-break: break-word;
    }

    /* Modal İçindeki Formlar */
    .modal-content form {
        width: 100%;
    }

    .modal-content .form-group {
        margin-bottom: 1rem;
    }

    .modal-content button {
        width: 100%;
        min-height: 48px;
    }

    /* Ders İsimleri - Uzun İsimler için */
    select option,
    .form-group select {
        word-wrap: normal;
    }

    /* ===== ANA SAYFA MOBİL OPTİMİZASYONLARI ===== */

    /* Ana Sayfa Stat Kartları - 2x2 GRİD (Kompakt) */
    .stats-grid-advanced {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .adv-stat-card {
        padding: 12px;
        margin-bottom: 0;
        border-radius: 14px;
    }

    .adv-stat-card .icon-box {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .adv-stat-card .stat-details h3 {
        font-size: 1.4rem;
        margin: 2px 0 4px 0;
    }

    .adv-stat-card .stat-details span {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .stat-sub {
        font-size: 0.65rem;
    }

    .adv-stat-card .progress-container {
        height: 4px;
        margin: 4px 0;
    }

    /* Aktivite Geçmişi - Timeline İyileştirmesi */
    .activity-timeline {
        padding-left: 15px;
        margin-left: 8px;
    }

    .timeline-item {
        margin-bottom: 12px;
    }

    .timeline-item::before {
        left: -21px;
        width: 8px;
        height: 8px;
    }

    .timeline-time {
        font-size: 0.7rem;
    }

    .timeline-content {
        font-size: 0.85rem;
        line-height: 1.4;
        word-break: break-word;
    }

    /* Günlük Hedefler Listesi */
    .goals-list {
        gap: 10px;
    }

    .mobile-nav button {
        gap: 2px;
        font-size: 0.7rem;
        padding: 5px;
    }

    .mobile-nav i,
    .mobile-nav .nav-icon {
        font-size: 1.3rem;
    }

    .goal-item {
        padding: 10px;
        font-size: 0.85rem;
    }

    .goal-item .goal-name {
        font-size: 0.85rem;
        max-width: 55%;
    }

    .goal-item .goal-status {
        font-size: 0.85rem;
    }

    /* Haftalık Performans - Canvas Yüksekliği */
    #weeklyChart {
        max-height: 200px !important;
    }

    /* Contribution Graph Legend - Mobil */
    .contribution-grid+div {
        flex-wrap: wrap;
        font-size: 0.65rem !important;
        gap: 4px !important;
    }

    /* Modern Welcome Banner - Mobil Spacing */
    .modern-welcome-banner {
        margin-top: 1rem;
        padding: 12px 16px;
    }

    .motivation-bar {
        padding: 6px 12px;
    }

    .motivation-quote {
        font-size: 0.75rem;
    }

    /* Goals Summary Card */
    .goals-summary-card h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Recent Activity Card */
    .recent-activity-card h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .empty-state {
        font-size: 0.85rem;
        padding: 1.5rem 1rem;
        text-align: center;
        color: #94a3b8;
    }

    /* Left ve Right Column Spacing */
    .left-column,
    .right-column {
        padding: 0;
    }

    .left-column .card,
    .right-column .card {
        margin-bottom: 1rem;
    }

    /* ===== DETAYLI ANALİZ MOBİL OPTİMİZASYONLARI ===== */

    /* Hızlı İşlemler (Quick Actions) - 2x2 Grid Fix */
    .action-tiles-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .action-tile {
        padding: 12px 6px;
        min-height: 90px;
    }

    .tile-icon {
        font-size: 1.5rem;
    }

    .tile-text {
        font-size: 0.8rem;
        text-align: center;
    }

    /* Ders Bazında Detaylı Analiz Tablosu - Scroll Fix */
    .table-container {
        margin-bottom: 0;
        padding-bottom: 0;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
    }

    /* Tablo Başlıkları ve Hücreleri */
    .data-table th,
    .data-table td {
        font-size: 0.75rem;
        padding: 8px 6px;
        white-space: nowrap;
        /* Mobilde taşmayı önlemek için satır içi */
    }

    /* İlk Sütun (Ders Adı) Sabit Kalsın (Sticky) - Opsiyonel */
    .data-table th:first-child,
    .data-table td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        /* Arka plan karışmaması için */
        z-index: 10;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
        min-width: 90px;
        max-width: 90px;
        white-space: normal;
        /* Ders adı alt satıra geçsin */
    }

    .data-table th:first-child {
        background: #f8fafc;
    }

    /* Ünite Bazında Analiz - Mobil Layout */
    .card h3 {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #unite-analiz-ders-select {
        width: 100%;
        margin-top: 10px;
    }

    #unite-analiz-tbody .no-data {
        white-space: normal;
        text-align: center;
        padding: 20px;
    }

    /* Chart Containers Fix */
    .analysis-sub-card canvas {
        width: 100% !important;
        height: auto !important;
        min-height: 200px;
    }

    .analysis-sub-card {
        padding: 12px;
    }

    /* ===== EĞLENCELİ DERSLER MOBİL OPTİMİZASYONLARI ===== */
    .fun-lessons-header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
    }

    .fun-lessons-header .header-icon {
        font-size: 2.5rem;
    }

    .fun-lessons-header .header-text h2 {
        margin: 0;
        color: #1e293b;
        font-family: 'Poppins', sans-serif;
        font-size: 1.25rem;
    }

    .fun-lessons-header .header-text p {
        margin: 2px 0 0 0;
        color: #64748b;
        font-size: 0.85rem;
    }

    /* Oyun Kartları - Mobile Grid */
    .game-cards-grid {
        display: grid;
        grid-template-columns: 1fr;
        /* Mobilde tek sütun */
        gap: 15px;
    }

    .game-card-content {
        padding: 1.25rem;
    }

    /* Ana Sayfa Stat Kartları - Daha Kompakt (Kullanıcı İsteği) */
    .adv-stat-card {
        padding: 12px;
        /* Daha az padding */
    }

    .adv-stat-card .stat-details h3 {
        font-size: 1.4rem;
        /* Biraz daha küçük sayı */
        margin: 2px 0 4px 0;
    }

    .adv-stat-card .icon-box {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    /* ===== MOBİL TABLE TO CARD DÖNÜŞÜMÜ (KULLANICI İSTEĞİ) ===== */
    /* Masaüstünde tablo kalsın, mobilde kart olsun */

    .data-table thead {
        display: none;
        /* Mobilde başlıkları gizle */
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .data-table tr {
        margin-bottom: 20px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        /* Kart görünümü */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
        padding: 15px;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 10px 0;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.9rem;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        text-align: left;
        margin-right: 20px;
        flex: 1;
        /* Sol tarafı hizala */
    }

    /* Tablo Sticky fix iptal (kart oldu çünkü) */
    .data-table th:first-child,
    .data-table td:first-child {
        position: static;
        box-shadow: none;
        background: transparent;
        max-width: 100%;
    }

    /* Mobilde Settings İkonunu Gizle */
    .mobile-nav button:last-child {
        display: none !important;
    }

    /* Mobilde nav buton genişliklerini ayarla (5 buton kaldı) */
    .mobile-nav {
        justify-content: space-around;
    }
}

/* Ekstra Küçük Ekranlar (iPhone SE, küçük Android) */
@media (max-width: 375px) {

    /* Daha da küçük fontlar */
    .header-left .logo {
        font-size: 1rem;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    .progress-info .current {
        font-size: 2rem;
    }

    .success-rate {
        font-size: 2.2rem;
    }

    /* Quick Actions - Dikey */
    .action-tiles-container {
        grid-template-columns: 1fr;
    }

    .action-tile {
        padding: 14px;
    }

    /* Button Text */
    .btn,
    .btn-primary {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    /* Tablo font */
    .data-table th,
    .data-table td {
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    /* Leaderboard */
    .leaderboard-item {
        padding: 8px 10px;
    }

    .leaderboard-name {
        font-size: 0.85rem;
    }

    .leaderboard-score {
        font-size: 0.85rem;
    }
}

/* ===== AUTHENTICATION PAGE MOBILE OPTIMIZATION ===== */
@media (max-width: 640px) {
    .auth-container {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-box {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .auth-box .logo h1 {
        font-size: 1.5rem;
    }

    .tab-buttons {
        gap: 4px;
        padding: 4px;
    }

    .tab-buttons .tab-btn {
        padding: 8px 4px;
        font-size: 0.8rem;
    }

    .form-toggle {
        gap: 16px;
        margin-bottom: 24px;
    }

    .toggle-btn {
        font-size: 0.9rem;
        padding: 10px 2px;
    }

    .auth-form .form-group label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .auth-form .form-group input,
    .auth-form .form-group select,
    .auth-form .form-group textarea {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .auth-form .btn-primary {
        padding: 12px;
        font-size: 1rem;
    }
}

/* Landscape Tablet Ayarları */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Tablet için 2 sütun */
    .stats-grid-advanced {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-tiles-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .comparison-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch İyileştirmeleri - Tüm Cihazlar */
@media (hover: none) and (pointer: coarse) {

    /* Touch cihazlarda hover efektlerini azalt */
    .card:hover,
    .progress-card:hover,
    .success-card:hover,
    .leaderboard-widget:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    }

    .action-tile:hover {
        transform: translateY(-2px) scale(1.01);
    }

    /* Daha belirgin active states */
    .btn:active,
    .btn-primary:active,
    .action-tile:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    /* Tap highlight kaldır */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Safe Area Insets - iPhone X+ için */
@supports (padding: max(0px)) {
    .mobile-nav {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .main-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Print Optimizasyonu */
@media print {

    .top-header,
    .mobile-nav,
    .btn,
    .action-tile,
    .settings-icon-btn {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    body {
        background: white;
    }
}

/* ===== INSTITUTION PANEL RESPONSIVE STYLES ===== */
@media (max-width: 768px) {

    /* Institution panel tab navigation */
    #kurum-paneli .inst-tab {
        padding: 10px 12px;
        font-size: 0.85rem;
        flex: 1;
        text-align: center;
    }

    /* Institution stat cards grid */
    #kurum-paneli .stat-card {
        margin: 10px 0;
    }

    /* Institution student table responsiveness */
    #kurum-paneli .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #kurum-paneli table {
        min-width: 600px;
    }

    /* Institution tab wrapper */
    #kurum-paneli>.card {
        padding: 15px;
    }

    /* Make filter inputs stack on mobile */
    #inst-tab-students>div:first-child {
        flex-direction: column !important;
    }

    #inst-tab-students input,
    #inst-tab-students select {
        width: 100% !important;
        flex: none !important;
    }

    /* Report filters on mobile */
    #inst-tab-reports .form-group {
        margin-bottom: 10px;
    }
}

/* Google & Guest Auth Styles */
/* Google & Guest Auth Styles Optimized */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #f1f5f9;
}

.auth-divider span {
    padding: 0 12px;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    color: #334155;
    border: 1px solid #e2e8f0;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.google-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.guest-btn {
    background: #f0fdfa;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    width: 100%;
    margin-top: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none;
}

.guest-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

/* SSS (FAQ) Styles */
.faq-section {
    margin-top: 30px;
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.faq-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.05);
}

.faq-question {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    transition: all 0.2s;
}

.faq-item.active .faq-question {
    background: #f0fdfa;
    color: var(--primary-dark);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    transition: all 0.3s ease-out;
    background: white;
}

.faq-item.active .faq-answer {
    padding: 16px 20px;
    max-height: 500px;
}

.faq-toggle {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: #94a3b8;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
    color: var(--primary);
}

/* ============================================= */
/* ===== EN SON MOBİL OVERRIDE KURALLARI ===== */
/* ===== Bu kurallar tüm diğerlerini geçersiz kılar ===== */
/* ============================================= */
@media screen and (max-width: 768px) {

    /* TEMEL TAŞMA ÖNLEYİCİLER */
    html,
    body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .main-container,
    .tab-content,
    section {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
    }

    /* DASHBOARD HEADER ROW - DİKEY DİZİLİM */
    .dashboard-header-row {
        display: block !important;
        width: 100% !important;
    }

    /* QUICK ACTIONS MODULE */
    .quick-actions-module {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem !important;
        box-sizing: border-box !important;
    }

    /* DASHBOARD GRID LAYOUT - TEK SÜTUN */
    .dashboard-grid-layout {
        display: block !important;
        width: 100% !important;
    }

    .dashboard-grid-layout .left-column,
    .dashboard-grid-layout .right-column,
    .left-column,
    .right-column {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem !important;
    }

    /* STATS GRID - 2x2 */
    .stats-grid-advanced {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    /* İSTATİSTİK KARTLARI */
    .adv-stat-card {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* TÜM KARTLAR */
    .card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 1rem !important;
    }

    /* GRAFİKLER */
    .chart-container,
    canvas {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* TABLOLAR */
    .table-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .data-table {
        min-width: 500px;
    }

    /* ACTION TILES - 2x2 GRID */
    .action-tiles-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* ===== SORU TAKİBİ SEKMESİ MOBİL ===== */
    #soru-takip .card {
        padding: 15px !important;
        margin-bottom: 1rem !important;
    }

    #soru-takip .form-row,
    .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    #soru-takip .form-group,
    .form-group {
        width: 100% !important;
        margin-bottom: 10px !important;
    }

    #soru-takip input,
    #soru-takip select,
    #soru-takip textarea {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    /* Soru Kayıtlarım Tablosu */
    #soru-takip .table-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #soru-takip .data-table {
        min-width: 700px !important;
    }

    /* Soru Kayıtlarım Liste Görünümü (Mobil için alternatif) */
    .soru-kayit-item {
        display: block !important;
        padding: 12px !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    /* ===== KELİME EZBERİ SEKMESİ MOBİL ===== */
    #kelime-ezberi .card {
        padding: 15px !important;
        margin-bottom: 1rem !important;
    }

    #kelime-ezberi .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    #kelime-ezberi input,
    #kelime-ezberi select {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px !important;
    }

    /* Ünite Kartları (Kelime listesi) */
    .unite-card,
    .kelime-card,
    .vocabulary-card {
        width: 100% !important;
        margin-bottom: 10px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }

    /* Kelime Raporları Kartı */
    #kelime-ezberi .report-card,
    .kelime-report-card {
        width: 100% !important;
        padding: 15px !important;
    }

    /* Sınıf ve Kurum Kıyaslaması */
    .comparison-card,
    .kiyaslama-card {
        width: 100% !important;
        padding: 15px !important;
    }

    /* Kelime Tablosu */
    #kelime-ezberi .table-container {
        width: 100% !important;
        overflow-x: auto !important;
    }

    /* ===== KİTAP OKUMA SEKMESİ MOBİL ===== */
    #kitap-okuma .card {
        padding: 15px !important;
        margin-bottom: 1rem !important;
    }

    #kitap-okuma .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    #kitap-okuma input,
    #kitap-okuma select {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px !important;
    }

    /* Kitap Kartları */
    .book-card {
        width: 100% !important;
        margin-bottom: 1rem !important;
        box-sizing: border-box !important;
    }

    .books-grid {
        display: block !important;
    }

    /* ===== EĞLENCELİ DERSLER SEKMESİ MOBİL ===== */
    #eglenceli-dersler {
        padding: 10px !important;
    }

    #eglenceli-dersler .game-cards-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    #eglenceli-dersler .game-card {
        width: 100% !important;
        min-height: 180px !important;
        margin-bottom: 10px !important;
    }

    #eglenceli-dersler .game-card-content {
        padding: 15px !important;
    }

    #eglenceli-dersler .game-card-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }

    #eglenceli-dersler .game-card-title {
        font-size: 1.1rem !important;
    }

    #eglenceli-dersler .game-card-desc {
        font-size: 0.85rem !important;
    }

    #eglenceli-dersler .game-features {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    #eglenceli-dersler .game-feature {
        width: 100% !important;
        padding: 15px !important;
    }

    #eglenceli-dersler .game-info-section {
        padding: 15px !important;
    }

    /* ===== GENEL FORM VE BUTON İYİLEŞTİRMELERİ ===== */
    .btn {
        width: 100% !important;
        padding: 14px !important;
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }

    .btn-group,
    .button-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Filter Buttons */
    .filter-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .filter-buttons .btn {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 100px !important;
    }

    /* Rapor Kartları */
    .report-filters,
    .rapor-filters {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .report-filters input,
    .report-filters select {
        width: 100% !important;
    }

    /* Progress Bars */
    .progress-container,
    .progress-bar-container {
        width: 100% !important;
    }

    /* Hedef Kartları */
    .hedef-kart,
    .goal-card,
    .target-card {
        width: 100% !important;
        padding: 15px !important;
        margin-bottom: 10px !important;
    }

    /* Leaderboard Widget */
    .leaderboard-widget {
        width: 100% !important;
        padding: 15px !important;
    }

    .leaderboard-item {
        padding: 10px !important;
    }

    /* Aktivite Geçmişi */
    .activity-card,
    .aktivite-kart {
        width: 100% !important;
        padding: 15px !important;
    }

    /* Chart Containers */
    .chart-wrapper,
    .grafik-container {
        width: 100% !important;
        overflow-x: auto !important;
    }

    /* ===== PROFİL DROPDOWN MOBİL FİX ===== */
    .profile-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 10px !important;
        left: 10px !important;
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
    }

    .profile-dropdown.active {
        display: block !important;
    }

    /* Header Right - Profil butonu görünür olsun */
    .header-right {
        position: relative !important;
    }

    .profile-trigger {
        position: relative !important;
        z-index: 1001 !important;
    }

    /* ===== SORU KAYITLARIM TABLOSU MOBİL ===== */
    #soru-table-body,
    .soru-table,
    #soru-takip table {
        display: block !important;
        width: 100% !important;
    }

    #soru-takip .table-container,
    .soru-kayitlarim-container {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #soru-takip .data-table,
    .soru-kayitlarim-table {
        display: table !important;
        min-width: 800px !important;
        width: max-content !important;
    }

    #soru-takip .data-table thead,
    #soru-takip .data-table tbody,
    #soru-takip .data-table tr {
        display: table-row-group !important;
    }

    #soru-takip .data-table thead {
        display: table-header-group !important;
    }

    #soru-takip .data-table tr {
        display: table-row !important;
    }

    #soru-takip .data-table th,
    #soru-takip .data-table td {
        display: table-cell !important;
        padding: 10px 8px !important;
        white-space: nowrap !important;
        text-align: left !important;
        vertical-align: middle !important;
    }

    /* ===== DERS BAZINDA ANALİZ TABLOSU MOBİL ===== */
    .ders-analiz-container,
    .analiz-table-container,
    #unite-analiz-container {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .ders-analiz-table,
    .analiz-table,
    #unite-analiz-tbody {
        display: table !important;
        min-width: 900px !important;
        width: max-content !important;
    }

    .analiz-table thead,
    .analiz-table tbody,
    .analiz-table tr {
        display: table-row-group !important;
    }

    .analiz-table thead {
        display: table-header-group !important;
    }

    .analiz-table tr {
        display: table-row !important;
    }

    .analiz-table th,
    .analiz-table td {
        display: table-cell !important;
        padding: 10px 6px !important;
        white-space: nowrap !important;
        text-align: center !important;
        vertical-align: middle !important;
        font-size: 0.85rem !important;
    }

    /* ===== SON OKUMA KAYITLARI TABLOSU MOBİL ===== */
    .okuma-kayitlari-container,
    .reading-records-container,
    #kitap-okuma .table-container {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .okuma-kayitlari-table,
    .reading-records-table,
    #kitap-okuma .data-table {
        display: table !important;
        min-width: 600px !important;
        width: max-content !important;
    }

    #kitap-okuma .data-table thead,
    #kitap-okuma .data-table tbody,
    #kitap-okuma .data-table tr {
        display: table-row-group !important;
    }

    #kitap-okuma .data-table thead {
        display: table-header-group !important;
    }

    #kitap-okuma .data-table tr {
        display: table-row !important;
    }

    #kitap-okuma .data-table th,
    #kitap-okuma .data-table td {
        display: table-cell !important;
        padding: 10px 8px !important;
        white-space: nowrap !important;
    }

    /* ===== GENEL TABLO OVERRIDE ===== */
    /* Tüm tabloları mobilde düzelt */
    .data-table {
        display: table !important;
    }

    .data-table thead {
        display: table-header-group !important;
    }

    .data-table tbody {
        display: table-row-group !important;
    }

    .data-table tr {
        display: table-row !important;
    }

    .data-table th,
    .data-table td {
        display: table-cell !important;
    }

    /* Tablo container'lar için scroll hint */
    .table-container::after {
        content: '← Kaydırın →';
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: #94a3b8;
        padding: 8px 0;
        margin-top: 5px;
    }

    /* ===== KULLANICI İSTEĞİ ÜZERİNE EKLENEN UI DÜZELTMELERİ ===== */

    /* 1. GÖRSEL 2: Bilgi Kartları 2 Sütun Olsun */
    /* Ana Dashboard Kartları */
    .stats-grid-advanced {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .adv-stat-card {
        margin-bottom: 0 !important;
    }

    /* Rapor Kartları (Özet İstatistikler) - Inline style override */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stats-grid .stat-card {
        min-height: 100px;
    }

    .stats-grid .stat-card h3 {
        font-size: 1.4rem !important;
        /* Mobilde fontu biraz küçült */
    }

    /* 2. GÖRSEL 3: Tabloda "Soru" altında "Soru" yazmasın */
    /* remove card-view labels completely to trust horizontal scroll */
    td::before {
        display: none !important;
    }

    /* Hücre içindeki stilleri düzelt */
    .data-table td,
    .data-table th {
        display: table-cell !important;
        text-align: center !important;
        /* Mobilde ortala */
        padding: 8px 4px !important;
        font-size: 0.85rem !important;
    }

    /* İlk sütun (Tarih/Ders vb) sola yaslı kalsın */
    .data-table td:first-child,
    .data-table th:first-child {
        text-align: left !important;
    }

    /* 3. GÖRSEL 4: Bilgilendirme Kartı (FAQ) Cutoff ve Boşluklar */
    /* Sağ/Sol Boşlukları Azalt */
    .main-container {
        padding: 10px 8px !important;
        /* Çok azaltıldı */
    }

    /* FAQ Max Height Artır */
    .faq-item.active .faq-answer {
        max-height: 3000px !important;
        /* Yüksek değer */
        padding: 15px 10px !important;
    }

    /* FAQ Tablo Fontunu Küçült */
    .faq-answer table th,
    .faq-answer table td {
        padding: 6px 4px !important;
        font-size: 0.75rem !important;
    }

    /* 4. GÖRSEL 1: Aktivite Geçmişi Düzenleme */
    /* Genel kart paddingini azalt */
    .card {
        padding: 12px !important;
    }

    /* Grid ve Günler hizalaması */
    .activity-weekdays {
        height: auto !important;
        /* Sabit yüksekliği kaldır */
        justify-content: flex-start !important;
        padding-top: 20px !important;
        /* Grid ile hizala */
        gap: 18px;
        /* Gün aralıklarını ayarla */
    }

    .contribution-grid {
        padding-bottom: 10px;
    }

    /* Kareleri biraz küçült */
    .contribution-grid div {
        /* JS ile style veriliyor ama margin ile oynayabiliriz gerekirse */
    }
}

/* ===== SETTINGS MODAL UI FIX ===== */
#settings-modal .form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    width: 100%;
}

#settings-modal .form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

#settings-modal .form-group input,
#settings-modal .form-group select {
    width: 100% !important;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f8fafc;
}

#settings-modal .form-group input:focus,
#settings-modal .form-group select:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
    outline: none;
}

#settings-modal .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 0;
}

#settings-modal .form-row .form-group {
    flex: 1;
}

.subject-goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px !important;
}

.subject-goals-grid .form-group {
    margin-bottom: 0 !important;
}

/* Modal Content Padding Fix */
#settings-modal .modal-content {
    padding: 30px;
    border-radius: 24px;
    max-width: 600px;
}

#settings-modal h4 {
    font-size: 1.1rem;
    margin-top: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobil Uyum */
@media (max-width: 600px) {
    #settings-modal .form-row {
        flex-direction: column;
        gap: 0;
    }

    #settings-modal .modal-content {
        padding: 20px;
        width: 95%;
        margin: 10px;
    }
}

/* === MODERN KURUM PANELİ STİLLERİ === */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-details-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Modern İstatistik Kartı */
.stat-card-modern {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Yumuşak gölge */
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    /* Hover'da daha derin gölge */
}

/* İkon Alanları */
.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    /* Hafif yuvarlatılmış kare */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

/* Renk Temaları (Gradient Opsiyonlu) */
.bg-blue-light {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
}

.bg-yellow-light {
    background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%);
    color: #eab308;
}

.bg-green-light {
    background: linear-gradient(135deg, #dcfce7 0%, #86efac 100%);
    color: #16a34a;
}

.bg-purple-light {
    background: linear-gradient(135deg, #f3e8ff 0%, #d8b4fe 100%);
    color: #9333ea;
}

/* Tipografi */
.stat-content h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.stat-content p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Detay Kartları */
.detail-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    height: 100%;
    /* Eşit yükseklik için */
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.1rem;
    color: #334155;
    font-weight: 700;
    margin: 0;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.summary-value {
    font-weight: 800;
    font-size: 1.1rem;
}

.text-blue {
    color: #0ea5e9;
}

.text-green {
    color: #10b981;
}

.text-purple {
    color: #8b5cf6;
}

/* Badge */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

/* Arama Kutusu */
.search-box {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 38px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Animasyon */
.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === ACİL LAYOUT DÜZELTMESİ === */

/* Masaüstü ve Geniş Ekranlar için Zorlayıcı Grid */
@media (min-width: 992px) {
    .dashboard-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        /* 4 Sütun Zorla */
        gap: 24px !important;
        width: 100% !important;
        margin-bottom: 30px !important;
    }

    /* Kartların aşırı genişlemesini önle */
    .stat-card-modern {
        width: auto !important;
        min-height: 140px;
        display: flex !important;
        flex-direction: row !important;
        /* Yan yana ikon ve yazı */
        align-items: center !important;
    }

    /* Detay Grid */
    .dashboard-details-grid {
        display: grid !important;
        grid-template-columns: 1fr 2fr !important;
        /* Özet dar, Tablo geniş */
        gap: 24px !important;
    }
}

/* Kart İçi Düzenlemeler */
.stat-card-modern {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    transition: transform 0.2s;
}

.stat-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.icon-wrapper {
    min-width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.8rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-content h3 {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.stat-content p {
    color: #64748b !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-top: 5px !important;
}

/* ===== CUSTOM CHART SCROLL & MOBILE GRAPH FIXES ===== */
@media screen and (max-width: 768px) {

    /* 1. GÖRSEL 1: Aktivite Grafiği (Günleri Gizle) */
    .activity-weekdays {
        display: none !important;
    }

    /* Grid'i sola yasla ve margin ayarla */
    .contribution-grid {
        justify-content: flex-start !important;
        margin-left: 0 !important;
    }

    /* 2. GÖRSEL 2: Grafik Sağa Doğru Kaydırmalı Olsun & GÖRSEL 3 İyileştirme */
    .chart-scroll-wrapper {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 10px !important;
    }

    /* Bar ve Çizgi Grafikler için Genişlik ve düzen */
    .chart-scroll-wrapper canvas {
        min-width: 600px !important;
        /* Scroll yapılabilmesi için genişlik */
        height: auto !important;
    }

    /* Pasta Grafik için Özel (Scroll değil, sığdırma) */
    .chart-scroll-wrapper.pie-wrapper {
        display: flex !important;
        justify-content: center !important;
        overflow-x: hidden !important;
        /* Pasta grafikte scroll istenmiyor */
    }

    .chart-scroll-wrapper.pie-wrapper canvas {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 280px !important;
        /* Mobilde taşmasın */
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
    }

    /* Aktivite Grafiği: 16 sütun sığacak şekilde ayarla (Tahmini) */
    .contribution-grid {
        gap: 1px !important;
    }

    /* 5. GÖRSEL DÜZELTMELERİ (Tablo Boşlukları) */
    /* Tabloların gereksiz genişlemesini önle */
    #soru-takip .data-table,
    .soru-kayitlarim-table,
    .okuma-kayitlari-table,
    .reading-records-table,
    #kitap-okuma .data-table,
    .data-table {
        min-width: auto !important;
        /* Zorunlu genişliği kaldır */
        width: max-content !important;
        /* İçerik kadar genişle */
        table-layout: auto !important;
    }

    /* Sütunlar arası boşluğu optimize et */
    .data-table th,
    .data-table td {
        white-space: nowrap !important;
        padding: 8px 10px !important;
        /* Paddingi makul tut */
        width: auto !important;
        /* Hücre genişliğini serbest bırak */
    }

    /* 6. GÖRSEL 1 DÜZELTMESİ: Sil/Güncelle Yan Yana */
    .book-actions {
        flex-direction: row !important;
        gap: 10px !important;
    }

    .book-actions .btn {
        flex: 1 !important;
        /* Eşit genişlik */
        margin-bottom: 0 !important;
        padding: 10px 4px !important;
        /* İç boşluğu azalt */
        font-size: 0.85rem !important;
        /* Yazıyı sığdır */
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* 7. GÖRSEL 4 DÜZELTMESİ: Sağ/Sol Boşlukları Daha da Azalt */
    .main-container {
        padding: 5px !important;
        /* Kenar boşluğu minimum */
    }

    .card {
        padding: 10px !important;
        /* Kart içi boşluğu azalt */
        margin-bottom: 10px !important;
        width: 100% !important;
    }

    /* 8. GÖRSEL 3 DÜZELTMESİ: Grafik Altı Boşluk */
    .chart-scroll-wrapper {
        margin-bottom: 0 !important;
        /* Grafik altı boşluğu sıfırla */
        padding-bottom: 5px !important;
        /* Scroll bar için minimal yer */
    }

    .analysis-sub-card h4 {
        margin-bottom: 5px !important;
        /* Başlık altı boşluğu azalt */
    }
}

/* ===== DESKTOP FORM LAYOUT FIX (MASAÜSTÜ İÇİN ÖZEL) ===== */
@media (min-width: 992px) {

    /* 3 Sütunlu Satır (Tarih, Ders, Ünite) */
    .form-row-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* 4 Sütunlu Satır (Soru, Doğru, Yanlış, Boş) */
    .form-row-4 {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* 2 Sütunlu Özel Satır (Net, Kaydet) */
    .form-row-2-custom {
        grid-template-columns: 1fr 1fr !important;
        align-items: end !important;
        /* Butonu tabana yasla */
    }

    .form-row-2-custom button {
        height: 52px !important;
        /* Input yüksekliği ile eşitle */
        margin-bottom: 2px !important;
    }

    /* 5 Sütunlu Satır (Soru, Doğru, Yanlış, Boş, Net) */
    .form-row-5 {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* ===== MOBİL İÇİN ÖZEL DÜZENLEMELER (GÖRSEL 1, 2, 3, 4) ===== */
@media screen and (max-width: 768px) {
    /* 1. GÖRSEL 1: Mobilde Form Elemanlarını 2'li Grupla */

    /* Satırları sıfırla ve yeniden düzenle */
    .form-row-3,
    .form-row-4,
    .form-row-5,
    .form-row-2-custom {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        /* Her şeyi 2 sütun yap */
        gap: 10px !important;
    }

    /* Tarih, Ders, Ünite (3 eleman) - Ünite alta düşecek veya sığacak */
    /* Ders ve Tarih yan yana olsun, Ünite tam genişlik olsun isterseniz: */
    /* Ama kullanıcı sadece yan yana istemiş. 3 eleman 2 sütunda: 1-1, 1 (boş) olur. */

    /* SENARYO: */
    /* Row 2 (5 eleman): Soru | Doğru, Yanlış | Boş, Net | (Boş) */
    /* Ancak kullanıcı isteği: "SORU İLE DOĞRU, YANLIŞ İLE BOŞ VE NET İLE KAYDET YAN YANA GELSİN" */

    /* Bunu sağlamak için HTML yapısı masaüstü için farklıydı. Mobilde CSS Grid ile oynayarak bunları eşleştirmek zor olabilir çünkü HTML sırası Soru, Doğru, Yanlış, Boş, Net. */
    /* Sıra: Soru(1), Doğru(2), Yanlış(3), Boş(4), Net(5). */
    /* Grid 2 col: */
    /* 1-2 (Soru-Doğru) -> OK */
    /* 3-4 (Yanlış-Boş) -> OK */
    /* 5 (Net) - ? */

    /* Kaydet butonu ayrı bir div içinde (Row 3). Net ise Row 2 içinde. */
    /* Net'i ve Kaydet'i yan yana getirmek için mobilde "display: contents" benzeri bir hile veya absolute positioning gerekebilir ama HTML yapıları farklı containerlarda. */
    /* Ancak Kaydet butonu Row 3 container'ında. Net ise Row 2'de. */
    /* ÇÖZÜM: Mobilde bu yapıyı görsel olarak birleştirmek zor. */
    /* ALTERNATİF: Kullanıcı masaüstü kodunu değiştirme dedi. */
    /* Sadece CSS ile: Net'i Row 2'nin sonuna, Kaydet'i Row 3'ün başına alıp marginlerle oynayabiliriz ama riskli. */

    /* HTML değişikliği yapmadan: */
    /* Row 2: display: grid, 2 col -> Soru, Doğru, Yanlış, Boş, Net (tek kalır). */
    /* Row 3: Kaydet. */

    /* Kullanıcı tam olarak "NET İLE KAYDET YAN YANA GELSİN" dedi. */

    /* 2. GÖRSEL 2: Grafik Altı Boşluk Azalt ve Grafik Küçült */
    canvas {
        max-height: 220px !important;
        /* Biraz küçült */
    }

    .card h3,
    .analysis-sub-card h4 {
        margin-bottom: 5px !important;
        font-size: 1rem !important;
    }

    /* 3. GÖRSEL 3: Başarı Oranı ve Soru Sayısı Yazılarını Kaldır */
    /* Başarı kartındaki "Doğru: X / Toplam: Y" yazısı */
    .success-detail {
        display: none !important;
    }

    /* Hedef kartındaki soru sayıları ve spanlar */
    .progress-info .unit,
    .progress-stats .remaining {
        display: none !important;
    }

    /* Sadece yüzde kalsın isteniyorsa: */
    /* Kullanıcı "Başarı oranı ve soru sayısı yazılarını kaldır" dedi. */
    /* Muhtemelen kartın içindeki küçük detay yazıları. */

    /* 4. GÖRSEL 4: Verilerin Sağ/Sol Boşluklarını Azalt */
    .main-container {
        padding: 4px !important;
    }

    .card {
        padding: 10px 8px !important;
        margin-bottom: 8px !important;
    }

    /* Tablo içinde padding */
    .data-table th,
    .data-table td {
        padding: 6px 4px !important;
    }

    /* Grafik Wrapper Kaldırıldığı için Canvas Width ayarı */
    /* Canvaslar mobilde bazen taşabilir, max-width verelim */
    canvas {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Visibility Utilities */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media screen and (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}

.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffff;
    color: #1e293b;
    padding: 16px 24px;
    border-radius: 12px;
    z-index: 10000;
    /* En üstte */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 6px solid #3b82f6;
    animation: slideInRightToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 280px;
    max-width: 90vw;
}

.toast-notification.success {
    border-left-color: #10b981;
}

.toast-notification.error {
    border-left-color: #ef4444;
}

.toast-notification.info {
    border-left-color: #3b82f6;
}

@keyframes slideInRightToast {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRightToast {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* ===== SAVE ROW LAYOUT (Net & Kaydet Mobile vs Desktop) ===== */
.save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.save-row button {
    width: 200px;
}

@media screen and (max-width: 768px) {
    .save-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        align-items: end !important;
        margin-top: 5px !important;
    }

    .save-row button {
        width: 100% !important;
        height: 48px !important;
        /* Input yüksekliği ile yaklaşık eşitle */
        margin-bottom: 0 !important;
    }

    .save-row .form-group {
        margin-bottom: 0 !important;
    }

    /* 9. GRAFİK ALTI BOŞLUK (SON DÜZELTME) */
    .analysis-sub-card canvas {
        margin-bottom: 0 !important;
        display: block !important;
    }

    .analysis-sub-card div[id$="-summary"] {
        margin-top: 0 !important;
        padding-top: 5px !important;
    }

    /* Pie Chart özel */
    #soru-derslerPieChart {
        margin-bottom: -10px !important;
        /* Pasta grafik altı ekstra boşluğu al */
    }
}