/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #0F4C81;     /* Navy Blue (KEMNAKER Primary) */
    --secondary-color: #2D76B9;   /* Steel Blue (KEMNAKER Secondary) */
    --accent-color: #F5A623;      /* Gold/Orange Accent */
    --bg-light: #F4F7FA;          /* Page background */
    --sidebar-width: 260px;
    --sidebar-bg: #092540;        /* Extra deep navy */
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* --- Layout Wrapper --- */
#wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --- Sidebar --- */
#sidebar-wrapper {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #ffffff;
    transition: margin-left var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--sidebar-bg) 100%);
}

#sidebar-wrapper .sidebar-brand-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.sidebar-menu {
    flex-grow: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--secondary-color);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar-user-info {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1px;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-transform: capitalize;
}

/* --- Main Content Area --- */
#page-content-wrapper {
    flex-grow: 1;
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

/* --- Top Navbar --- */
.navbar-custom {
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar-custom #menu-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar-custom #menu-toggle:hover {
    background: var(--bg-light);
}

/* --- Page Header & Typography --- */
.page-title-box {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.page-breadcrumb {
    font-size: 0.825rem;
    color: var(--text-light);
}

/* --- Cards & Dashboard Widgets --- */
.card-custom {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin-bottom: 1.5rem;
}

.card-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.card-custom .card-body {
    padding: 1.5rem;
}

.widget-card {
    border-left: 4px solid transparent;
}

.widget-card.primary { border-left-color: var(--primary-color); }
.widget-card.success { border-left-color: #2ecc71; }
.widget-card.warning { border-left-color: var(--accent-color); }
.widget-card.info { border-left-color: #3498db; }
.widget-card.danger { border-left-color: #e74c3c; }
.widget-card.purple { border-left-color: #9b59b6; }

.widget-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.widget-card.primary .widget-icon-box { background: rgba(15, 76, 129, 0.08); color: var(--primary-color); }
.widget-card.success .widget-icon-box { background: rgba(46, 204, 113, 0.08); color: #2ecc71; }
.widget-card.warning .widget-icon-box { background: rgba(245, 166, 35, 0.08); color: var(--accent-color); }
.widget-card.info .widget-icon-box { background: rgba(52, 152, 219, 0.08); color: #3498db; }
.widget-card.danger .widget-icon-box { background: rgba(231, 76, 60, 0.08); color: #e74c3c; }
.widget-card.purple .widget-icon-box { background: rgba(155, 89, 182, 0.08); color: #9b59b6; }

/* --- Buttons & UI Elements --- */
.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover, .btn-primary-custom:focus {
    background-color: #0b375d;
    border-color: #0b375d;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 76, 129, 0.2);
}

.badge-custom {
    padding: 5px 10px;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* --- Tables & DataTables Styling --- */
.table-responsive-custom {
    border-radius: 10px;
    overflow: hidden;
}

.table-custom {
    width: 100% !important;
    margin-bottom: 0 !important;
}

.table-custom thead th {
    background-color: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid #edf2f7;
    padding: 12px 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-custom tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: white !important;
    border-radius: 6px;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    padding: 5px 10px;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(45, 118, 185, 0.15);
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    padding: 4px 8px;
}

/* --- Responsive Sidebar toggling --- */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1050;
        margin-left: 0 !important;
        transition: left var(--transition-speed) ease;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.15);
    }
    
    #wrapper.toggled #sidebar-wrapper {
        left: 0;
    }
    
    #page-content-wrapper {
        width: 100%;
        min-width: 100%;
        flex: 1;
    }

    /* Backdrop Overlay on Mobile when Sidebar is Open */
    #wrapper::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(9, 37, 64, 0.45);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-speed) ease;
    }
    
    #wrapper.toggled::after {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Modal Styling */
.modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.modal-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #edf2f7;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.modal-title {
    color: var(--primary-color);
    font-weight: 700;
}

.modal-footer {
    background-color: #f8fafc;
    border-top: 1px solid #edf2f7;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.form-control, .form-select {
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    border: 1px solid #dce2e6;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(45, 118, 185, 0.12);
}

/* Sidebar Collapsible Menus */
.sidebar-menu a .bi-chevron-down {
    transition: transform var(--transition-speed) ease;
}

.sidebar-menu a:not(.collapsed) .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-menu .collapse a {
    border-left: 4px solid transparent !important;
}

.sidebar-menu .collapse a.active {
    border-left-color: var(--secondary-color) !important;
    background: rgba(255, 255, 255, 0.05);
}

/* --- Public Search Page Layout --- */
.public-body {
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-navbar {
    background-color: #ffffff;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.public-navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-navbar-brand i {
    color: var(--accent-color);
    font-size: 1.4rem;
}

.public-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    padding: 3rem 0;
    text-align: center;
    box-shadow: inset 0 -10px 20px rgba(0,0,0,0.05);
}

.public-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.public-hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.public-search-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    margin-top: -2.5rem;
    background-color: #ffffff;
    z-index: 100;
    position: relative;
}

.public-search-card .card-body {
    padding: 2.5rem;
}

.public-results-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    background-color: #ffffff;
    margin-bottom: 3rem;
}

.public-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #edf2f7 !important;
}

.public-tabs::-webkit-scrollbar {
    display: none;
}

.public-tabs .nav-item {
    flex: 0 0 auto;
}

.public-tabs .nav-link {
    font-weight: 600;
    color: var(--text-light);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.public-tabs .nav-link:hover {
    color: var(--secondary-color);
    background-color: rgba(45, 118, 185, 0.05);
}

.public-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .public-navbar .navbar-brand img {
        height: 48px !important;
    }
    
    .public-navbar {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .public-search-card .card-body {
        padding: 1.5rem !important;
    }
    
    .public-results-card .card-body {
        padding: 1.25rem !important;
    }
    
    .public-hero {
        padding: 2.5rem 0 !important;
    }
    
    .public-hero img {
        height: 60px !important;
    }
    
    .public-hero h1 {
        font-size: 1.75rem !important;
    }
    
    .public-hero p {
        font-size: 0.85rem !important;
    }
    
    .table-custom thead th, 
    .table-custom tbody td {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
    }
    
    .btn-sm, .btn-sm-mobile {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
}
