/* 
   Modern Overrides for Visitor Management System
   STABLE GOLDEN STATE V2 - MENU FIXED (Dark bg, White text on hover, No ghosting)
   Reference Date: 2026-01-02
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary-color: #64748b; /* Slate 500 */
    --success-color: #10b981; /* Emerald 500 */
    --info-color: #3b82f6; /* Blue 500 */
    --warning-color: #f59e0b; /* Amber 500 */
    --danger-color: #ef4444; /* Red 500 */
    
    --bg-body: #f3f4f6; /* Gray 100 */
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b; /* Slate 800 */
    --bg-sidebar-hover: #334155; /* Slate 700 - 10-15% lighter for hover */
    
    --text-main: #111827; /* Gray 900 */
    --text-muted: #6b7280; /* Gray 500 */
    
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --transition: all 0.3s ease;
}

/* Global Reset & Typography */
body {
    font-family: 'Inter', sans-serif !important;
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600 !important;
    color: var(--text-main);
}

a {
    transition: var(--transition);
}

/* Navbar Modernization */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--box-shadow) !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: 70px;
}

.navbar .navbar-brand-wrapper {
    background: transparent !important;
    box-shadow: none !important;
}

.navbar .navbar-menu-wrapper {
    box-shadow: none !important;
}

/* Logo Sizing */
.navbar-brand.brand-logo img {
    height: 60px !important;
    width: auto !important;
    max-width: 130px;
}

.navbar-brand.brand-logo-mini img {
    height: 30px !important;
    width: auto !important;
    max-width: 80px;
}

/* Search Bar */
.navbar .search-field .input-group {
    background-color: #f3f4f6 !important;
    border-radius: 20px;
    padding: 5px 15px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.navbar .search-field .input-group:focus-within {
    background-color: #fff !important;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.navbar .search-field input.form-control {
    background: transparent !important;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Sidebar Modernization - SIMPLIFIED & DIRECT FIX */

/* 1. Main Sidebar Background */
.sidebar {
    background-color: #1e293b !important; /* Slate 800 */
}

/* 2. KILL THE WHITE BACKGROUND from style.css (Line 13410) */
/* Instead of transparent, we force the dark hover color directly on the item */
.sidebar .nav .nav-item:hover {
    background: #334155 !important; /* Slate 700 */
}

/* 3. Text Color on Hover */
.sidebar .nav .nav-item:hover .nav-link,
.sidebar .nav .nav-item:hover .menu-title,
.sidebar .nav .nav-item:hover i,
.sidebar .nav .nav-item:hover .menu-arrow {
    color: #ffffff !important;
}

/* 4. Base Link Style */
.sidebar .nav .nav-item .nav-link {
    color: #94a3b8 !important; /* Slate 400 */
    height: auto !important;
    padding: 12px 16px !important;
    transition: all 0.3s ease;
}

/* 5. Active State */
.sidebar .nav .nav-item.active > .nav-link {
    color: #ffffff !important;
}

.sidebar .nav .nav-item.active {
    background: #4f46e5 !important; /* Indigo 600 */
}

.sidebar .nav .nav-item.active .menu-title,
.sidebar .nav .nav-item.active i {
    color: #ffffff !important;
}

/* 6. Sub-menu fixes */
.sidebar .nav.sub-menu {
    background: rgba(0,0,0,0.2) !important;
    padding: 0 !important;
}

.sidebar .nav.sub-menu .nav-item .nav-link {
    padding-left: 48px !important;
    background: transparent !important;
    position: relative; /* For active indicator */
}

.sidebar .nav.sub-menu .nav-item:hover {
    background: transparent !important; /* Sub-items don't need background on item, just link */
}

.sidebar .nav.sub-menu .nav-item .nav-link:hover {
    background: rgba(255,255,255,0.05) !important;
    color: #ffffff !important;
}

/* Sub-menu Active State - Added for Golden State V2 Consistency */
.sidebar .nav.sub-menu .nav-item .nav-link.active {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    font-weight: 500 !important;
}

.sidebar .nav.sub-menu .nav-item .nav-link.active:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 3px;
    background-color: var(--primary-color);
    border-radius: 0 4px 4px 0;
}


/* Cards & Containers */
.card {
    border: none !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--box-shadow);
    background: var(--bg-card);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

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

.card-body {
    padding: 1.5rem !important;
}

.card-title {
    color: var(--text-main);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius-sm) !important;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* 8. QR Code Button Styling (Custom Black) - Added from V2.3 */
/* WCAG AAA Compliant: #FFFFFF on #000000 is 21:1 */
.btn-qrcode {
    background-color: #000000 !important; /* Pure Black */
    border-color: #000000 !important;
    color: #ffffff !important; /* White Icon */
    transition: all 0.2s ease-in-out;
}

.btn-qrcode:hover {
    background-color: rgba(0, 0, 0, 0.8) !important; /* 80% Opacity Black for feedback */
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-qrcode:focus, .btn-qrcode.focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.3) !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
}

