/* ======================================================================
 * LAYOUT.CSS (DARK MODE FIXED & FULL WIDTH)
 * ====================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Righteous&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* --- BOYUTLAR --- */
    --header-height: 65px;
    --sidebar-width-expanded: 240px;
    --sidebar-width-collapsed: 72px;
    --mobile-nav-height: 75px;
    
    /* --- RENKLER (LIGHT MODE - VARSAYILAN) --- */
    --bg-body: #f1f5f9;          /* Sayfa Arka Planı */
    --bg-card: #ffffff;          /* Kart ve Sidebar Arka Planı */
    
    /* Header Renkleri (DİNAMİK) */
    --header-bg: rgba(255, 255, 255, 0.95); 
    --header-border: rgba(0, 0, 0, 0.05);
    
    /* Metin Renkleri */
    --text-main: #1e293b;        /* Ana Metin (Koyu Gri) */
    --text-muted1: #64748b;       /* Pasif Metin */
    
    --border-color: #e2e8f0;     /* Kenarlıklar */
    --bg-hover-dark: #f8fafc;    /* Hover Rengi */
    
    /* Marka Renkleri */
    --accent-primary: #6366f1;   /* İndigo */
    --brand-blue: #3b82f6;       /* Mavi */
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    /* İstatistik Renkleri */
    --stat-win: #10b981;
    --stat-draw: #f59e0b;
    --stat-loss: #ef4444;
}

