/* 
    Home Page Styles for Marco Marine Service
    Refactored from index.php
*/

body {
    font-family: var(--font-body);
    background-color: var(--surface);
    color: var(--on-surface);
}

h1,
h2,
h3,
.branding-text {
    font-family: var(--font-display);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

.branding-header {
    background: #fff;
    border-bottom: 1px solid rgba(224, 227, 230, 0.3);
    padding: 24px 0;
    text-align: center;
}

.branding-logo-text {
    font-size: 36px;
    font-weight: 900;
    color: var(--primary);
    text-transform: lowercase;
    letter-spacing: -0.05em;
}

.branding-tagline {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--on-surface-variant);
    margin: 4px 0 12px;
}

.branding-subtitle {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    border-top: 1px solid rgba(224, 227, 230, 0.5);
    display: inline-block;
    padding-top: 12px;
}

/* Improved Sidebar */
#customer_sidebar {
    background: #fff;
    border-right: 1px solid rgba(224, 227, 230, 0.3);
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    padding-top: 0; /* Header takes care of padding */
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    background: var(--surface-container-low);
    padding: 12px 24px;
    border-bottom: 1px solid rgba(224, 227, 230, 0.3);
    margin-bottom: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 24px;
    font-size: 12px;
    transition: all 0.2s;
    cursor: pointer;
    color: var(--on-surface-variant);
    text-decoration: none;
    line-height: 1.5;
}

.sidebar-item:hover {
    background: var(--surface-container-low);
    color: var(--primary);
}

.sidebar-item.active {
    background: var(--surface-container-low);
    font-weight: 700;
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-group-label {
    padding: 16px 24px 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    opacity: 0.8;
}

/* Dashboard Header Area */
.dashboard-header {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    position: sticky;
    top: var(--nav-height);
    z-index: 1010;
    padding-top: var(--spacing-4);
    padding-bottom: var(--spacing-4);
    margin-bottom: var(--spacing-6);
    border-bottom: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-header.is-sticky {
    border-bottom: 1px solid var(--surface-container-high);
    padding-top: var(--spacing-3);
    padding-bottom: var(--spacing-3);
    box-shadow: var(--shadow-low);
    background: var(--surface);
}

.dashboard-header .title-area {
    flex: 0 0 auto;
    min-width: 250px;
}

/* Header Controls Wrapper */
.header-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Reduced from 12px to bring archive summary closer */
    min-width: 450px;
    background: transparent;
}

/* Status Bar */
.status-filter-bar {
    display: flex;
    border: 1px solid rgba(224, 227, 230, 0.5);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.status-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 16px;
    /* Reduced from 12px 24px for a 'shorter' bar */
    min-width: 100px;
    font-size: 11px;
    font-weight: 600;
    color: var(--on-surface-variant);
    border-left: 1px solid rgba(224, 227, 230, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.status-btn:first-child {
    border-left: none;
}

.status-btn.active {
    background: var(--status-cyan);
    color: #fff;
    font-weight: 700;
}

.status-btn .count {
    opacity: 0.6;
    font-size: 9px;
    font-weight: 700;
}

.status-btn.active .count {
    opacity: 1;
}

/* Archive Summary integration */
#archive_summary {
    display: flex;
    align-items: center;
    padding: 4px 0;
    margin-bottom: 0 !important;
    font-size: 11px;
    font-weight: 400;
    color: var(--on-surface-variant);
    background: transparent;
    border: none;
}

#archive_summary .material-symbols-outlined {
    font-size: 16px;
}

/* Table refinements */
.job-table-container {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(224, 227, 230, 0.5);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.table thead th {
    background: var(--surface-container-low) !important;
    border-bottom: 1px solid rgba(224, 227, 230, 0.5);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 12px 16px !important;
}

.table tbody tr:hover {
    background: rgba(242, 244, 247, 0.5);
}

.table td {
    padding: 10px 16px !important;
    vertical-align: middle;
    border-bottom: 1px solid rgba(224, 227, 230, 0.2);
    transition: background 0.2s ease;
}

#job_list tbody {
    transition: opacity 0.3s ease;
}


/* Progress Column */
.progress-column {
    vertical-align: stretch !important;
    height: 1px;
    /* Allows inner h-100 to fill row height */
}

.progress-column .d-flex {
    min-height: 48px;
    /* Ensure a decent height if the row is thin */
}

.progress-column .flex-fill {
    transition: all 0.2s ease;
    cursor: default;
}

.progress-column .flex-fill:hover {
    filter: brightness(0.95);
}

.progress-column .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
    opacity: 0.8;
}

.progress-column .opacity-50 {
    opacity: 0.3 !important;
}

.progress-column .border-light {
    border-color: rgba(0, 0, 0, 0.05) !important;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e0e3e6;
    border-radius: 10px;
}

/* Loading Overlay */
#loading-overlay {
    position: absolute;
    top: 48px; /* Below the table header */
    left: 0;
    width: 100%;
    height: calc(100% - 48px);
    background: rgba(255, 255, 255, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--surface-container-highest);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}