/* Desktop Sidebar */
.navbar {
    background-color: var(--tj-color-theme-bg);
    color: var(--tj-color-heading-primary);
}
.sidebar {
    width: 250px;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar .link-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .link-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

#sidebar {
    background-color: var(--tj-color-theme-bg);
    color: var(--tj-color-heading-primary);
    transition: all 0.3s ease;
    width: 250px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
}

#sidebar.collapsed {
    width: 70px;
}

#sidebar .nav-link {
    padding: 10px 15px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    margin-bottom: 5px;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background-color: var(--tj-color-heading-primary);
    color: var(--tj-color-theme-bg) !important;
}

#sidebar .nav-link i {
    font-size: 1.2rem;
}

.sidebar-menu {
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    padding-right: 8px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: var(--tj-color-theme-dark-2);
    border-radius: 10px;
}

.user-info {
    border-bottom: 1px solid var(--tj-color-theme-primary);
    padding-bottom: 10px;
}

#sidebarToggle {
    border: 1px solid var(--tj-color-theme-dark-2);
}

/* Collapse/expand styles */
.sidebar.expanded { width: 250px; }
.sidebar.collapsed { width: 30px; }

/* .sidebar.collapsed .collapse,
.sidebar.collapsed .link-text,
.sidebar.collapsed .user-info span {
    display: none !important;
} */

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding-left: 0.2rem;
    padding-right: 0.5rem;
}

.sidebar.expanded ~ main {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ main {
    margin-left: 70px;
    transition: margin-left 0.3s ease;
}

#sidebarToggle .toggle-icon {
    transition: transform 0.3s ease;
}

.sidebar.collapsed #sidebarToggle .toggle-icon {
    transform: rotate(180deg);
}

.sidebar .nav-link:hover {
    background-color: var(--tj-color-heading-primary);
    color: var(--tj-color-theme-bg) !important;
    border-left: 4px solid var(--tj-color-theme-primary);
    border-right: 2px solid var(--tj-color-theme-bg);
}

.sidebar .nav-link.active {
    background-color: var(--tj-color-heading-primary);
    color: var(--tj-color-theme-bg) !important;
    border-left: 5px solid var(--tj-color-theme-primary);
    border-right: 2px solid var(--tj-color-theme-bg);
    border-top: 2px solid var(--tj-color-theme-bg);
    border-bottom: 2px solid var(--tj-color-theme-bg);
    font-weight: 400;
}

.bi-chevron-down {
    transition: transform 0.3s ease;
}

[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* ------------- MOBILE STYLES ------------- */
@media (max-width: 991.98px) {
    /* Hide sidebar by default */
    #sidebar {
        transform: translateX(-100%);
        width: 250px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transition: transform 0.3s ease-in-out;
        z-index: 2000;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
    }

    /* Show sidebar when active */
    #sidebar.active {
        transform: translateX(0);
    }

    /* Overlay to darken background */
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0,0,0,0.5);
        z-index: 1500;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    #sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Main content margin reset */
    main {
        margin-left: 0 !important;
        transition: none !important;
    }

    /* Show the toggle button */
    #mobileSidebarToggle {
        /* display: block;
        position: fixed; */
        top: 15px;
        left: 15px;
        z-index: 2100;
        background: var(--tj-color-theme-primary);
        border: none;
        color: var(--tj-color-theme-bg);
        padding: 10px;
        border-radius: 4px;
        cursor: pointer;
    }

    /* Sidebar collapsed styles not needed on mobile */
    #sidebar.collapsed {
        width: 250px !important;
    }

    .sidebar.collapsed .link-text {
        opacity: 1 !important;
        pointer-events: auto !important;
        width: auto !important;
        overflow: visible !important;
    }
}

/* Custom style for backend internal pages */
.dash-tables {
    /* background-color: var(--tj-color-theme-bg); */
    /* background: #2E1223;
    background: linear-gradient(90deg,rgba(46, 18, 35, 1) 0%, rgba(6, 1, 41, 1) 50%, rgba(46, 18, 35, 1) 100%); */
    border: none;
    padding: 20px;
}
.dash-tables .table {
    background: #2E1223;
    background: linear-gradient(90deg,rgba(46, 18, 35, 1) 10%, rgba(6, 1, 41, 1) 50%, rgba(46, 18, 35, 1) 90%);
}