.btn-qrcode:disabled {
    background-color: #000000 !important;
    border-color: #000000 !important;
    opacity: 0.5 !important;
    cursor: not-allowed;
}

.btn-qrcode:not(:disabled):not(.disabled):active {
    background-color: #000000 !important;
    border-color: #000000 !important;
    opacity: 0.9;
    transform: translateY(1px);
    box-shadow: none;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background-color: #f8fafc;
    transition: var(--transition);
}

.form-control:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
    outline: none;
}

/* 9. Sidebar Icon Positioning Fix (Golden State V2) */
.sidebar .nav .nav-item .nav-link i.menu-icon {
    margin-left: 0 !important;
    margin-right: 12px !important;
    order: -1; /* Flex order to ensure icon is first if HTML isn't swapped, but we will swap HTML too */
}

/* Ensure arrow stays on right */
.sidebar .nav .nav-item .nav-link i.menu-arrow {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #f1f5f9;
    color: var(--text-main);
    font-size: 0.9rem;
}

.table-responsive {
    border-radius: var(--border-radius);
}

/* Modals */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem;
    background-color: transparent !important;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.5rem;
    background-color: transparent !important;
}

/* Utilities */
.float-right {
    float: right !important;
}

.float-left {
    float: left !important;
}

/* Button Variants Overrides */
.btn-info {
    background-color: var(--info-color) !important;
    border-color: var(--info-color) !important;
    color: #fff !important;
}

.btn-success {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: #fff !important;
}

.btn-danger {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: #fff !important;
}

.btn-warning {
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: #fff !important;
}


/* Dashboard Cards & Gradients */
.bg-gradient-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4338ca 100%) !important;
}

.card.card-img-holder {
    position: relative;
    overflow: hidden;
}

.card.card-img-holder .card-img-absolute {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    opacity: 0.2;
}

/* Login/Auth Screen */
.auth .auth-form-light {
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.auth .brand-logo img {
    width: 150px;
    margin-bottom: 2rem;
}

.auth form .form-group {
    margin-bottom: 1.5rem;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .navbar .navbar-menu-wrapper {
        padding-left: 0;
        padding-right: 0;
    }
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Footer */
.footer {
    background: transparent !important;
    border-top: none !important;
    color: var(--text-muted) !important;
    padding: 2rem 1rem;
}

/* Utilities */
.text-muted {
    color: var(--text-muted) !important;
}

.content-wrapper {
    background: transparent !important;
    padding: 2rem !important;
}

/* Responsive Tweaks */
@media (max-width: 991px) {
    .navbar .navbar-brand-wrapper {
        width: auto;
    }
    
    .sidebar {
        background: var(--bg-sidebar) !important;
    }
}

/* Gradient Overrides for Dashboard */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, var(--info-color), #2563eb) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #059669) !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706) !important;
}

/* Dashboard Cards Typography */
.card-img-holder {
    position: relative;
    overflow: hidden;
}

.card-img-holder .card-img-absolute {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    opacity: 0.1; /* Make background image subtle */
}

.card h4.font-weight-normal {
    font-weight: 500 !important;
    font-size: 1.1rem;
    opacity: 0.9;
}

.card h2.mb-5 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0 !important; /* Remove large margin */
}

/* Mobile Navbar Tweaks */
@media (max-width: 991px) {
    .navbar .navbar-menu-wrapper {
        width: auto;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0;
    }
    
    .search-field {
        display: none; /* Hide search on mobile or make collapsible if needed */
    }
}

/* Modal Modernization */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Button Gradients Override */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    border: none;
    color: #fff;
}

.btn-gradient-info {
    background: linear-gradient(135deg, var(--info-color), #2563eb) !important;
    border: none;
    color: #fff;
}

.btn-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #059669) !important;
    border: none;
    color: #fff;
}

.btn-gradient-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626) !important;
    border: none;
    color: #fff;
}

.auth .auth-form-light {
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
}

/* Table Legacy Overrides - from head.php */
th { 
    white-space: normal !important;
    word-wrap: break-word;
    hyphens: auto;
} 

td { 
    white-space: normal !important;
    word-wrap: break-word;
    hyphens: auto;
    line-height: 20px !important;
} 
