/* ==========================================
   TİCARETİS MD3 TASARIMI - MASTER CSS (GÜNCELLENDİ)
========================================== */

/* 1. RENK PALETİ VE DEĞİŞKENLER */
:root {
    --bs-body-font-family: 'Outfit', sans-serif;
    --md-primary: #0b57d0;
    --md-on-primary: #ffffff;
    --md-primary-container: #d3e3fd;
    --md-on-primary-container: #041e49;
    --md-body-bg: #f0f4f9;
    --md-navbar-bg: #ffffff;
    --md-surface-container: #ffffff;
    --md-surface-container-high: #e7eef8;
    --md-border-color: #e0e2e0;
    --md-text-primary: #1f1f1f;
    --md-text-secondary: #444746;
    --md-radius-pill: 100px;
    --md-radius-card: 24px;
    --md-header-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
    --md-dropdown-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
}

[data-bs-theme="dark"] {
    --md-primary: #a8c7fa;
    --md-on-primary: #062e6f;
    --md-primary-container: #004a77;
    --md-on-primary-container: #c2e7ff;
    --md-body-bg: #000000;
    --md-navbar-bg: #1e1e1e;
    --md-surface-container: #1e1e1e;
    --md-surface-container-high: #33353a;
    --md-border-color: #333333;
    --md-text-primary: #e3e3e3;
    --md-text-secondary: #c4c7c5;
    --md-header-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.6);
    --md-dropdown-shadow: 0 16px 40px rgba(0,0,0,0.6);
}

/* 2. GLOBAL RESET (Taşmaları Engeller) */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--md-body-bg);
    color: var(--md-text-primary);
    transition: background-color 0.3s, color 0.3s;
    letter-spacing: 0.01em;
}
.material-symbols-rounded { vertical-align: middle; transition: 0.2s;}
a { text-decoration: none; }

/* 3. NAVBAR */
.md3-navbar {
    background-color: var(--md-navbar-bg);
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    /* Z-INDEX GÜNCELLENDİ (Sayfa içi sticky alanları 1020'dir, onları ezer) */
    z-index: 1040 !important;
    box-shadow: var(--md-header-shadow);
    border-bottom: 1px solid var(--md-border-color);
    transition: background-color 0.3s;
}
.md3-brand { font-size: 22px; font-weight: 600; color: var(--md-text-primary); display: flex; align-items: center; gap: 12px; margin-right: 40px; }
.md3-brand .material-symbols-rounded { color: var(--md-primary); font-size: 32px; font-variation-settings: 'FILL' 1; }

.md3-nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; height: 100%; align-items: center; }
.md3-nav-link { color: var(--md-text-secondary); font-weight: 500; font-size: 14px; padding: 8px 16px; border-radius: var(--md-radius-pill); display: flex; align-items: center; gap: 8px; transition: all 0.2s; cursor: pointer; }
.md3-nav-link:hover { background-color: var(--md-surface-container-high); color: var(--md-text-primary); }
.md3-nav-link.active { background-color: var(--md-primary-container); color: var(--md-on-primary-container); font-weight: 600; }
.md3-nav-link.active .material-symbols-rounded { font-variation-settings: 'FILL' 1; }

/* ==========================================
   4. MEGA MENÜ MİMARİSİ (HATA BURADA ÇÖZÜLDÜ)
   ========================================== */
.md3-dropdown { position: relative; height: 100%; display: flex; align-items: center;}

.md3-mega-menu {
    position: absolute;
    top: 72px;
    left: 0;
    background-color: var(--md-navbar-bg);
    border: 1px solid var(--md-border-color);
    border-radius: 0 0 24px 24px;
    box-shadow: var(--md-dropdown-shadow);
    padding: 24px;
    display: grid !important;
    gap: 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    /* Z-INDEX GÜNCELLENDİ (Navbar'ın üstüne çıkması için) */
    z-index: 1041 !important;
}

/* ÇÖZÜM: Ekranın sağındaki menüleri sağa yaslar, böylece dışarı taşmazlar */
.mega-align-right {
    left: auto !important;
    right: 0 !important;
}

