/* Google Fonts - Inter & Outfit */
@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 {
    --primary-bg: #08172D;          /* Very Dark Navy */
    --secondary-bg: #0D1E3A;        /* Secondary Navy */
    --card-bg: #102547;              /* Dark Navy Cards */
    --header-sidebar-bg: #07152B;    /* Header & Sidebar Navy */
    --metallic-gold: #C89A2B;        /* Primary Gold */
    --soft-gold: #E5C46B;            /* Light Gold */
    --text-color: #FFFFFF;           /* White Text */
    --secondary-text: #C9D2DF;       /* Secondary text */
    --border-color: rgba(200, 154, 43, 0.35); /* Gold Border */
    --hover-bg: rgba(200, 154, 43, 0.15);     /* Gold Hover */
    
    --border-radius: 8px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--primary-bg);
    background-image: 
        radial-gradient(circle at top right, rgba(200, 154, 43, 0.04), transparent 60%),
        radial-gradient(circle at bottom left, rgba(13, 35, 69, 0.8), transparent 80%),
        linear-gradient(rgba(200, 154, 43, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 154, 43, 0.012) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 45px 45px, 45px 45px;
    font-family: var(--font-body);
    color: var(--text-color);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Force outline icons to gold globally, except when active in sidebar */
i {
    color: var(--metallic-gold) !important;
}

/* Auth Page / Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-bg);
    background-image: 
        radial-gradient(circle at top, rgba(200, 154, 43, 0.08), transparent 75%),
        linear-gradient(rgba(200, 154, 43, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 154, 43, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(95vw, 950px);
    height: min(95vw, 950px);
    background-image: url('../images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.login-card {
    width: 100%;
    max-width: 460px;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55) !important;
    background: var(--card-bg) !important;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.login-header {
    background: linear-gradient(180deg, var(--header-sidebar-bg), var(--card-bg));
    padding: 3rem 2rem 2rem 2rem;
    text-align: center;
    color: #ffffff;
    border-bottom: 2px solid var(--metallic-gold);
}

.login-logo {
    width: 95px;
    height: 95px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.login-header h3 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #FFFFFF;
}

.login-card .card-body {
    background: var(--card-bg);
}

.login-card .form-label {
    color: var(--secondary-text) !important;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.login-card .card-footer {
    background: var(--header-sidebar-bg) !important;
    border-top: 1px solid var(--border-color) !important;
    color: var(--secondary-text) !important;
    font-weight: 600;
    letter-spacing: 0.1em;
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 270px;
    max-width: 270px;
    background: var(--header-sidebar-bg) !important;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    z-index: 99;
    border-right: 1px solid var(--border-color) !important;
}

#sidebar.active {
    margin-left: -270px;
}

#sidebar .sidebar-header {
    padding: 1.75rem 1.5rem;
    background: #040e1e !important;
    border-bottom: 1px solid var(--border-color) !important;
}

#sidebar .sidebar-header img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#sidebar .sidebar-header h5 {
    color: #FFFFFF;
    letter-spacing: 0.05em;
    font-weight: 800;
}

#sidebar ul.components {
    padding: 1.25rem 0.75rem;
}

#sidebar ul li {
    margin-bottom: 0.35rem;
}

#sidebar ul li a {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: var(--secondary-text);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
    font-weight: 500;
    border-left: 3px solid transparent;
}

#sidebar ul li a i {
    margin-right: 14px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--metallic-gold) !important;
}

#sidebar ul li a:hover {
    color: #FFFFFF;
    background: var(--hover-bg);
}

#sidebar ul li.active > a {
    color: var(--primary-bg) !important;
    background-color: var(--metallic-gold) !important;
    border-left: 3px solid var(--soft-gold);
    font-weight: 700;
}

#sidebar ul li.active > a i {
    color: var(--primary-bg) !important;
}

/* Content Area */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: var(--header-sidebar-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.1rem 1.5rem !important;
}

.navbar h4 {
    color: #FFFFFF !important;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.main-content {
    padding: 2.25rem;
    flex: 1;
}

/* Cards / Intelligence Panels */
.card {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 35px rgba(200, 154, 43, 0.15) !important;
    border-color: var(--soft-gold) !important;
}

.card-header-gov {
    background: var(--header-sidebar-bg) !important;
    color: #FFFFFF !important;
    border-bottom: 2px solid var(--metallic-gold) !important;
    font-weight: 700;
    border-top-left-radius: 11px !important;
    border-top-right-radius: 11px !important;
    padding: 1.1rem 1.3rem !important;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
    font-size: 1.05rem;
    text-transform: uppercase;
}

.card-body {
    padding: 1.75rem !important;
    color: var(--text-color) !important;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.btn-primary i {
    color: #000000 !important;
}

.btn-primary:hover {
    background-color: var(--soft-gold) !important;
    border-color: var(--soft-gold) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(200, 154, 43, 0.35);
}

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

.btn-outline-primary i {
    color: var(--metallic-gold) !important;
}

.btn-outline-primary:hover {
    background-color: var(--metallic-gold) !important;
    color: #000000 !important;
}

.btn-outline-primary:hover i {
    color: #000000 !important;
}

.btn-secondary {
    background-color: var(--secondary-bg) !important;
    border-color: var(--border-color) !important;
    color: #FFFFFF !important;
}

.btn-secondary:hover {
    background-color: var(--hover-bg) !important;
    border-color: var(--metallic-gold) !important;
    transform: translateY(-1px);
}

.btn-secondary i {
    color: var(--soft-gold) !important;
}

.btn-outline-secondary {
    color: var(--secondary-text) !important;
    border-color: var(--border-color) !important;
    background: transparent !important;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-bg) !important;
    color: #FFFFFF !important;
}

.btn-danger {
    background-color: #991B1B !important;
    border-color: #991B1B !important;
    color: #FFFFFF !important;
}

.btn-danger i {
    color: #FFFFFF !important;
}

.btn-danger:hover {
    background-color: #7F1D1D !important;
    border-color: #7F1D1D !important;
}

.btn-outline-danger {
    color: #EF4444 !important;
    border-color: #EF4444 !important;
    background: transparent !important;
}

.btn-outline-danger:hover {
    background-color: #991B1B !important;
    color: #FFFFFF !important;
}

/* Forms & Inputs */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color) !important;
    background-color: var(--primary-bg) !important;
    color: var(--text-color) !important;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
}