.dash-tables .table thead th {
    background-color: var(--tj-color-theme-bg);
    color: var(--tj-color-heading-primary);
    padding: 12px;
    border-bottom: 1px solid var(--tj-color-theme-primary);
    font-weight: var(--tj-fw-sbold);
    vertical-align: middle;
}

.dash-tables .table tbody td {
    background-color: var(--tj-color-theme-bg);
    color: var(--tj-color-heading-primary);
}

.dash-tables .table tbody tr:hover {
    background-color: var(--tj-color-theme-dark) !important;
}

/* Remove default Bootstrap table borders */
.dash-tables .table th,
.dash-tables .table td {
    border: none;
}

.dash-cards, .dash-modals {
    background-color: var(--tj-color-theme-bg);
    border: none;
}
.dash-cards .card-header,
.dash-modals .modal-header {
    background-color: var(--tj-color-theme-bg);
    border-bottom: 1px solid var(--tj-color-theme-primary);
}
.dash-modals .modal-footer {
    border-top: 1px solid var(--tj-color-theme-primary);
}
.dash-cards .card-body,
.dash-modals .modal-body {
    padding: 30px;
}
.dash-cards .dash-label {
    background-color: var(--tj-color-theme-dark);
    padding: 10px;
}

.nav-tabs {
    /* background-color: var(--tj-color-theme-bg); */
    border-bottom: 1px solid var(--tj-color-theme-primary);
    padding: 1px 1px;
    border-radius: 6px;
}

/* Individual tab buttons */
.nav-tabs .nav-link {
    color: var(--tj-color-text); /* Define in your theme if not already */
    background-color: transparent;
    border: none;
    /* padding: 10px 20px; */
    margin-right: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* Hover state */
.nav-tabs .nav-link:hover {
    background-color: var(--tj-color-theme-bg);
    color: var(--tj-color-primary);
}

/* Active tab */
.nav-tabs .nav-link.active {
    background-color: var(--tj-color-theme-bg);
    color: var(--tj-color-heading-primary);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--tj-color-theme-primary);
}


.dash-cards input[type="text"],
.dash-cards input[type="url"],
.dash-cards input[type="email"],
.dash-cards input[type="password"],
.dash-cards input[type="number"],
.dash-cards input[type="tel"],
.dash-cards input[type="file"],
.dash-cards textarea,
.dash-tables input[type="text"],
.dash-tables input[type="url"],
.dash-tables input[type="email"],
.dash-tables input[type="password"],
.dash-tables input[type="number"],
.dash-tables input[type="tel"],
.dash-tables input[type="file"],
.dash-tables input[type="date"],
.dash-tables textarea,
.dash-modals input[type="text"],
.dash-modals input[type="url"],
.dash-modals input[type="email"],
.dash-modals input[type="password"],
.dash-modals input[type="number"],
.dash-modals input[type="tel"],
.dash-modals input[type="file"],
.dash-modals input[type="date"],
.dash-modals input[type="time"],
.dash-modals textarea {
    width: 100%;
    /* padding: 12px 16px; */
    font-size: 1rem;
    border: 1px solid var(--tj-color-border-1);
    border-radius: 8px;
    background-color: var(--tj-color-theme-dark);
    color: var(--tj-color-heading-primary);
    transition: border 0.3s, background-color 0.3s;
}

.dash-modals input[type="date"]::-webkit-calendar-picker-indicator,
.dash-modals input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2);
    cursor: pointer;
}

.custom-date{
    width: 100%;
    /* padding: 12px 16px; */
    font-size: 1rem;
    border: 1px solid var(--tj-color-border-1);
    border-radius: 8px;
    background-color: var(--tj-color-theme-dark);
    color: var(--tj-color-heading-primary);
    transition: border 0.3s, background-color 0.3s;

}
.custom-date::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Removed style for all select */
/* .dash-cards select,
.dash-tables select,
.dash-modals select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--tj-color-theme-dark);
    color: var(--tj-color-heading-primary) !important;
    border: 1px solid var(--tj-color-border-1);
    padding-right: 2rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='white' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.65rem auto;
}
.dash-cards select:hover,
.dash-tables select:hover,
.dash-modals select:hover {
    border-color: var(--tj-color-theme-primary);
    background-color: #2f2f45;
}
.dash-cards select:focus,
.dash-tables select:focus,
.dash-modals select:focus {
    border-color: var(--tj-color-theme-primary);
    background-color: #2a2a3f;
    outline: none;
} */
 .sidebar-icon {
    color: var(--tj-color-theme-primary);
 }

