/* Project: Fixit Emerge Admin Dashboard
    Theme: Premium SaaS (Pingo/Tagus Style)
    Main Color: #7B60A7 (Fixit Purple)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #7B60A7;
    --secondary-color: #F8AC4A;
    --bg-light: #f5f7fa;
    --sidebar-width: 260px;
    --navbar-height: 70px; /* Define a standard height */
    --card-shadow: 0 4px 20px rgba(47,143,232,.07);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

#wrapper {
    display: flex;
    height: 100vh; /* Lock the wrapper to the screen height */
    overflow: hidden;
}

.bg-primary{
    background-color: #7b60a7 !important;
}

#taskDetailsModal .btn-dark{
    background-color: #7b60a7 !important;
    border: unset !important;
}

.article-preview h1, .article-preview h2, .article-preview h3, .article-preview h4, .article-preview h5, .article-preview h6, .article-preview span, .article-preview p{
    font-family: 'Inter' !important;
}

.article-preview h1{
   font-size: 33px !important;
   margin-bottom: 12px !important;
   font-weight: 400 !important;
}

.article-preview h2, .article-preview h3, .article-preview h4{
   font-size: 26px !important;
   margin-bottom: 12px !important;  
   font-weight: 400 !important;
}

.btn-outline-secondary{
    --bs-btn-color: #7b60a7 !important;
    --bs-btn-border-color: #7b60a7 !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-hover-bg: #7b60a7 !important;
    --bs-btn-hover-border-color: #7b60a7 !important;    
}

/* =========================================
   FIXED SIDEBAR
   ========================================= */

.brand-area {
    padding: 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #f8fafd;
    margin-bottom: 20px;
}

.brand-area img {
    max-width: 100%;
    height: auto;
    width: 140px;
    display: block;
}

.nav-container {
    overflow-y: auto;
    flex-grow: 1;
}

.nav-category {
    font-size: 11px;
    font-weight: 700;
    color: #b5b5c3;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 25px 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 19px;
    margin: 4px 15px;
    color: #5e6278;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 18px;
    margin-right: 12px;
    color: #a1a5b7;
}

.nav-link.active, .nav-link:hover {
    background: #f4f1f9;
    color: var(--primary-color) !important;
}

.nav-link.active i, .nav-link:hover i {
    color: var(--primary-color);
}

.sidebar-footer {
    margin-top: auto !important; /* Pushes logout to the bottom of the card */
    padding-top: 0px !important;
    border-top: 1px solid #f8f9fa !important;
}

.logout-link {
    color: #f1416c !important;
    background: rgba(241, 65, 108, 0.05);
}

.logout-link:hover {
    background: #f1416c !important;
    color: #fff !important;
}

/* =========================================
   MAIN CONTENT AREA
   ========================================= */

/* =========================================
   TOP NAVBAR
   ========================================= */
.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    width: calc(100% - var(--sidebar-width));
    height: 90px; /* Increased height to give breathing room */
    z-index: 1000;
    background-color: transparent; /* Makes the main header invisible */
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: all 0.3s ease;
}

.navbar-floating {
    background: #ffffff;
    width: 100%;
    padding: 10px 25px;
    border-radius: 15px; /* This gives the Tagus rounded look */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); /* Soft shadow */
    border: 1px solid #f1f3f9;
}

