/* ==========================================================================
   SATRIA 360° - CSS Premium Design System
   ========================================================================== */

:root {
    --primary-green: #024731;
    --dark-green: #012b1e;
    --accent-gold: #D4AF37;
    --light-gold: #ffdf7a;
    --bg-light: #f8fafc;
    --border-light: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    
    /* Animation speed */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

/* ==========================================================================
   App Layout Grid
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--dark-green) 0%, #035239 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
}

/* ==========================================================================
   Sidebar Styles
   ========================================================================== */
.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-box {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
}

.logo-icon {
    width: 22px;
    height: 22px;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 1px;
    background: linear-gradient(to right, #ffffff, var(--light-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item i {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.nav-item.active {
    background: var(--primary-green);
    color: #ffffff;
    font-weight: 600;
    border-left: 4px solid var(--accent-gold);
    box-shadow: 0 4px 12px rgba(2, 71, 49, 0.3);
}

.nav-item.active i {
    color: var(--accent-gold);
    opacity: 1;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 0;
}

.disabled-link {
    cursor: not-allowed;
    opacity: 0.4;
}

.disabled-link:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1) !important;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 2rem;
    min-height: 70px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background-color: var(--border-light);
    color: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-green);
}

/* ==========================================================================
   Dashboard Components
   ========================================================================== */
.section-title-banner {
    background: linear-gradient(90deg, var(--primary-green) 0%, #035b3e 100%);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(2, 71, 49, 0.15);
    text-transform: uppercase;
}

.section-title-banner-sub {
    border-radius: 8px 8px 0 0;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.bg-dark-green {
    background-color: var(--primary-green) !important;
}

/* Stats Card Custom styling */
.stat-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background-color: #ffffff;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
}

.stat-value {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 22px;
    height: 22px;
}

.legend-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ==========================================================================
   Interactive Data Table
   ========================================================================== */
.custom-reports-table {
    border-collapse: separate;
    border-spacing: 0 6px;
}

.custom-reports-table thead th {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

.custom-reports-table tbody tr {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.custom-reports-table tbody td {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.custom-reports-table tbody td:first-child {
    border-left: 1px solid var(--border-light);
    border-radius: 8px 0 0 8px;
}

.custom-reports-table tbody td:last-child {
    border-right: 1px solid var(--border-light);
    border-radius: 0 8px 8px 0;
}

.custom-reports-table tbody tr:hover {
    background-color: #f1f5f9;
    transform: scale(1.005);
}

.custom-reports-table tbody tr.active-row {
    background-color: rgba(2, 71, 49, 0.04);
}

.custom-reports-table tbody tr.active-row td {
    border-color: rgba(2, 71, 49, 0.2);
}

/* ==========================================================================
   Detail Panel Dokumentasi (Before/After)
   ========================================================================== */
.doc-image-box {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-dark-green {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: #ffffff;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-dark-green:hover {
    background-color: #013625;
    border-color: #013625;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 71, 49, 0.2);
}

/* ==========================================================================
   Workflow Steps UI (Alur Kerja)
   ========================================================================== */
.workflow-timeline-wrapper {
    position: relative;
    padding: 2rem 0;
}

.workflow-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 4px;
    background-color: var(--border-light);
    transform: translateY(-50%);
    z-index: 1;
    display: none; /* Hide on mobile by default */
}

.workflow-step-card {
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    z-index: 3;
}

.workflow-step-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--primary-green);
}

.workflow-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workflow-icon i {
    width: 22px;
    height: 22px;
}

/* Deskripsi Alur Line on larger screen sizes */
@media (min-width: 992px) {
    .workflow-line {
        display: block;
    }
}

/* ==========================================================================
   Footer Styling
   ========================================================================== */
.app-footer {
    background-color: var(--dark-green);
    color: #ffffff;
    border-top: 4px solid var(--accent-gold);
    margin-top: auto;
}

.benefit-item {
    font-size: 0.85rem;
}

.benefit-icon {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--accent-gold);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.benefit-icon i {
    width: 16px;
    height: 16px;
}

.benefit-text {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.italic-slogan {
    font-family: 'Montserrat', sans-serif;
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Map Popup customization
   ========================================================================== */
.leaflet-popup-content-wrapper {
    font-family: 'Plus Jakarta Sans', sans-serif;
    border-radius: 8px;
    padding: 2px;
}

.leaflet-popup-content h6 {
    margin-top: 0;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--primary-green);
}

/* ==========================================================================
   Print Layout (PDF Generation template)
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    #printTemplate, #printTemplate * {
        visibility: visible;
    }
    #printTemplate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
    }
    .d-none {
        display: block !important;
    }
}

/* ==========================================================================
   Mobile responsiveness
   ========================================================================== */
@media (max-width: 991.98px) {
    .app-container {
        flex-direction: column;
    }
    
    /* Off-canvas mobile sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px; /* Slide off-screen initially */
        width: 260px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.25);
    }
    
    .sidebar-mobile-open .sidebar {
        left: 0;
    }
    
    .sidebar-header {
        padding: 1.25rem 1.5rem;
    }
    
    .sidebar-nav {
        padding: 1rem;
    }
    
    /* Stack links vertically on mobile off-canvas */
    .sidebar-nav ul {
        flex-direction: column;
        gap: 6px;
    }
    
    .sidebar-nav ul li {
        width: 100%;
        flex-grow: 0;
    }
    
    .nav-item {
        padding: 0.8rem 1rem;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .main-content {
        max-height: none;
        width: 100vw;
    }
    
    .main-header {
        padding: 1rem;
    }
}

/* Sidebar mobile backdrop overlay style */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(1, 43, 30, 0.4);
    backdrop-filter: blur(3px);
    z-index: 1040;
    display: none;
    transition: opacity 0.3s ease;
}

.sidebar-mobile-open .sidebar-backdrop {
    display: block;
}
.cursor-pointer {
    cursor: pointer;
}
.border-dashed {
    border-style: dashed !important;
}
.disabled-link {
    pointer-events: none;
}

/* Collapsible Sidebar Styles for Desktop */
@media (min-width: 992px) {
    .sidebar {
        transition: width 0.3s ease;
    }
    
    .sidebar-collapsed .sidebar {
        width: 70px;
    }
    
    .sidebar-collapsed .sidebar .brand-info,
    .sidebar-collapsed .sidebar .sidebar-nav span {
        display: none;
    }
    
    .sidebar-collapsed .sidebar .sidebar-header {
        padding: 1.5rem 0.5rem;
        justify-content: center;
    }
    
    .sidebar-collapsed .sidebar .sidebar-nav {
        padding: 1rem 0.5rem;
    }
    
    .sidebar-collapsed .sidebar .nav-item {
        justify-content: center;
        padding: 0.8rem 0;
        gap: 0;
    }
    
    .sidebar-collapsed .sidebar .nav-item i {
        margin: 0;
    }
    
    .sidebar-collapsed .sidebar .logo-box {
        margin: 0;
    }
}