.md3-dropdown:hover .md3-mega-menu { opacity: 1; visibility: visible; transform: translateY(0); }

/* Grid Sınıfları */
.mega-menu-600 { grid-template-columns: repeat(2, 1fr) !important; width: 600px !important; max-width: 90vw !important;}
.mega-menu-650 { grid-template-columns: repeat(2, 1fr) !important; width: 650px !important; max-width: 90vw !important;}
.mega-menu-850 { grid-template-columns: repeat(3, 1fr) !important; width: 850px !important; max-width: 90vw !important;}
.mega-menu-900 { grid-template-columns: repeat(3, 1fr) !important; width: 900px !important; max-width: 90vw !important;}

.md3-mega-title { font-size: 12px; font-weight: 700; color: var(--md-primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--md-border-color); }
.md3-mega-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 12px; transition: background-color 0.2s; color: var(--md-text-primary); text-decoration: none;}
.md3-mega-item:hover { background-color: var(--md-surface-container-high); color: var(--md-text-primary);}

.md3-mega-icon { width: 36px; height: 36px; background-color: var(--md-body-bg); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--md-primary); flex-shrink: 0; }
.md3-mega-text h6 { font-size: 14px; font-weight: 600; margin: 0 0 2px 0; }
.md3-mega-text p { font-size: 12px; color: var(--md-text-secondary); margin: 0; line-height: 1.3; }

/* 5. ARAÇ ÇUBUĞU & DROPDOWN */
.md3-toolbar { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.md3-icon-btn { background: transparent; border: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--md-text-secondary); cursor: pointer; transition: 0.2s; }
.md3-icon-btn:hover, .md3-icon-btn.show { background-color: var(--md-surface-container-high); color: var(--md-text-primary); }
.md3-avatar { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: 0.2s; }
.md3-avatar.show { border-color: var(--md-primary); }

.action-dropdown {
    background-color: var(--md-navbar-bg) !important;
    border: 1px solid var(--md-border-color) !important;
    border-radius: 20px !important;
    box-shadow: var(--md-dropdown-shadow) !important;
    padding: 0 !important;
    overflow: hidden !important;
    margin-top: 10px !important;
    /* Z-INDEX EKLENDİ (Her şeyin en üstünde durması için) */
    z-index: 1045 !important;
}
.action-dropdown-notif { width: 380px !important; min-width: 380px !important; max-width: 380px !important; }
.action-dropdown-profile { width: 280px !important; min-width: 280px !important; max-width: 280px !important; }

/* Bildirimler */
.notif-badge-position { width: 10px; height: 10px; border: 2px solid var(--md-navbar-bg); top: 25% !important; left: 75% !important; }
.notif-header { padding: 16px; border-bottom: 1px solid var(--md-border-color); display: flex; justify-content: space-between; align-items: center; }
.notif-header-title { font-size: 15px; font-weight: bold; color: var(--md-text-primary); }
.notif-mark-read { font-size: 13px; color: var(--md-primary); font-weight: 500; text-decoration: none;}

.notif-item { padding: 16px; border-bottom: 1px solid var(--md-border-color); display: flex; gap: 12px; transition: 0.2s; text-decoration: none; color: var(--md-text-primary);}
.notif-item:hover { background-color: var(--md-surface-container-high); }
.notif-item.unread { background-color: var(--md-primary-container); }
.notif-item.unread .notif-text-wrap { color: var(--md-on-primary-container); }

.notif-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0 !important;}
.notif-text-wrap { display: flex; flex-direction: column; width: 100%; overflow: hidden; }
.notif-item-title { font-size: 14px; margin-bottom: 2px; font-weight: bold; }
.notif-item-desc { font-size: 13px; opacity: 0.9; line-height: 1.4; white-space: normal; }
.notif-item-time { font-size: 11px; opacity: 0.7; margin-top: 4px; }
.notif-all-btn { font-size: 13px; color: var(--md-primary); border-top: 1px solid var(--md-border-color); padding: 12px; background-color: var(--md-surface-container-high); display: block; text-align: center; font-weight: 500; text-decoration: none;}