.header-date {
    background: #f0ecf7;
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.header-icon {
    width: 40px;
    height: 40px;
    background: #f8f9fb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #5b6271;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* =========================================
   TABLE & CARDS
   ========================================= */
.custom-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f1f3f9;
    box-shadow: var(--card-shadow);
    margin-top: 25px;
}

.table-header-custom {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f3f9;
}

.table thead th {
    background-color: #f4f7ff;
    color: #7b60a7;
    font-weight: 600;
    font-size: 13px;
    padding: 15px 25px;
    border: none;
}

.table tbody td {
    padding: 18px 25px;
    border-bottom: 1px solid #f1f3f9;
    vertical-align: middle;
    color: #5b6271;
    font-size: 14px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.badge-active {
    background-color: #e6f9f0;
    color: #31ce77;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

/* =========================================
   DROPDOWN & ACTIONS
   ========================================= */
.btn-action {
    background: #f8f9fb;
    border: none;
    color: #a0a0a0;
    padding: 5px 10px;
    border-radius: 4px;
}

.dropdown-menu {
    border-radius: 10px;
    border: 1px solid #f1f3f9;
    padding: 8px;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    z-index: 1050;
    position: absolute !important;    
}

.dropdown-item {
    border-radius: 6px;
    font-size: 14px;
    padding: 8px 12px;
}

.dropdown-item:hover {
    background-color: #f8f9fb;
    color: var(--primary-color);
}

/* Add these fixes to your existing style.css */

#wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#sidebar {
    width: 280px !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    padding: 15px !important; /* The small padding from the window edges */
    background-color: #f5f7fa !important;
    z-index: 1040 !important;
    overflow: hidden !important;
}

/* Custom scrollbar to keep it looking clean */
.nav-container::-webkit-scrollbar {
    width: 4px;
}
.nav-container::-webkit-scrollbar-thumb {
    background: rgba(123, 96, 167, 0.2);
    border-radius: 10px;
}

.sidebar-card {
    background: #ffffff !important;
    height: 100% !important;
    width: 100% !important;
    border-radius: 20px !important; /* Rounded card style */
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05) !important; /* Your default box shadow */
    display: flex !important;
    flex-direction: column !important;
    padding: 25px 0 !important;
    border: 1px solid #f1f3f9 !important;
    overflow: hidden !important;
}

#content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
    position: relative;
}

/* Search Box Fix */
.search-box {
    position: relative;
    width: 300px;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0a0a0;
}

.form-control-custom {
    background: #f8f9fb;
    border: 1px solid #f1f3f9;
    border-radius: 30px; /* Rounded search bar */
    padding: 8px 15px 8px 40px;
    font-size: 14px;
    width: 280px;
    outline: none;
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #f1416c;
    border: 2px solid #fff;
    border-radius: 50%;
}

.main-body {
    padding: 110px 30px 30px 30px; /* Extra top padding for the 90px header */
    flex: 1;
    overflow-y: auto;
}

/* Customizing the Primary Button to match your theme */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    padding: 10px 24px !important; /* Proper padding for a professional look */
    border-radius: 10px !important; /* Rounded corners like the Tagus theme */
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    display: flex;
    align-items: center;
    gap: 8px; /* Space between the plus icon and text */
}

/* Hover state for a nice interactive feel */
.btn-primary:hover {
    background-color: #6a5291 !important; /* Slightly darker shade of your purple */
    border-color: #6a5291 !important;
    transform: translateY(-1px); /* Slight lift on hover */
    box-shadow: 0 4px 12px rgba(123, 96, 167, 0.2);
}

/* Fix for the plus icon inside the button */
.btn-primary i {
    font-size: 1.1rem;
    line-height: 0;
}


/* Search Input Focus Effect */
.form-control-custom:focus {
    border-color: #7B60A7 !important;
    box-shadow: 0 0 0 0.2rem rgba(123, 96, 167, 0.25) !important;
    background-color: #fff !important;
}

/* Profile Dropdown Menu Styling */
.top-navbar .dropdown-menu {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    padding: 10px !important;
    margin-top: 15px !important;
}

.top-navbar .dropdown-item {
    border-radius: 8px !important;
    padding: 8px 15px !important;
    transition: all 0.2s;
}

.top-navbar .dropdown-item:hover {
    background-color: rgba(123, 96, 167, 0.1) !important;
    color: #7B60A7 !important;
}

.table-responsive {
    overflow: visible !important;
}

input:disabled, select:disabled, input[readonly] {
    background-color: #f8f9fa !important;
    cursor: not-allowed;
    border-color: #e9ecef;
    color: #6c757d;
}

.transition-icon {
        transition: transform 0.3s ease;
        display: inline-block;
    }
[aria-expanded="true"] .transition-icon {
        transform: rotate(180deg);
        color: #7B60A7;
}

.form-check-input:checked
 {
    background-color: #7b60a7 !important;
    border-color: #7b60a7 !important;
}

.text-primary{
    color: #7b60a7 !important;
}

.nav-tabs .nav-link, .nav-tabs .nav-link.active{
    border-radius: 0px !important;
}


