/* Custom CSS for Customs Report Website */
/* Blue Theme Colors */
:root {
    --primary-blue: #1e40af;
    --secondary-blue: #3b82f6;
    --light-blue: #60a5fa;
    --dark-blue: #1e3a8a;
    --accent-blue: #2563eb;
    --gradient-blue: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-dark: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

/* Global Styles */
body {
    font-family: 'Prompt', sans-serif;
    line-height: 1.6;
}

/* Custom Bootstrap Override */
.bg-primary {
    background: var(--gradient-blue) !important;
}

.btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--dark-blue);
    border-color: var(--dark-blue);
    transform: translateY(-2px);
}

.text-primary {
    color: var(--primary-blue) !important;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 138, 0.1);
    z-index: -1;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(96, 165, 250, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(37, 99, 235, 0.3) 0%, transparent 50%);
    z-index: -1;
}

.hero-content {
    z-index: 2;
    position: relative;
}

.hero-icon {
    font-size: 15rem;
    color: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-blue);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

/* Service Cards */
.service-card {
    background: white;
    border-radius: 15px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 64, 175, 0.1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.15);
    border-color: var(--light-blue);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.service-card h4 {
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 1rem;
}

.service-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* Feature Items */
.feature-item {
    padding: 1.5rem 0;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-item h5 {
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-large-icon {
    font-size: 12rem;
    color: var(--light-blue);
    opacity: 0.3;
}

/* About Section */
.about-icon {
    font-size: 10rem;
    color: var(--light-blue);
    opacity: 0.6;
}

.about-content h3 {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Contact Cards */
.contact-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(30, 64, 175, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 64, 175, 0.1);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.12);
}

.contact-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.contact-card h5 {
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fbbf24 !important;
}

/* Navbar dropdown overflow fix: anchor dropdown to the right and prevent wide content from causing page horizontal scroll */
.navbar .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 220px;
    max-width: 360px;
    word-break: break-word;
    white-space: normal;
}

.navbar .nav-item .dropdown-toggle {
    white-space: nowrap;
}

/* Prevent very long inline content from forcing horizontal scroll globally */
html, body {
    overflow-x: hidden;
}