/* Profil */
.profile-header { padding: 20px; background-color: var(--md-surface-container-high); text-align: center; }
.profile-avatar-lg { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 12px; object-fit: cover; }
.profile-title { color: var(--md-text-primary); font-size: 16px; margin-bottom: 4px; font-weight: bold;}
.profile-subtitle { font-size: 13px; color: var(--md-text-secondary); margin-bottom: 0; }

.profile-menu-item { padding: 12px 20px; color: var(--md-text-primary); display: flex; align-items: center; gap: 12px; font-weight: 500; transition: 0.2s; text-decoration: none;}
.profile-menu-item:hover { background-color: var(--md-surface-container-high); color: var(--md-primary);}
.profile-divider { border-top: 1px solid var(--md-border-color); margin: 8px 0; }

/* 6. KARTLAR VE İÇERİK */
.md3-main { padding: 40px; max-width: 1600px; margin: 0 auto; }
.md3-page-header { margin-bottom: 32px; }
.md3-page-title { font-size: 28px; font-weight: 600; color: var(--md-text-primary); margin-bottom: 4px; }
.page-subtitle-md3 { color: var(--md-text-secondary); margin: 0; font-size: 15px; }

.md3-card { background-color: var(--md-surface-container); border-radius: var(--md-radius-card); padding: 24px; border: 1px solid var(--md-border-color); transition: transform 0.2s, box-shadow 0.2s; height: 100%; }
.md3-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }

.stat-card-title { font-size: 13px; font-weight: 600; color: var(--md-text-secondary); text-transform: uppercase; }
.stat-card-value { font-size: 32px; font-weight: 600; color: var(--md-text-primary); }

.empty-state-wrapper { min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state-icon-bg { width: 72px; height: 72px; background-color: var(--md-primary-container); border-radius: 20px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.empty-state-icon { font-size: 36px; color: var(--md-on-primary-container); }
.empty-state-title { font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.empty-state-text { color: var(--md-text-secondary); max-width: 500px; font-size: 15px; }


/* ==========================================
   7. TİCARETİS MOBİL UYUMLULUK (RESPONSIVE)
========================================== */

/* Mobil Hamburger Butonu - Masaüstünde Gizle */
.md3-mobile-toggle {
    display: none !important;
}

@media (max-width: 991px) {
    .md3-mobile-toggle { display: flex !important; margin-right: 12px; }

    /* MASAÜSTÜ MENÜSÜNÜ MOBİLDE GİZLE (ÇİFT MENÜ MİMARİSİ) */
    .md3-nav-list { display: none !important; }

    .md3-navbar { padding: 0 16px; }
    .md3-main { padding: 24px 16px; }
    .md3-brand { font-size: 18px; margin-right: 0;}

    /* Offcanvas (Yan Menü) Tasarımı */
    .offcanvas { background-color: var(--md-navbar-bg) !important; border-right: 1px solid var(--md-border-color) !important; width: 320px !important; }
    .offcanvas-header { border-bottom: 1px solid var(--md-border-color); }

    .mobile-nav-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--md-text-primary); font-weight: 500; border-radius: 12px; margin-bottom: 4px; text-decoration: none; transition: 0.2s;}
    .mobile-nav-link:hover, .mobile-nav-link.active { background-color: var(--md-primary-container); color: var(--md-on-primary-container); }

    .mobile-mega-section { padding-left: 48px; border-left: 1px solid var(--md-border-color); margin-left: 24px; margin-top: 8px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 14px; }
    .mobile-mega-title { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--md-primary); opacity: 0.7; margin-top: 8px; }
    .mobile-mega-item { font-size: 14px; color: var(--md-text-secondary); text-decoration: none; }
}

/* =========================================================
   GOOGLE ADMIN PANEL STİLİ BİLDİRİMLER (MATERIAL 3)
   ========================================================= */

