/* ===============================
   GENEL DEĞİŞKENLER
================================== */
:root {
    --sidebar-width: 250px;
    --header-height: 60px;
}

/* Customized light theme
[data-bs-theme="light"] {
    --bs-body-bg: #f9f9f9;
    --bs-body-color: #212121;
}
*/

/* ===============================
   SIDEBAR
================================== */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    transition: all 0.3s;
    padding: 20px 0;
}

#sidebarCollapse {
    margin-left: -35px;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-header .logo {
    max-width: 150px;
    height: 50px;
    transition: all 0.3s ease;
}

.sidebar-header .version {
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.7;
}

.sidebar .nav-link {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link span {
    display: block;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    transition: font-size 0.3s ease;
}

/* ===============================
   COLLAPSED SIDEBAR (ICON ONLY)
================================== */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .version {
    display: none;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

body.collapsed-mode .sidebar {
    width: 70px;
}

body.collapsed-mode .sidebar .version {
    display: none;
}

body.collapsed-mode .sidebar-header {
    padding: 10px 0;
}

body.collapsed-mode .sidebar .nav-link span {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.collapsed-mode .sidebar .nav-link i {
    font-size: 1.75em;
    width: 100%;
    text-align: center;
}

body.collapsed-mode .sidebar .logo {
    width: 48px;
    height: 50px;
    display: none;
    margin: 0 auto;
    transition: all 0.3s ease;
}

#content.sidebar-collapsed,
body.collapsed-mode #content {
    margin-left: 70px;
}

/* ===============================
   MAIN CONTENT
================================== */
#content {
    margin-left: var(--sidebar-width);
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

/* ===============================
   NAVBAR
================================== */
.navbar {
    padding: 15px;
    margin-bottom: 20px;
}

/* ===============================
   RESPONSIVE TASARIM
================================== */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    body.collapsed-mode .sidebar {
        margin-left: 0;
    }

    .sidebar .nav-link span,
    .sidebar .version {
        display: none !important;
    }

    .sidebar .logo {
        width: 48px;
        height: 48px;
        display: block;
        margin: 0 auto;
    }

    .sidebar.active {
        margin-left: 0;
    }

    #content {
        margin-left: 0;
    }

    #content.active {
        margin-left: var(--sidebar-width);
    }
}

/* ===============================
   DARK THEME (BS 5.3+ ile uyumlu)
================================== */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #f8f9fa;
}

/* DARK tema - Ekle butonu */
[data-bs-theme="dark"] .btn-success {
    background-color: #153615;
    border-color: #153615;
    color: #fff;
}

[data-bs-theme="dark"] .btn-success:hover {
    background-color: #347b37;
    border-color: #347b37;
}

/* DARK tema - Arama ve ekle butonları */
[data-bs-theme="dark"] .btn-primary {
    background-color: #0a2f4d;
    border-color: #0a2f4d;
    color: #fff;
}

[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #0f477f;
    border-color: #0f477f;
}

/* DARK tema - Dashboard kartları */
[data-bs-theme="dark"] .dashboard-card.bg-primary {
    background-color: #0d47a1 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dashboard-card.bg-success {
    background-color: #1b5e20 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dashboard-card.bg-info {
    background-color: #01579b !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dashboard-card.bg-warning {
    background-color: #f57f17 !important;
    color: #000000 !important;
}

/* DARK tema - Grup kartları */
[data-bs-theme="dark"] .group-card {
    background: #1f1f1f;
    border-color: #333;
    color: #f1f1f1;
}

[data-bs-theme="dark"] .group-card p {
    color: #ccc;
}

[data-bs-theme="dark"] .group-card h5 {
    color: #fff;
}

/* ===============================
   DASHBOARD KARTLARI
================================== */
.dashboard-card {
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

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

/* ===============================
   GROUP KARTLARI
================================== */
.group-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
    height: 100%;
}

.group-card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.group-card h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.group-card p {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #555;
}

/* ===============================
   CHART (GRAFİK) ALANI
================================== */
.chart-container {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
}

.chart-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

/* ===============================
   TOAST MESAJLARI
================================== */
.toast {
    min-width: 300px;
    max-width: 500px;
    font-size: 1rem;
    border-left: 6px solid;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

/* Genel toast içeriği */
.toast .btn-close {
    filter: none;
}

/* ==================================
   Light Tema - Toast Renkleri
================================== */
[data-bs-theme="light"] .toast.bg-success {
    background-color: #d4edda !important;
    color: #155724 !important;
    border-left-color: #28a745 !important;
}

[data-bs-theme="light"] .toast.bg-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border-left-color: #ffc107 !important;
}

[data-bs-theme="light"] .toast.bg-danger {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-left-color: #dc3545 !important;
}

/* ==================================
   Dark Tema - Toast Renkleri
================================== */
[data-bs-theme="dark"] .toast.bg-success {
    background-color: #1b4029 !important;
    color: #d4edda !important;
    border-left-color: #28a745 !important;
}

[data-bs-theme="dark"] .toast.bg-warning {
    background-color: #4a3e1e !important;
    color: #fff3cd !important;
    border-left-color: #ffc107 !important;
}

[data-bs-theme="dark"] .toast.bg-danger {
    background-color: #522c2c !important;
    color: #f8d7da !important;
    border-left-color: #dc3545 !important;
}

[data-bs-theme="dark"] .toast .btn-close {
    filter: invert(1);
}

/* ===============================
   LOGO GÖRÜNÜMÜ
================================== */
.logo {
    width: 192px;
    height: 50px;
    display: none;
    margin: 0 auto;
    object-fit: contain;
}

/* Tema kontrolüne göre logo gösterimi */
.sidebar-header .logo {
    display: none;
}

body:not(.dark-theme) .sidebar-header .light-logo {
    display: block;
}

body.dark-theme .sidebar-header .dark-logo {
    display: block;
}

/* Versiyon yazısı */
.version {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
}
