@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* --- Brand Colors --- */
    --bs-primary: #e74c3c;
    --bs-primary-rgb: 231, 76, 60;
    --bs-body-bg: #f8f8f8;
    --bs-body-font-family: 'Public Sans', sans-serif;
    /* --- UI Elements --- */
    --card-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
    --card-radius: 0.5rem;
    --text-muted: #a1acb8;
    --text-heading: #5d596c;
    /* --- Layout Dimensions --- */
    --sidebar-width: 260px;
    --header-height: 70px;
    --header-border-color: #cbd5e1; /* The master border color */
}

/* =========================================
   GLOBAL RESET & LAYOUT STRUCTURE
   ========================================= */
body {
    background-color: var(--bs-body-bg);
    color: #6f6b7d;
    font-family: var(--bs-body-font-family);
    overflow: hidden;
    margin: 0;
}

#wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* =========================================
   SIDEBAR WRAPPER
   ========================================= */
#sidebar-wrapper {
    width: var(--sidebar-width);
    height: 100%;
    margin: 0;
    border-radius: 0;
    border-right: 1px solid var(--header-border-color);
    flex-shrink: 0;
    background: #fff;
    box-shadow: var(--card-shadow);
    z-index: 1050;
    transition: margin 0.3s ease-in-out;
    overflow-y: auto;
}

@media (max-width: 992px) {
    #sidebar-wrapper {
        margin-left: calc(var(--sidebar-width) * -1);
        position: absolute;
    }

    body.sb-sidenav-toggled #sidebar-wrapper {
        margin-left: 0;
    }
}

/* =========================================
   CONTENT WRAPPER
   ========================================= */
#page-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    background-color: var(--bs-body-bg);
}

/* =========================================
   SIDEBAR & HEADER STYLING
   ========================================= */
.sidebar-content .brand {
    height: var(--header-height);
    border-bottom: none;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    margin-bottom: 0;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-heading);
    gap: 10px;
}

.nav-link {
    color: #6f6b7d;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    font-weight: 500;
}

    .nav-link:hover {
        background-color: rgba(115, 103, 240, 0.08);
        color: var(--bs-primary);
    }

    .nav-link.active {
        background: linear-gradient(72.47deg, var(--bs-primary) 22.16%, rgba(var(--bs-primary-rgb), 0.7) 76.47%);
        box-shadow: 0px 2px 6px 0px rgba(var(--bs-primary-rgb), 0.48);
        color: #fff;
    }

    .nav-link i {
        width: 1.5rem;
        font-size: 1.1rem;
        text-align: center;
    }

/* =========================================
   TOP NAVBAR STYLING
   ========================================= */