@media print {
    /* Hide the filter form and download button in the PDF */
    form, .btn, .bi-download {
        display: none !important;
    }
    
    /* Ensure cards don't break awkwardly between pages */
    .card {
        page-break-inside: avoid;
    }
    
    #main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Hidden on screen, visible in PDF */
    #pdf-header {
        display: none;
    }

@media print {
        #pdf-header {
            display: block !important;
            margin-bottom: 20px;
            border-bottom: 2px solid #7B60A7;
            padding-bottom: 10px;
        }
        /* Hide filters, buttons, and the web-view title */
        form, .btn, .d-flex.justify-content-between.align-items-center.mb-4.bg-white {
            display: none !important;
        }
        .card {
            page-break-inside: avoid;
            border: 1px solid #eee !important;
        }
}

@media print {
    /* Targets the red-boxed filter area specifically */
    .d-flex.justify-content-between.align-items-center.mb-4.bg-white.p-3 {
        display: none !important;
    }
    
    /* Ensure the PDF header shows up */
    #pdf-only-header {
        display: block !important;
    }

    /* General cleanup for the PDF */
    .btn, form, #sidebar, .navbar {
        display: none !important;
    }
}

.flatpickr-months .flatpickr-prev-month svg path, .flatpickr-months .flatpickr-next-month svg path{
   fill: white !important;
}

.btn-outline-primary{
    --bs-btn-color: #7b60a7;
    --bs-btn-border-color: #7b60a7;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #7b60a7;
    --bs-btn-hover-border-color: #7b60a7;
    --bs-btn-focus-shadow-rgb: 13, 110, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #7b60a7;
    --bs-btn-active-border-color: #7b60a7;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #7b60a7;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #7b60a7;    
}

#v-urls a{
    padding: 10px;
    font-weight: 500;
}


.custom-tab-btn {
        color: #6c757d;
        font-weight: 600;
        border-radius: 10px !important;
        padding: 10px 20px;
        transition: 0.3s;
        border: none;
        background: transparent;
}
.nav-pills .nav-link.active {
        background-color: #7B60A7 !important;
        color: white !important;
}

.nav-pills .nav-link.active i{
        color: white !important;
}

#performanceTabs{
     background: #fff; padding: 10px; border-radius: 15px; display: flex; width: 100%; gap: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: none;    
}

/* Filter Wrapper Styling */
.filter-wrapper {
    background: transparent;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7e69ab; /* Matching your purple theme */
    font-weight: 600;
    font-size: 1.1rem;
    margin-right: 10px;
}

.filter-select-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* The actual dropdown styling */
.custom-filter-select {
    appearance: none;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 40px 10px 45px; /* Extra space for icons */
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.2s ease-in-out;
    min-width: 180px;
}

/* Icon positioning inside dropdown */
.filter-icon {
    position: absolute;
    left: 15px;
    color: #adb5bd;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 5;
}

/* Add the custom arrow for the dropdown */
.filter-select-container::after {
    content: "\F282"; /* Bootstrap Icon Chevron-Down hex */
    font-family: "bootstrap-icons";
    position: absolute;
    right: 15px;
    color: #6c757d;
    font-size: 0.8rem;
    pointer-events: none;
}

.custom-filter-select:hover {
    border-color: #7e69ab;
    background-color: #fcfaff;
}

.custom-filter-select:focus {
    outline: none;
    border-color: #7e69ab;
    box-shadow: 0 0 0 3px rgba(126, 105, 171, 0.15);
}

.calendar-container {
        display: grid;
        grid-template-columns: repeat(7, 1fr); /* FORCES 7 EQUAL COLUMNS */
        width: 100%;
        background-color: #dee2e6; /* Border color */
        gap: 1px; /* Gap creates the "border" look */
        border: 1px solid #dee2e6;
    }
    .calendar-header-cell {
        background-color: #f8f9fa;
        padding: 10px;
        text-align: center;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.85rem;
    }
    .calendar-day-cell {
        background-color: #ffffff;
        min-height: 110px;
        padding: 10px;
        transition: background 0.2s;
    }
    .calendar-day-cell.today {
        background-color: #f8f9ff;
        box-shadow: inset 0 0 0 2px #0d6efd;
        z-index: 1;
    }
    .calendar-day-cell.other-month {
        background-color: #fafafa;
        color: #adb5bd;
    }
    
    .tox-editor-container .tox-promotion, .tox-statusbar__branding{
        display: none;
    }