/* --- DARK MODE RENK PALETİ --- */
body[data-theme="dark"] {
    --bg-body: #0f172a;           /* Çok Koyu Lacivert */
    --bg-card: #1e293b;           /* Koyu Slate */
    
    /* Header Dark Mode */
    --header-bg: rgba(30, 41, 59, 0.95); 
    --header-border: rgba(255, 255, 255, 0.05);
    
    --text-main: #f1f5f9;         /* Beyazımsı */
    --text-muted1: #94a3b8;        /* Gri */
    
    --border-color: #334155;      /* Koyu Çizgiler */
    --bg-hover-dark: rgba(255, 255, 255, 0.05);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ======================================================
 * 1. HEADER (ÜST BAR)
 * ====================================================== */
.site-header {
    position: fixed; top: 0; right: 0; height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 1020; padding: 0 20px;
    transition: all 0.3s ease-in-out;
    color: var(--text-main);
}
.header-page-title { color: var(--text-main); font-weight: 700; }

@media (min-width: 992px) {
    .site-header { left: var(--sidebar-width-expanded); width: calc(100% - var(--sidebar-width-expanded)); }
    body.sidebar-collapsed .site-header { left: var(--sidebar-width-collapsed); width: calc(100% - var(--sidebar-width-collapsed)); }
}

.header-logo {
    font-family: 'Righteous', cursive; font-size: 1.5rem;
    background: linear-gradient(135deg, var(--text-main), var(--accent-primary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none;
}
.btn-mobile-toggle { background: none; border: none; font-size: 1.4rem; color: var(--text-main); margin-right: 15px; cursor: pointer; }

/* İKONLAR & PROFİL */
.header-right .header-item { display: flex; align-items: center; justify-content: center; margin-left: 8px; }
.header-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-muted1); border-radius: 10px; background: transparent; border: none; position: relative; transition: all 0.2s; }
.header-icon-btn:hover { background: var(--bg-hover-dark); color: var(--accent-primary); transform: translateY(-2px); }
.header-profile-img { display: block; width: 38px; height: 38px; border-radius: 10px; overflow: hidden; border: 2px solid var(--border-color); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.header-profile-img img { width: 100%; height: 100%; object-fit: cover; }

/* BADGE */
.badge-pulse { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; animation: pulse-soft 2s infinite; }
@keyframes pulse-soft { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.badge-count { position: absolute; top: -2px; right: -2px; background: #ef4444; color: white; font-size: 0.65rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 6px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-card); }

/* DROPDOWN */
.dropdown-menu { background-color: var(--bg-card); border: 1px solid var(--border-color) !important; border-radius: 16px !important; margin-top: 10px !important; box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important; animation: slideUpFade 0.2s ease-out; }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item { color: var(--text-main) !important; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.dropdown-item:hover { background-color: var(--bg-hover-dark) !important; transform: translateX(5px); }
.dropdown-item:hover i { color: var(--accent-primary) !important; }
.dropdown-header { color: var(--text-muted1) !important; }
.dropdown-item.text-danger:hover { background-color: rgba(239, 68, 68, 0.1) !important; color: #ef4444 !important; }
.dropdown-item.text-danger:hover i { color: #ef4444 !important; }

/* THEME TOGGLE */
.theme-toggle { width: 40px; height: 40px; border: 1px solid var(--border-color); color: var(--text-muted1); border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; transition: 0.2s; }
.theme-toggle:hover { background: var(--bg-hover-dark); color: var(--text-main); }
.theme-toggle .fa-sun { display: none; } body[data-theme="light"] .theme-toggle .fa-sun { display: block; color: #f59e0b; } body[data-theme="light"] .theme-toggle .fa-moon { display: none; }

/* ======================================================
 * 2. SIDEBAR (MASAÜSTÜ)
 * ====================================================== */
.sidebar-desktop-fixed { width: var(--sidebar-width-expanded); height: 100vh; position: fixed; top: 0; left: 0; background-color: var(--bg-card); border-right: 1px solid var(--border-color); z-index: 1030; display: flex; flex-direction: column; padding: 15px 10px; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; scrollbar-width: none; }
.sidebar-desktop-fixed::-webkit-scrollbar { display: none; }
.sidebar-logo-area { height: 50px; display: flex; align-items: center; padding-left: 12px; margin-bottom: 10px; }
.logo-full { font-family: 'Righteous', cursive; font-size: 1.6rem; background: linear-gradient(135deg, var(--text-main), var(--accent-primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; white-space: nowrap; }
.logo-mini { font-family: 'Righteous', cursive; font-size: 1.8rem; color: var(--accent-primary); position: absolute; left: 50%; transform: translateX(-50%); opacity: 0; pointer-events: none; }
.sidebar-nav-main { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; }
.nav-item { display: flex; align-items: center; padding: 0 14px; height: 42px; color: var(--text-muted1); text-decoration: none; border-radius: 10px; font-weight: 500; font-size: 0.92rem; transition: all 0.2s ease; white-space: nowrap; overflow: hidden; }
.nav-item i { font-size: 1.1rem; width: 24px; text-align: center; margin-right: 12px; flex-shrink: 0; }
.nav-item:hover { background-color: var(--bg-hover-dark); color: var(--text-main); }
.nav-item.active { background-color: rgba(99, 102, 241, 0.1); color: var(--accent-primary); font-weight: 600; }
.nav-label { font-size: 0.65rem !important; margin: 12px 0 4px 14px !important; text-transform: uppercase; color: var(--text-muted1); letter-spacing: 0.5px; opacity: 0.8; }
.nav-item-create-desktop { margin-top: 15px !important; background-color: var(--brand-blue) !important; color: white !important; justify-content: center; height: 44px; }
.nav-item-create-desktop:hover { background-color: #2563eb !important; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); }
.sidebar-toggle-btn { width: 100%; padding: 10px; text-align: center; cursor: pointer; color: var(--text-muted1); border-top: 1px solid var(--border-color); margin-top: 10px; }

/* SIDEBAR COLLAPSED (DARALTILMIŞ) */
body.sidebar-collapsed .sidebar-desktop-fixed { width: var(--sidebar-width-collapsed); }
body.sidebar-collapsed .sidebar-logo-area { justify-content: center; padding: 0; }
body.sidebar-collapsed .logo-full { opacity: 0; display: none; }
body.sidebar-collapsed .logo-mini { opacity: 1; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 0; width: 46px; margin: 0 auto; }
body.sidebar-collapsed .nav-item span, body.sidebar-collapsed .nav-item .badge, body.sidebar-collapsed .nav-label { display: none !important; }
body.sidebar-collapsed .nav-item i { margin-right: 0; font-size: 1.25rem; }

/* ======================================================
 * 3. MAIN CONTENT (İÇERİK ALANI)
 * ====================================================== */
.main-content-wrapper { margin-left: var(--sidebar-width-expanded); width: calc(100% - var(--sidebar-width-expanded)); margin-top: var(--header-height); min-height: calc(100vh - var(--header-height)); padding: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
body.sidebar-collapsed .main-content-wrapper { margin-left: var(--sidebar-width-collapsed); width: calc(100% - var(--sidebar-width-collapsed)); }

/* ======================================================
 * 4. MOBİL VE TABLET AYARLARI (YENİLENDİ)
 * ====================================================== */
@media (max-width: 991.98px) {
    .sidebar-desktop-fixed, #desktopSidebar { display: none !important; }
    .site-header { left: 0 !important; width: 100% !important; }
    .main-content-wrapper { margin-left: 0 !important; width: 100% !important; padding-bottom: 90px; }

    /* Yan Menü (Offcanvas) */
    .main-sidebar { position: fixed; top: 0; left: 0; width: 280px; height: 100vh; background: var(--bg-card); z-index: 1050; border-right: 1px solid var(--border-color); transform: translateX(-100%); transition: transform 0.3s ease-in-out; display: flex; flex-direction: column; }
    .main-sidebar.show { transform: translateX(0); }
    .sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1045; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(2px); }
    .sidebar-overlay.show { opacity: 1; visibility: visible; }
    .sidebar-header .logo-brand { color: var(--text-main) !important; font-weight: 900; font-size: 1.4rem; }

    /* --- MODERN MOBİL MENÜ LİNKLERİ --- */
    .main-sidebar .sidebar-content { padding: 20px 15px; }
    .main-sidebar .nav-link { display: flex; align-items: center; gap: 15px; padding: 14px 16px; margin-bottom: 8px; color: var(--text-muted1); font-weight: 600; font-size: 0.95rem; border-radius: 12px; transition: all 0.2s ease; text-decoration: none; }
    .main-sidebar .nav-link i { width: 24px; text-align: center; font-size: 1.2rem; color: var(--text-muted1); opacity: 0.8; }
    
    .main-sidebar .nav-link:hover, .main-sidebar .nav-link:active { background-color: var(--bg-hover-dark); color: var(--text-main); transform: translateX(5px); }
    .main-sidebar .nav-link:hover i { color: var(--accent-primary); opacity: 1; }
    
    .main-sidebar .nav-link.active { background-color: rgba(99, 102, 241, 0.1); color: var(--accent-primary); }
    .main-sidebar .nav-link.active i { color: var(--accent-primary); opacity: 1; transform: scale(1.1); }
    
    .main-sidebar .nav-label { font-size: 0.7rem; font-weight: 800; color: var(--text-muted1); opacity: 0.6; margin: 15px 0 5px 10px; text-transform: uppercase; letter-spacing: 0.5px; }
    .main-sidebar .sidebar-divider { height: 1px; background-color: var(--border-color); margin: 10px 0; opacity: 0.5; }
    .main-sidebar .nav-link.text-danger { color: #ef4444 !important; }
    .main-sidebar .nav-link.text-danger i { color: #ef4444 !important; }

    /* Alt Menü (Bottom Nav) */
    .mobile-bottom-nav { display: flex; align-items: flex-end; justify-content: space-around; position: fixed; bottom: 0; left: 0; right: 0; height: var(--mobile-nav-height); background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--header-border); border-radius: 20px 20px 0 0; box-shadow: 0 -5px 20px rgba(0,0,0,0.05); z-index: 1050; padding-bottom: 10px; }
    .mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-decoration: none; color: var(--text-muted1); height: 50px; position: relative; }
    .mobile-nav-item i { font-size: 1.3rem; margin-bottom: 2px; transition: 0.3s; }
    .mobile-nav-item span { font-size: 0.65rem; font-weight: 500; transition: 0.3s; }
    .mobile-nav-item.active { color: var(--accent-primary); }
    .mobile-nav-item.active i { transform: translateY(-4px); filter: drop-shadow(0 4px 8px var(--accent-glow)); }
    .mobile-nav-item.active span { font-weight: 700; }
    
    .mobile-fab-container { position: relative; top: -25px; width: 60px; height: 60px; }
    .mobile-create-btn { width: 56px; height: 56px; border-radius: 50%; border: none; background: linear-gradient(135deg, #4f46e5, #ec4899); color: white; font-size: 1.6rem; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4), 0 0 0 6px var(--bg-body); transition: transform 0.2s; }
    .mobile-create-btn:active { transform: scale(0.9); }
    body[data-theme="dark"] .mobile-create-btn { box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4), 0 0 0 6px var(--bg-body); }
}

/* ======================================================
 * 5. BİLDİRİM SAYFASI STİLLERİ
 * ====================================================== */
.notification-item { border: none; border-bottom: 1px solid var(--border-color); background-color: var(--bg-card); transition: background-color 0.2s; }
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background-color: var(--bg-hover-dark); }
.notification-item.unread { background-color: rgba(var(--accent-primary-rgb), 0.03); }
body[data-theme="dark"] .notification-item.unread { background-color: rgba(255, 255, 255, 0.03); }
.notification-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.bg-primary-subtle { background-color: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.bg-danger-subtle { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; }
.bg-success-subtle { background-color: rgba(25, 135, 84, 0.1); color: #198754; }
.bg-warning-subtle { background-color: rgba(255, 193, 7, 0.1); color: #ffc107; }
.bg-info-subtle { background-color: rgba(13, 202, 240, 0.1); color: #0dcaf0; }
.bg-secondary-subtle { background-color: rgba(108, 117, 125, 0.1); color: #6c757d; }
.notification-text strong { font-weight: 700; color: var(--text-main); }

/* ======================================================
 * 6. SCROLL VE TAŞMA ENGELLEME
 * ====================================================== */
html, body { max-width: 100%; overflow-x: hidden !important; width: 100%; position: relative; }
.row { margin-right: 0 !important; margin-left: 0 !important; }

/* ======================================================
 * SIDEBAR (SAĞ SÜTUN) ÖZEL STİLLERİ
 * ====================================================== */

/* Vitrin (Story) Alanı - Yatay Kaydırma */
.showcase-scroll-wrapper {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 5px 5px 15px 5px; /* Scrollbar payı */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
/* Scrollbar'ı ince yap */
.showcase-scroll-wrapper::-webkit-scrollbar { height: 4px; }
.showcase-scroll-wrapper::-webkit-scrollbar-track { background: transparent; }
.showcase-scroll-wrapper::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

.showcase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 60px;
    flex-shrink: 0;
}
.showcase-avatar-box {
    position: relative;
    width: 56px; height: 56px;
    margin-bottom: 5px;
    padding: 2px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary); /* Story halkası gibi */
    background: var(--bg-card);
}
.showcase-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-card); /* İç boşluk */
}
.showcase-badge-icon {
    position: absolute;
    bottom: -2px; right: -2px;
    font-size: 0.8rem;
    background: var(--bg-card);
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.showcase-name {
    font-size: 0.7rem;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Liderlik Tablosu Sekmeleri */
#sidebarStatsTab .nav-link {
    color: var(--text-muted1);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
#sidebarStatsTab .nav-link:hover { color: var(--text-main); background: var(--bg-hover-dark); }
#sidebarStatsTab .nav-link.active {
    color: var(--accent-primary);
    background: transparent;
    border-bottom-color: var(--accent-primary);
}

.text-brown { color: #cd7f32; } /* Bronz rengi için */