/* Masaüstü: Sağ üstte, hafif boşluklu ve zarif */
.google-toast-popup {
    background-color: #323232 !important; /* Google Snackbar Koyu Gri */
    color: #f1f3f4 !important;
    border-radius: 8px !important; /* Google Admin kavis standardı */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
    padding: 12px 24px 12px 16px !important;
    font-family: 'Outfit', sans-serif !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    margin-top: 16px !important;
    margin-right: 16px !important;
}

/* Yazı Stili */
.google-toast-popup .swal2-title {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #f1f3f4 !important;
    margin: 0 !important;
    padding: 0 0 0 12px !important;
    letter-spacing: 0.2px !important;
}

/* İkon Boyutları */
.google-toast-popup .swal2-icon {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    min-width: 24px !important;
    border: none !important;
}

/* Başarı (Yeşil) ve Hata (Kırmızı) Tonları - Google Material Tonları */
.google-toast-popup .swal2-success { color: #81c995 !important; }
.google-toast-popup .swal2-success [class^="swal2-success-line"] { background-color: #81c995 !important; }
.google-toast-popup .swal2-success .swal2-success-ring { border-color: transparent !important; }

.google-toast-popup .swal2-error { color: #f28b82 !important; }
.google-toast-popup .swal2-error [class^="swal2-x-mark-line"] { background-color: #f28b82 !important; }

/* MOBİL ODAK (Kusursuz Üst Hizalama) */
@media (max-width: 576px) {
    .swal2-container.swal2-top,
    .swal2-container.swal2-top-end {
        padding: 12px !important; /* Mobilde ekran kenarlarından hafif boşluk */
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
    }
    .google-toast-popup {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 12px !important; /* Mobilde biraz daha yumuşak köşeler */
        box-sizing: border-box !important;
    }
}}



/*İç Sayfalar*/
.md3-tabs { gap: 8px; }
.md3-tabs .nav-link {
    color: var(--md-text-secondary);
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 12px 20px;
    transition: all 0.2s;
    border-radius: 8px 8px 0 0;
}
.md3-tabs .nav-link:hover {
    background-color: var(--md-surface-container-high);
    color: var(--md-text-primary);
}
.md3-tabs .nav-link.active {
    color: var(--md-primary);
    background-color: transparent;
    border-bottom: 3px solid var(--md-primary) !important;
}
/* Özel Info Rengi (Metinler ve İkonlar İçin) */
.text-info {
    color: rgb(215 223 224) !important
}

/* Panelde butonlarda ve rozetlerde kullandığımız arka planlar için (Opsiyonel Tam Uyum) */
.bg-info {
    background-color: rgb(28 57 63) !important
}
/* Özel Info Outline Butonu */
.btn-outline-info {
    color: rgb(132 163 169) !important;
    border-color: rgb(132 163 169) !important;
    background-color: transparent !important;
}

/* Fareyle üzerine gelindiğinde (Hover) */
.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
    background-color: rgb(132 163 169) !important;
    color: #ffffff !important; /* İçindeki yazı beyaza dönsün */
    border-color: rgb(132 163 169) !important;
}
/* Normal Durum - Tüm div ve butonlar için geçerli kıl */
div.border-dashed,
button.border-dashed {
    border-style: dashed !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

/* Hover (Üzerine Gelme) Durumu - Daha Belirgin Arka Plan ve Okunabilirlik */
div.border-dashed:hover,
button.border-dashed:hover,
.border-dashed.border-primary-subtle:hover {
    /* Saydamlığı 0.1'den 0.25'e çıkardık, artık çok daha belirgin bir dolgu yapacak */
    background-color: rgba(41, 99, 110, 0.25) !important;

    border-color: rgb(41, 99, 110) !important;

    /* İçindeki yazı ve ikonların rengini de bu asil renge çevirerek kontrastı artırıyoruz */
    color: rgb(41, 99, 110) !important;

    /* Bootstrap değişkenlerini eziyoruz */
    --bs-border-color: rgb(41, 99, 110) !important;
    --bs-bg-opacity: 1 !important;
}

/* İçindeki başlık ve ikonların da hover anında renk değiştirmesini garantilemek için */
div.border-dashed:hover *,
button.border-dashed:hover * {
    color: rgb(41, 99, 110) !important;
}