/* Custom Style System for BKDKM Smart Attendance Management System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Premium Slate & Sapphire Color Scheme */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --secondary: #64748b;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-border: #334155;
    
    /* Transition systems */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-body);
    background-color: #f8fafc;
    color: #1e293b;
    font-size: 0.9rem;
}

h1, h2, h3, h4, h5, h6, .brand-text {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Sidebar Custom Styling & Refinements */
.main-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

/* Brand Link Container */
.brand-link {
    border-bottom: 1px solid #e2e8f0 !important;
    background-color: #ffffff !important;
}

.brand-link .brand-text {
    color: #0f172a !important;
    font-weight: 800 !important;
}

/* User Panel Override */
.main-sidebar .user-panel {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}

.main-sidebar .user-panel .info span.text-primary {
    color: #2563eb !important; /* Royal blue highlight */
}

.main-sidebar .user-panel .info span.text-success {
    color: #059669 !important; /* Emerald highlight */
}

.main-sidebar .user-panel .info span.text-info {
    color: #0891b2 !important; /* Cyan highlight */
}

.main-sidebar .user-panel .info span.text-muted {
    color: #64748b !important;
}

/* Base Nav Item Link styling */
.main-sidebar .nav-sidebar .nav-item > .nav-link {
    color: #475569 !important;
    font-weight: 600;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.2s ease-in-out;
}

.main-sidebar .nav-sidebar .nav-item > .nav-link .nav-icon {
    color: #64748b !important;
    transition: all 0.2s ease-in-out;
}

/* Active Nav Links */
.main-sidebar .nav-sidebar .nav-item > .nav-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.main-sidebar .nav-sidebar .nav-item > .nav-link.active .nav-icon {
    color: #ffffff !important;
}

/* Hover Inactive Nav Links */
.main-sidebar .nav-sidebar .nav-link:hover:not(.active) {
    background-color: rgba(37, 99, 235, 0.06) !important;
    color: #2563eb !important;
}

.main-sidebar .nav-sidebar .nav-link:hover:not(.active) .nav-icon {
    color: #2563eb !important;
}

/* Submenu Trees (nav-treeview) */
.main-sidebar .nav-sidebar .nav-treeview {
    background-color: #f8fafc !important;
    margin: 2px 12px 6px 12px !important;
    border-radius: 8px;
    padding: 4px 0 !important;
    border-left: 2px solid #cbd5e1 !important;
    border: 1px solid #e2e8f0 !important;
}

/* Submenu Links */
.main-sidebar .nav-treeview .nav-item > .nav-link {
    margin: 1px 4px !important;
    padding-left: 1.25rem !important;
    color: #475569 !important;
    background-color: transparent !important;
    font-size: 0.85rem !important;
    font-weight: 500;
}

.main-sidebar .nav-treeview .nav-item > .nav-link .submenu-icon {
    font-size: 0.65rem !important;
    margin-right: 0.5rem;
    color: #94a3b8 !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.main-sidebar .nav-treeview .nav-item > .nav-link p {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

/* Submenu Link Hover Animation */
.main-sidebar .nav-treeview .nav-item > .nav-link:hover:not(.active) {
    background-color: rgba(37, 99, 235, 0.05) !important;
    color: #2563eb !important;
}

.main-sidebar .nav-treeview .nav-item > .nav-link:hover:not(.active) .submenu-icon {
    transform: translateX(4px);
    color: #2563eb !important;
}

.main-sidebar .nav-treeview .nav-item > .nav-link:hover:not(.active) p {
    transform: translateX(4px);
}

/* Active Submenu Links */
.main-sidebar .nav-treeview .nav-item > .nav-link.active {
    background-color: rgba(37, 99, 235, 0.08) !important;
    color: #2563eb !important;
    border-left: 3px solid #2563eb !important;
    border-radius: 0 6px 6px 0;
    padding-left: calc(1.25rem - 3px) !important;
    font-weight: 600;
}

.main-sidebar .nav-treeview .nav-item > .nav-link.active .submenu-icon {
    color: #2563eb !important;
    transform: translateX(2px);
}

.main-sidebar .nav-treeview .nav-item > .nav-link.active p {
    color: #2563eb !important;
}

/* System Control & Headers */
.main-sidebar .nav-sidebar .nav-header {
    color: #94a3b8 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em !important;
    padding: 1.5rem 1rem 0.5rem 1.25rem !important;
    text-transform: uppercase;
}

/* Premium Dashboard Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: var(--transition-smooth);
    background-color: #ffffff;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem;
}

/* Premium Widgets */
.small-box {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: var(--transition-smooth);
    border: none;
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.small-box .inner {
    padding: 1.5rem;
}

.small-box h3 {
    font-size: 2.2rem;
    font-weight: 700;
}

/* Sticky top navigation bar custom styles */
.main-header {
    border-bottom: 1px solid #e2e8f0 !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Custom Table Styles */
.table {
    color: #334155;
}

.table th {
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Dark Mode Overrides */
body.dark-mode {
    background-color: #0b0f19;
    color: #f1f5f9;
}

body.dark-mode .main-header {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-bottom: 1px solid #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-mode .main-header .nav-link {
    color: #cbd5e1 !important;
}

body.dark-mode .card {
    background-color: #111827;
    border: 1px solid #1f2937;
    color: #f1f5f9;
}

body.dark-mode .card-header {
    border-bottom: 1px solid #1f2937;
}

body.dark-mode .table th {
    background-color: #1f2937 !important;
    color: #9ca3af !important;
    border-bottom: 2px solid #374151;
}

body.dark-mode .table td {
    border-bottom: 1px solid #1f2937;
    color: #d1d5db;
}

body.dark-mode .content-wrapper {
    background-color: #0b0f19 !important;
}

/* Select2 Modernization */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    height: calc(2.25rem + 2px) !important;
}

/* Custom button classes */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    color: #fff !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Micro-animations */
.hover-scale {
    transition: var(--transition-smooth);
}
.hover-scale:hover {
    transform: scale(1.03);
}

/* QR Code Portal Container */
.qr-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

body.dark-mode .qr-container {
    background: #111827;
    border: 1px solid #1f2937;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Responsive Roster Table for mobile compatibility */
@media (max-width: 768px) {
    #rosterTable {
        display: table !important;
        width: 100% !important;
    }
    #rosterTable thead {
        display: table-header-group !important;
    }
    #rosterTable tbody {
        display: table-row-group !important;
    }
    #rosterTable tr {
        display: table-row !important;
        margin-bottom: 0 !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    #rosterTable td, #rosterTable th {
        display: table-cell !important;
        text-align: left;
        padding: 6px 4px !important;
        font-size: 0.75rem !important;
    }
    #rosterTable td::before {
        display: none !important;
    }
    #rosterTable td .d-flex {
        justify-content: flex-start !important;
        gap: 6px !important;
    }
    #rosterTable img {
        width: 26px !important;
        height: 26px !important;
        margin-right: 4px !important;
    }
    #rosterTable .search-name {
        font-size: 0.75rem !important;
        white-space: normal !important;
        word-break: break-all !important;
        line-height: 1.1 !important;
    }
    #rosterTable .form-check-inline {
        margin-right: 0 !important;
        padding-left: 1.1rem !important;
    }
    #rosterTable .form-check-input {
        width: 0.95rem !important;
        height: 0.95rem !important;
        margin-top: 0.15rem !important;
    }
    #rosterTable .form-check-label {
        font-size: 0.75rem !important;
        padding-left: 0.05rem !important;
    }
    #rosterTable input[type="text"] {
        font-size: 0.7rem !important;
        padding: 2px 4px !important;
        width: 70px !important;
        height: 26px !important;
    }
}
