/*
 * Labsoft Modern Dark Theme Stylesheet
 */

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #38bdf8;
    --border-color: #334155;
    --sidebar-width: 260px;
    --navbar-height: 60px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    margin: 0;
    overflow-x: hidden;
}

/* Typography Helpers */
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.fs-7 { font-size: 0.85rem; }
.fs-8 { font-size: 0.75rem; }
.text-light-50 { color: var(--text-muted) !important; }

/* Wrapper Layout */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-container {
    display: flex;
    flex-grow: 1;
    min-height: calc(100vh - var(--navbar-height));
    margin-top: var(--navbar-height);
}

/* Custom Navbar */
.custom-navbar {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color);
    height: var(--navbar-height);
}

.custom-navbar .navbar-brand {
    font-size: 1.25rem;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--bg-card) !important;
    border-right: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 99;
}

#sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

#sidebar .nav-link {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

#sidebar .nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

#sidebar .nav-link.active {
    color: #fff;
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#sidebar .nav-header {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    padding-bottom: 0.25rem;
    color: #94a3b8 !important;
    font-weight: 700 !important;
}

/* Content Area */
#content {
    background-color: var(--bg-dark);
    transition: all 0.3s;
    width: 100%;
    min-width: 0;
}

/* Cards customization */
.bg-dark-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3) !important;
}

.bg-primary-subtle { background-color: rgba(59, 130, 246, 0.15) !important; }
.bg-success-subtle { background-color: rgba(16, 185, 129, 0.15) !important; }
.bg-info-subtle { background-color: rgba(56, 189, 248, 0.15) !important; }
.bg-warning-subtle { background-color: rgba(245, 158, 11, 0.15) !important; }

/* Custom Inputs & Dropdowns */
.bg-dark-input {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
}

.bg-dark-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.bg-dark-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

/* Login Page custom styles */
.login-body {
    background: radial-gradient(circle at 10% 20%, rgb(15, 23, 42) 0%, rgb(30, 41, 59) 90.1%);
    min-height: 100vh;
}

.login-wrapper {
    width: 100%;
    max-width: 960px;
}

.login-card {
    min-height: 520px;
    border-radius: 12px;
}

.login-branding-panel {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.input-group-dark .input-group-text {
    border-right: none;
}

.input-group-dark .form-control {
    border-left: none;
}

.input-group-dark .form-control:focus + .input-group-text,
.input-group-dark .form-control:focus {
    border-color: var(--primary-color);
}

/* Dashboard Table formatting */
.custom-dashboard-table {
    border-collapse: separate;
    border-spacing: 0;
}

.custom-dashboard-table tr {
    transition: background-color 0.15s ease;
}

.custom-dashboard-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* SweetAlert2 Theme Overrides */
.swal2-popup.swal2-toast {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

.swal2-title {
    color: #fff !important;
}

/* Select2 Theme Customization */
.select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    color: var(--text-primary);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--primary-color) !important;
}

/* Select2 Selected Values Text Contrast Fixes */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: #ef4444 !important;
    border-right: 1px solid var(--border-color) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.select2-container--bootstrap-5 .select2-search__field {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

.select2-container--bootstrap-5 .select2-selection__placeholder {
    color: var(--text-muted) !important;
}

/* Responsive sidebar tweaks */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.active {
        margin-left: 0;
    }
    #sidebar.collapsed {
        margin-left: calc(-1 * var(--sidebar-width));
    }
}

/* Custom WhatsApp Share Icon Button Styles */
.btn-whatsapp-share {
    color: #22c55e !important;
    background: transparent !important;
    border: none !important;
    padding: 4px 8px !important;
    transition: all 0.2s ease-in-out !important;
}

.btn-whatsapp-share:hover {
    color: #15803d !important;
    background: transparent !important;
    transform: scale(1.2) !important;
    box-shadow: none !important;
}

/* Custom Dropdown Styling to Match Dark Theme & Fix Contrast Hover Issues */
.dropdown-menu-dark {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.dropdown-menu-dark .dropdown-item {
    color: var(--text-muted) !important;
    transition: all 0.15s ease;
}

.dropdown-menu-dark .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

.dropdown-menu-dark .dropdown-item i {
    transition: transform 0.15s ease;
}

.dropdown-menu-dark .dropdown-item:hover i {
    transform: scale(1.1);
}