.top-navbar {
    width: auto;
    /* Keeps the floating spacing: Top | Right | Bottom | Left */
    margin: 0.5rem 1rem 0.5rem 1rem;
    background: #fff;
    height: var(--header-height);
    /* CHANGE 1: Remove the border line */
    border: none;
    /* CHANGE 2: Add shadow so it looks like a card */
    box-shadow: var(--card-shadow);
    border-radius: var(--card-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

/* =========================================
   COMPONENT STYLING
   ========================================= */
.card {
    border: 1px solid var(--header-border-color) !important;
    box-shadow: var(--card-shadow);
    border-radius: var(--card-radius);
    background: #fff;
    margin-bottom: 1.5rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #eceef1;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Utilities */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.bg-label-primary {
    background-color: rgba(var(--bs-primary-rgb), 0.12) !important;
    color: var(--bs-primary) !important;
}

.bg-light-primary {
    background-color: rgba(var(--bs-primary-rgb), 0.16) !important;
    color: var(--bs-primary) !important;
}

.text-heading {
    color: var(--text-heading) !important;
}

.alert {
    border-radius: var(--card-radius);
}

/* Sidebar Chevron Rotation */
.transition-icon {
    transition: transform 0.3s ease;
}

/* When the parent is NOT collapsed (i.e. it is open), rotate the arrow */
[aria-expanded="true"] .transition-icon {
    transform: rotate(180deg);
}

/* --- Drag & Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--header-border-color);
    border-radius: var(--card-radius);
    padding: 2rem;
    text-align: center;
    background-color: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

    .drop-zone:hover, .drop-zone.dragover {
        border-color: var(--bs-primary);
        background-color: rgba(var(--bs-primary-rgb), 0.05);
    }

    .drop-zone i {
        font-size: 2.5rem;
        color: var(--text-muted);
        margin-bottom: 0.5rem;
    }

/* --- Scrollable List (Max 5 items) --- */
/* Assuming approx 50px per item, 250px shows 5 items */
.scrollable-list {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--header-border-color);
    border-radius: var(--card-radius);
}

    /* Custom Scrollbar styling for webkit */
    .scrollable-list::-webkit-scrollbar {
        width: 6px;
    }

    .scrollable-list::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .scrollable-list::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

        .scrollable-list::-webkit-scrollbar-thumb:hover {
            background: var(--bs-primary);
        }

/* Add to site.css */
.login-bg-gradient {
    /* Linear gradient from your primary color to a slightly softer orange/pink variant */
    background: linear-gradient(135deg, var(--bs-primary) 0%, #ff7b6e 100%);
    position: relative;
    z-index: 1;
}

    /* Optional: Add a subtle pattern overlay if you want extra texture */
    .login-bg-gradient::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: radial-gradient(rgba(255, 255, 255, 0.15) 2px, transparent 2px);
        background-size: 30px 30px;
        z-index: -1;
    }

/* Add to bottom of site.css */
.bg-soft-glow {
    background-color: #f8f9fa; /* Very light gray base */
    position: relative;
    overflow: hidden; /* Ensures the blurred circles don't scroll */
    z-index: 1;
}

    /* Create the decorative blobs */
    .bg-soft-glow::before,
    .bg-soft-glow::after {
        content: '';
        position: absolute;
        width: 600px;
        height: 600px;
        border-radius: 50%;
        z-index: -1; /* Puts them behind the content */
        filter: blur(100px); /* This creates the "modern soft" look */
        opacity: 0.5;
    }

    /* Blob 1: Top Right (Primary Color) */
    .bg-soft-glow::before {
        background: rgba(var(--bs-primary-rgb), 0.15); /* Low opacity red */
        top: -150px;
        right: -150px;
    }

    /* Blob 2: Bottom Left (Slightly lighter) */
    .bg-soft-glow::after {
        background: rgba(var(--bs-primary-rgb), 0.10); /* Even lower opacity */
        bottom: -150px;
        left: -150px;
    }

/* Add to site.css */
.bg-angled-split {
    background-color: #f4f6f8; /* A clean, professional gray for the bottom */
    position: relative;
    z-index: 0;
}

    .bg-angled-split::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 60vh;
        background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(231, 76, 60, 0.65) 100%);
        clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%);
        z-index: -1;
    }

/* =========================================
   DARK MODE OVERRIDES
   ========================================= */

[data-bs-theme="dark"] {
    /* 1. Swap the CSS variables for dark mode */
    --bs-body-bg: #232333; /* Dark background for the main body */
    --header-border-color: #434968; /* Darker borders */
    --text-muted: #82869e; /* Dimmed text for dark mode */
    --text-heading: #cfd3ec; /* Light text for headings */
    --card-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.4); /* Darker, subtler shadow */
}

    /* 2. Fix the Body Text */
    [data-bs-theme="dark"] body {
        color: #a3a4cc;
    }

    /* 3. Fix the Sidebar, Navbar, and Cards */
    [data-bs-theme="dark"] #sidebar-wrapper,
    [data-bs-theme="dark"] .top-navbar,
    [data-bs-theme="dark"] .card {
        background-color: #2b2c40 !important; /* Elevated dark card color */
        border-color: var(--header-border-color) !important;
    }

    [data-bs-theme="dark"] .card-header {
        border-bottom-color: var(--header-border-color);
    }

    /* 4. Fix Nav Links */
    [data-bs-theme="dark"] .nav-link {
        color: #a3a4cc;
    }

        [data-bs-theme="dark"] .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

    /* 5. Fix Dropzone and Scrollable Lists */
    [data-bs-theme="dark"] .drop-zone {
        background-color: #232333;
        border-color: var(--header-border-color);
    }

    [data-bs-theme="dark"] .scrollable-list {
        border-color: var(--header-border-color);
    }

        [data-bs-theme="dark"] .scrollable-list::-webkit-scrollbar-track {
            background: #2b2c40;
        }

        [data-bs-theme="dark"] .scrollable-list::-webkit-scrollbar-thumb {
            background: #434968;
        }

    /* 6. Fix Text Utilities */
    [data-bs-theme="dark"] .text-heading {
        color: var(--text-heading) !important;
    }
