/* File: secr_pms/public/assets/css/style.css */
/* Purpose: Custom stylesheets for the application. */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9; /* Light gray for overall page background */
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles - Light Theme */
.sidebar-wrapper {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #ffffff; /* White sidebar */
    color: #333; /* Dark text color for sidebar */
    border-right: 1px solid #dee2e6; /* Light border */
    transition: margin-left 0.3s ease-in-out, left 0.3s ease-in-out, width 0.3s ease-in-out;
    z-index: 1030;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    font-weight: bold;
    border-bottom: 1px solid #dee2e6; /* Light border */
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-brand a {
    color: #212529 !important;
}
.sidebar-brand a:hover {
    color: #0d6efd !important;
}

.sidebar-nav {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

/* NEW: Sidebar Header Styling */
.sidebar-header {
    padding: 0.85rem 1.25rem;
    font-size: 0.8em;
    font-weight: 600;
    color: #6c757d; /* A muted gray color */
    text-transform: uppercase;
    letter-spacing: .5px;
    background-color: #f8f9fa; /* A very light background to distinguish it */
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    margin-top: 0.5rem;
}

.sidebar-item {
    position: relative;
}

.sidebar-link {
    display: block;
    padding: 0.85rem 1.25rem;
    color: #495057;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover,
.sidebar-item.active .sidebar-link {
    background-color: #e9ecef;
    color: #0d6efd;
    border-left-color: #0d6efd;
}
.sidebar-item.active .sidebar-link {
    font-weight: 500;
}


.sidebar-link .fa-angle-down {
    float: right;
    transition: transform 0.3s ease;
}
.sidebar-link.collapsed .fa-angle-down {
    transform: rotate(-90deg);
}
.sidebar-link[aria-expanded="true"] .fa-angle-down {
    transform: rotate(0deg);
}

.sidebar-submenu {
    background-color: #f8f9fa;
    padding-left: 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    list-style: none;
}

.sidebar-link.has-dropdown[aria-expanded="true"] + .sidebar-submenu {
    max-height: 1100px;
}

.sidebar-submenu .sidebar-link {
    padding: 0.65rem 1.25rem 0.65rem 1.5rem;
    font-size: 0.9em;
    color: #5a6268;
}
.sidebar-submenu .sidebar-link:hover {
    background-color: #e0e5e9;
    color: #0056b3;
}


.sidebar-divider {
    margin: 0.5rem 1rem;
    border-top: 1px solid #dee2e6;
}

/* Main Content Wrapper Styles */
.main-content-wrapper {
    flex-grow: 1;
    padding-left: 260px;
    transition: padding-left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
}

.main-navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    background-color: #ffffff !important;
}

.main-content-wrapper > main.container-fluid {
    flex-grow: 1;
}

.main-footer {
   background-color: #ffffff;
   border-top: 1px solid #dee2e6 !important;
}


/* Responsive adjustments for sidebar */
@media (max-width: 991.98px) {
    .sidebar-wrapper {
        margin-left: -260px;
    }
    .sidebar-wrapper.active {
        margin-left: 0;
    }
    .main-content-wrapper {
        padding-left: 0;
        width: 100%;
    }
}

/* Styles for when sidebar is collapsed (Desktop) */
body.sidebar-collapsed .sidebar-wrapper {
    width: 80px;
    min-width: 80px;
}
body.sidebar-collapsed .sidebar-wrapper .sidebar-brand span,
body.sidebar-collapsed .sidebar-wrapper .sidebar-nav .align-middle,
body.sidebar-collapsed .sidebar-wrapper .sidebar-link .fa-angle-down {
    display: none;
}
body.sidebar-collapsed .sidebar-wrapper .sidebar-brand .fa-train {
    margin-right: 0 !important;
}
body.sidebar-collapsed .sidebar-wrapper .sidebar-link {
    text-align: center;
}
body.sidebar-collapsed .sidebar-wrapper .sidebar-link i {
    margin-right: 0 !important;
    font-size: 1.2rem;
}
body.sidebar-collapsed .main-content-wrapper {
    padding-left: 80px;
    width: calc(100% - 80px);
}

body.sidebar-collapsed .sidebar-wrapper .sidebar-item .sidebar-submenu {
    position: absolute;
    left: 80px;
    top: 0;
    width: 200px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.1);
    z-index: 1031;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}
body.sidebar-collapsed .sidebar-wrapper .sidebar-item:hover > .sidebar-submenu {
     max-height: 500px;
}
body.sidebar-collapsed .sidebar-wrapper .sidebar-submenu .sidebar-link {
    text-align: left;
    display: block;
}
body.sidebar-collapsed .sidebar-wrapper .sidebar-submenu .sidebar-link i {
    font-size: 1em;
    margin-right: 0.5rem !important;
}


/* Status-specific styling for badges */
.badge[class*="status-"] {
    font-size: 0.8em;
    padding: 0.4em 0.7em;
    font-weight: 500;
}

.status-planning-bg { background-color: #0dcaf0 !important; color: black; }
.status-survey-stage-bg { background-color: #6c757d !important; color: white; }
.status-dpr-stage-bg { background-color: #adb5bd !important; color: black; }
.status-dpr-finalised-bg { background-color: #7952b3 !important; color: white; }
.status-sanctioned-bg { background-color: #96bf73 !important; color: white; }
.status-not-sanctioned-bg { background-color: #fd7e14 !important; color: white; }
.status-tender-stage-bg { background-color: #20c997 !important; color: white; }
.status-in-progress-bg { background-color: #ffc107 !important; color: black; }
.status-on-hold-bg { background-color: #6c757d !important; color: white; }
.status-completed-bg { background-color: #198754 !important; color: white; }
.status-cancelled-bg { background-color: #dc3545 !important; color: white; }


.card-header-actions .btn {
    margin-left: 0.5rem;
}

.footer {
    font-size: 0.9em;
}

.progress {
    font-size: 0.85rem;
    height: 22px;
}
.progress-bar {
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}

/* General card styling */
.card {
    border: 1px solid #e0e0e0;
}
.card-header.bg-light {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #e0e0e0;
}

/* --- Print-specific Styles --- */
@media print {
    /* Hide elements that are not part of the report content */
    .sidebar-wrapper,
    .main-navbar,
    .no-print, /* Hides any element with this class */
    .main-footer {
        display: none !important;
    }

    /* Ensure the main content takes up the full page width when printing */
    .main-content-wrapper {
        padding-left: 0 !important;
        width: 100% !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }

    .col-lg-5, .col-lg-7 {
        width: 50% !important;
        flex: 0 0 auto;
        float: left;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    body {
        background-color: #fff;
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }
}