/* Footer */
footer {
    background: var(--gradient-dark) !important;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-icon {
        font-size: 8rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .feature-large-icon {
        font-size: 8rem;
    }
    
    .about-icon {
        font-size: 6rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card,
.feature-item,
.contact-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Hover Effects */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    font-weight: 600;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-blue);
}

/* ===== Sober / Flat Theme Overrides (site-wide) ===== */
:root {
    --sober-primary: #2563eb; /* primary blue */
    --sober-primary-dark: #577cf5;
    --sober-muted-slate: #374151;
    --sober-calm-gray: #4b5563;
    --sober-neutral-gray: #6b7280;
    --sober-ochre: #9a8b4f;
    --sober-danger: #c53030;
    --sober-green: #10b981;
}

/* Use flat blue for primary backgrounds (no gradient) */
.bg-primary {
    background: var(--sober-primary) !important;
}

/* Override hero and large gradient usages to flatter blue tones */
.hero-section,
.service-icon,
.feature-icon,
.contact-icon {
    background: var(--sober-primary-dark) !important;
}



.add-user-card .card-header {
    background-color: var(--sober-muted-slate);
    color: #ffffff;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e6eef9 !important; /* very light blue - comfortable */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a; /* dark slate for contrast */
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(15,23,42,0.06);
}

.badge-admin { background-color: #e6eef9; color: #0f172a; font-weight:600; }
.badge-user { background-color: #eef2ff; color: #0f172a; font-weight:600; }
.badge-viewer { background-color: #fff7ed; color: #92400e; font-weight:600; }
.badge-active { background-color: #bbf7d0; color: #064e3b; font-weight:600; }
.badge-inactive { background-color: #fee2e2; color: #7f1d1d; font-weight:600; }

/* Generic badge colors (used by logs page) */
.badge-success { background-color: #bbf7d0; color: #064e3b; border: none; font-weight:600; }
.badge-warning { background-color: #ffedd5; color: #92400e; border: none; font-weight:600; }
.badge-danger { background-color: #fee2e2; color: #7f1d1d; border: none; font-weight:600; }

.btn-edit { background-color: var(--sober-primary); border: none; color: #fff; }
.btn-edit:hover { background-color: var(--sober-primary-dark); }
.btn-delete { background-color: var(--sober-danger); border: none; color: #fff; }
.btn-delete:hover { background-color: #9b2c2c; }

.header-actions .btn { color: #fff; }
.table-hover tbody tr:hover { background-color: rgba(37,99,235,0.03); }

.modal-header.bg-danger { background-color: #b91c1c !important; color: #fff; }

/* Scrollbar thumb to flat blue */
::-webkit-scrollbar-thumb { background: var(--sober-primary); }

/* Ensure primary buttons use flat blue */
.btn-primary { background-color: var(--sober-primary); border-color: var(--sober-primary); }
.btn-primary:hover { background-color: var(--sober-primary-dark); border-color: var(--sober-primary-dark); }

/* Small utility helpers */
.text-theme { color: var(--sober-primary); }

/* End overrides */

/* ===== Logs-like Page Header & Table Styles (shared) ===== */
.page-header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 5px solid var(--sober-primary);
}

.page-title {
    color: #374151;
    font-weight: 600;
    margin: 0;
    font-size: 1.5rem;
}

/* Ensure card headers match logs page (apply to whole header container) */
.users-list-card .card-header,
.logs-table-card .card-header {
    background-color: var(--sober-primary-dark);
    color: #ffffff;
    border-radius: 15px 15px 0 0;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.users-list-card .card-header h5,
.logs-table-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    flex: 1;
    color: inherit;
    background: transparent;
    padding: 0;
}

/* Table header appearance used on logs page */
.table-primary th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

/* Stronger rules to ensure consistent table header colors across views */
table.table thead.table-primary th,
table.table.table-striped thead.table-primary th,
table.table.table-hover thead.table-primary th,
.table.table-primary thead th,
.table-primary thead th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 1rem !important;
}

/* Header action buttons (logs .table-controls and users .header-actions) */
.table-controls .btn,
.header-actions .btn {
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.table-controls .btn:hover,
.header-actions .btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.5);
}

/* Match logs table hover tone */
.table-hover tbody tr:hover { background-color: rgba(102,126,234,0.05); }

/* End logs-like shared styles */

/* Make .fa-users visually match .fa-history */
.fa-history,
.fa-users {
    font-size: 1.25rem; /* slightly larger */
    opacity: 0.95;
    vertical-align: middle;
    color: inherit; /* follow parent color (header/card) */
}

/* Very specific override for logs table header to prevent other styles
   (including upstream frameworks) from changing the intended appearance */
.logs-table-card .card-body table thead.table-primary th,
.logs-table-card .card-body .table thead.table-primary th,
.logs-table-card table.table thead.table-primary th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 1rem !important;
}

/* If thead has inline background on thead element, ensure child th still
   show the expected color */
.logs-table-card .card-body thead.table-primary {
    background-color: transparent !important;
}

/* Mirror the logs header rules for the users list table */
.users-list-card .card-body table thead.table-primary th,
.users-list-card .card-body .table thead.table-primary th,
.users-list-card table.table thead.table-primary th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 1rem !important;
}

.users-list-card .card-body thead.table-primary {
    background-color: transparent !important;
}

/* Fallback scoping for pages rendered without users-list-card present */
.page-users .card-header,
.page-users .card .card-header {
    background-color: var(--sober-primary-dark) !important;
    color: #ffffff !important;
}

.page-users table.table thead.table-primary th,
.page-users .card .card-body table thead.table-primary th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 1rem !important;
}

.page-users .card .card-body thead.table-primary {
    background-color: transparent !important;
}

/* Reports page: ensure customs declaration table header uses same sober style */
.page-reports .data-table-wrapper .table thead th,
.page-reports table.table thead th,
.page-reports .data-table-wrapper thead th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 1rem !important;
}

.page-reports .data-table-wrapper .table thead {
    background-color: transparent !important;
}

/* Highest-specificity override for DataTable-generated table on reports page */
.page-reports #dataTable thead th,
.page-reports table#dataTable thead th {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 1rem !important;
}

/* Make the data table header area resemble logs page card-header */
.page-reports .data-table-wrapper > .d-flex {
    background-color: var(--sober-primary-dark) !important;
    color: #ffffff !important;
    padding: 1rem 1.25rem !important;
    border-radius: 12px 12px 0 0 !important;
    align-items: center;
    /* pull header to the edges of the white container (data-table-wrapper) */
    margin: -1.5rem -1.5rem 0 -1.5rem !important;
    position: relative;
    z-index: 3;
}

.page-reports .data-table-wrapper > .d-flex h5 {
    margin: 0;
    color: inherit !important;
    font-weight: 600;
}

/* Ensure the table container below the header does not add extra top padding */
.page-reports .data-table-wrapper {
    padding-top: 0.75rem !important;
}

/* Make the table area align visually with the header */
.page-reports .data-table-wrapper .table-responsive {
    margin-top: 0.75rem;
    position: relative;
    z-index: 1;
}