/* Only style custom-select */
.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--tj-color-theme-dark);
    color: var(--tj-color-heading-primary) !important;
    border: 1px solid var(--tj-color-border-1);
    padding-right: 2rem;
    margin:7px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='white' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.65rem auto;
}

.custom-select:hover {
    border-color: var(--tj-color-theme-primary);
    background-color: #2f2f45;
}

.custom-select:focus {
    border-color: var(--tj-color-theme-primary);
    background-color: #2a2a3f;
    outline: none;
}

.custom-select::-ms-expand {
    display: none;
}

.dash-cards input:focus,
.dash-cards textarea:focus,
.dash-tables input:focus,
.dash-tables textarea:focus,
.dash-modals input:focus,
.dash-modals textarea:focus {
    outline: none;
    border-color: var(--tj-color-theme-primary);
    color: var(--tj-color-heading-primary);
    background-color: #2a2a3f;
}

/* Labels inside .dash-cards */
.dash-cards label.form-label,
.dash-modals label.form-label {
    font-weight: 500;
    color: var(--tj-color-heading-primary);
    margin-bottom: 6px;
    display: inline-block;
}

/* Placeholder color styling */
.dash-modals input::placeholder,
.dash-modals textarea::placeholder {
    color: rgba(255, 255, 255, 0.6); /* soft white shade */
    opacity: 1; /* required for Firefox */
}

/* Optional: Apply to dash-cards and dash-tables as well */
.dash-cards input::placeholder,
.dash-cards textarea::placeholder,
.dash-tables input::placeholder,
.dash-tables textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

/* Add spacing to input containers */
.dash-cards .form-input {
    margin-bottom: 1.5rem;
}

/* Base editable area style */
.ck-editor__editable {
  background-color: var(--tj-color-theme-dark) !important;
  color: var(--tj-color-heading-primary) !important;
  border: 1px solid var(--tj-color-border-1) !important;
  border-radius: 8px;
  padding: 1rem;
  min-height: 120px; /* optional */
  transition: border-color 0.3s, background-color 0.3s;
  font-size: 1rem;
  line-height: 1.6;
}

/* Focus style */
.ck-editor__editable:focus {
  outline: none;
  border-color: var(--tj-color-theme-primary);
  background-color: #2a2a3f;
}

/* Dropdown button text */
.ck-toolbar .ck-dropdown .ck-button__label,
.ck-toolbar .ck-dropdown .ck-button__arrow {
  color: #000000 !important;
}

/* Dropdown panel */
.ck-dropdown__panel,
.ck-dropdown__panel-visible {
  background-color: var(--tj-color-theme-dark) !important;
  color: #000000 !important;
}

/* Dropdown list items */
.ck-dropdown__panel .ck-list__item,
.ck-dropdown__panel-visible .ck-list__item {
  color: #000000 !important;
}

/* Selected list item */
.ck-dropdown__panel .ck-list__item.ck-list__item_selected,
.ck-dropdown__panel-visible .ck-list__item.ck-list__item_selected {
  background-color: var(--tj-color-theme-primary) !important;
  color: #000000 !important;
}
/*notification dropdown */
/* Wrapper to align icon + badge properly */
.notification-wrapper {
    position: relative;
}

/* Badge responsive position */
.notification-badge {
    top: -6px !important;
    right: -6px !important;
    font-size: 10px;
    padding: 3px 6px;
}

/* Dropdown Box Responsive */
.notification-dropdown {
    min-width: 280px;
    max-width: 90vw;              /* Mobile friendly */
    max-height: 65vh;
    overflow-y: auto;
    background: #18133b !important;
    padding-bottom: 55px;
    border-radius: 12px;
}

/* Footer sticks to bottom even with scroll */
.notification-footer {
    position: sticky;
    bottom: 0;
    background: #18133b !important;
}

/* Mobile Optimization */
@media (max-width: 576px) {
    .notification-badge {
        top: -4px !important;
        right: -4px !important;
        font-size: 8px;
        padding: 2px 4px;
    }

    .notification-dropdown {
        max-width: 95vw;
        min-width: 250px;
        font-size: 14px;
    }

    .dropdown-header {
        font-size: 1.1rem !important;
    }

    #notificationFooter .btn,
    #notificationFooter a {
        font-size: 13px;
        padding: 6px 10px;
    }
}