.form-control::placeholder {
    color: #64748b !important;
    opacity: 0.8;
}

.form-control:focus, .form-select:focus {
    border-color: var(--metallic-gold) !important;
    box-shadow: 0 0 0 0.25rem rgba(200, 154, 43, 0.2) !important;
    background-color: var(--primary-bg) !important;
    color: var(--text-color) !important;
    outline: none;
}

.form-text {
    color: var(--secondary-text) !important;
    font-size: 0.8rem;
    opacity: 0.8;
}

.input-group-text {
    background-color: var(--secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--soft-gold) !important;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--header-sidebar-bg) !important;
    color: #FFFFFF !important;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--metallic-gold) !important;
}

.table tbody td {
    padding: 1rem 1.25rem;
    background-color: var(--card-bg) !important;
    color: var(--secondary-text) !important;
    border-bottom: 1px solid rgba(200, 154, 43, 0.15) !important;
    font-size: 0.9rem;
    vertical-align: middle;
}

.table tbody tr:hover td {
    background-color: var(--hover-bg) !important;
}

/* Loader style */
.loader-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 21, 45, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.police-loader {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(200, 154, 43, 0.1);
    border-top: 4px solid var(--metallic-gold);
    border-bottom: 4px solid var(--soft-gold);
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast container positioning */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background-color: var(--secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.toast.bg-success {
    background-color: #064E3B !important;
    border-color: #059669 !important;
}

.toast.bg-danger {
    background-color: #7F1D1D !important;
    border-color: #DC2626 !important;
}

.toast.bg-warning {
    background-color: var(--metallic-gold) !important;
    color: #000000 !important;
}

.toast.bg-warning i {
    color: #000000 !important;
}

/* Key-value fields rendering in records */
.key-label {
    font-weight: 700;
    color: var(--soft-gold) !important;
    text-transform: capitalize;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.value-text {
    font-family: var(--font-body);
    color: var(--text-color) !important;
    word-break: break-all;
    font-size: 0.95rem;
}

.search-badge {
    background: rgba(200, 154, 43, 0.1);
    color: var(--metallic-gold) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Action button sizes */
.btn-action-sm {
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Alerts custom */
.alert-warning {
    background-color: rgba(200, 154, 43, 0.1);
    color: var(--soft-gold) !important;
    border: 1px solid var(--border-color) !important;
}

/* Responsive sidebar overlay for professional mobile view */
@media (max-width: 992px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
    }
    
    #sidebar.active {
        transform: translateX(0);
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(7, 21, 45, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1040;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

/* Stacking buttons and fields on mobile devices */
@media (max-width: 576px) {
    .input-group {
        flex-direction: column;
    }
    .input-group > .form-control {
        width: 100% !important;
        border-radius: 8px !important;
        margin-bottom: 0.75rem;
    }
    .input-group > .btn {
        width: 100% !important;
        border-radius: 8px !important;
        margin-left: 0 !important;
    }
}

/* Helper color overrides for seamless theme integration */
.text-primary {
    color: var(--metallic-gold) !important;
}

.btn-light {
    background-color: var(--secondary-bg) !important;
    border-color: var(--border-color) !important;
    color: #FFFFFF !important;
}

.btn-light:hover {
    background-color: var(--primary-bg) !important;
    color: var(--soft-gold) !important;
}

.text-dark {
    color: var(--text-color) !important;
}

.text-secondary {
    color: var(--secondary-text) !important;
}

/* Override white layout elements inside the primary dashboard area */
.main-content .bg-white,
.card-body .bg-white,
.card-body.bg-light {
    background-color: var(--secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

.badge.bg-white {
    background-color: rgba(200, 154, 43, 0.1) !important;
    color: var(--metallic-gold) !important;
    border: 1px solid var(--border-color) !important;
}

.card-body {
    background-color: var(--card-bg) !important;
}

/* Modals global overrides to fit dark navy & gold theme */
.modal-content {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
}

.modal-header {
    background-color: var(--header-sidebar-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-footer, .modal-footer.bg-light {
    background-color: var(--secondary-bg) !important;
    border-top: 1px solid var(--border-color) !important;
}

.modal-content .table {
    --bs-table-bg: transparent !important;
    background-color: transparent !important;
}

.modal-content .table th,
.modal-content .table td {
    background-color: transparent !important;
}

/* General bg-light and bg-white overrides inside page content */
.main-content .bg-light,
.main-content .bg-white {
    background-color: var(--secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
}

/* Pagination Styling */
.pagination {
    margin-top: 1.5rem;
    gap: 5px;
}

.page-item .page-link {
    background-color: var(--secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--secondary-text) !important;
    padding: 0.5rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    border-radius: 6px !important;
}

.page-item.active .page-link {
    background-color: var(--metallic-gold) !important;
    border-color: var(--metallic-gold) !important;
    color: #000000 !important;
}

.page-item.disabled .page-link {
    background-color: var(--primary-bg) !important;
    border-color: rgba(200, 154, 43, 0.15) !important;
    color: rgba(255, 255, 255, 0.25) !important;
    cursor: not-allowed;
}

.page-item .page-link:hover:not(.disabled) {
    background-color: var(--hover-bg) !important;
    border-color: var(--metallic-gold) !important;
    color: #FFFFFF !important;
}
