/*
 * LQC Labs LIMS Shared Stylesheet
 * Custom styles extending Bootstrap 5 - Mobile Compatible Version
 */

:root {
    --lqc-sidebar-bg: #0a192f;
    --lqc-sidebar-hover: #172a45;
    --lqc-sidebar-active: #0d6efd;
    --lqc-sidebar-text: #a8b2d1;
    --lqc-sidebar-text-active: #ffffff;
    
    --lqc-primary: #0d6efd;
    --lqc-primary-hover: #0b5ed7;
    --lqc-primary-light: rgba(13, 110, 253, 0.1);
    
    --lqc-success: #198754;
    --lqc-success-bg: rgba(25, 135, 84, 0.1);
    --lqc-warning: #ffc107;
    --lqc-warning-bg: rgba(255, 193, 7, 0.1);
    --lqc-danger: #dc3545;
    --lqc-danger-bg: rgba(220, 53, 69, 0.1);
    --lqc-info: #0dcaf0;
    --lqc-info-bg: rgba(13, 202, 240, 0.1);
    
    --lqc-body-bg: #f3f4f6;
    --lqc-card-bg: #ffffff;
    --lqc-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    --lqc-card-border: 1px solid rgba(229, 231, 235, 0.8);
    --lqc-border-radius: 12px;
    
    --font-heading: Monospace,'Outfit', sans-serif;
    --font-body: Monospace,'Inter', JetBrainsMono,sans-serif;
}

@font-face {
  font-family: JetBrainsMono; /* set name */
  src: url(/fonts/webfonts/JetBrainsMono-Regular.woff2); /* url of the font */
}
@font-face {
  font-family: Monospace; /* set name */
  src: url(/fonts/Monospace.ttf); /* url of the font */
}



body {
    font-family: var(--font-body);
    background-color: var(--lqc-body-bg);
    color: #1f2937;
    font-size: 0.9rem;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--lqc-sidebar-bg);
    color: var(--lqc-sidebar-text);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    z-index: 1040;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar .brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .brand img {
    height: 38px;
    transition: margin 0.3s;
}

.sidebar.collapsed .brand img {
    margin-right: 0 !important;
}

.sidebar .brand-title {
    font-family: var(--font-heading);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1;
    transition: opacity 0.3s;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .brand-subtitle,
.sidebar.collapsed .menu-category-title,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .submenu-icon,
.sidebar.collapsed .sidebar-footer-card {
    display: none !important;
}

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

.sidebar .menu-category {
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--lqc-sidebar-text);
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: var(--lqc-sidebar-text-active);
    background-color: var(--lqc-sidebar-hover);
}

.sidebar .nav-link.active {
    color: var(--lqc-sidebar-text-active);
    background-color: var(--lqc-sidebar-hover);
    border-left-color: var(--lqc-sidebar-active);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

/* Sidebar Submenus */
.sidebar .submenu {
    background-color: rgba(0, 0, 0, 0.15);
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sidebar .submenu.show {
    max-height: 500px;
}

.sidebar .submenu-item a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem 0.5rem 2.75rem;
    color: var(--lqc-sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.sidebar .submenu-item a:hover,
.sidebar .submenu-item.active a {
    color: var(--lqc-sidebar-text-active);
    background-color: var(--lqc-sidebar-hover);
}

/* Main Content Area */
.main-layout {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    /*height: 100vh;*/
    overflow-y: auto;
    background-color: var(--lqc-body-bg);
}

/* Navbar */
.lqc-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 99;
}

/* Cards & Content */
.lqc-card {
    background-color: var(--lqc-card-bg);
    border: var(--lqc-card-border);
    border-radius: var(--lqc-border-radius);
    box-shadow: var(--lqc-card-shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lqc-card.hover-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Glassmorphic Styles */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--lqc-border-radius);
}

/* Steps progress indicator */
.step-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
}

.step-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e5e7eb;
    z-index: 1;
    transform: translateY(-50%);
}

.step-item {
    position: relative;
    z-index: 2;
    background-color: var(--lqc-body-bg);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.step-item.active .step-badge {
    background-color: var(--lqc-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}

.step-item.completed .step-badge {
    background-color: var(--lqc-success);
    color: #ffffff;
}

.step-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.step-subtitle {
    font-size: 0.7rem;
    color: #6b7280;
}

/* Tables Custom Styling */
.lqc-table th {
    background-color: #f8fafc;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475569;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.lqc-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.85rem;
}

/* Badges */
.badge-active, .badge-approved, .badge-pass {
    background-color: var(--lqc-success-bg);
    color: var(--lqc-success);
    border: 1px solid rgba(25, 135, 84, 0.2);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-pending, .badge-draft {
    background-color: var(--lqc-warning-bg);
    color: #b58200;
    border: 1px solid rgba(255, 193, 7, 0.2);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-rejected, .badge-fail, .badge-inactive {
    background-color: var(--lqc-danger-bg);
    color: var(--lqc-danger);
    border: 1px solid rgba(220, 53, 69, 0.2);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-progress {
    background-color: var(--lqc-info-bg);
    color: #0b8098;
    border: 1px solid rgba(13, 202, 240, 0.2);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Right slide-out drawer */
.drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer.open {
    right: 0;
}

.drawer-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* Custom Responsive Columns (to replace hardcoded width:20% and avoid squeezing on mobile) */
.col-xl-2-4 {
    width: 20%;
}

/* Mobile Sidebar Backdrop overlay */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1030;
    display: none;
}
.sidebar-backdrop.show {
    display: block;
}

/* Media Queries for Mobile Compatibility */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        height: 100vh;
        width: 260px;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    }
    .sidebar.mobile-show {
        left: 0;
    }
    .sidebar.collapsed {
        left: -260px;
        width: 260px;
    }
    
    .col-xl-2-4 {
        width: 50% !important; /* Stack them as two per row on medium screens */
    }

    /* Split screen page observationAndCaulcation responsive rules */
    .split-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .split-panel-left, .split-panel-right {
        flex: none !important;
        width: 100% !important;
        height: auto !important;
        overflow-y: visible !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb;
        padding: 1.25rem !important;
    }
    
    /* Make Multi-step progress bar responsive */
    .step-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 0 1rem;
    }
    .step-container::before {
        display: none;
    }
    .step-item {
        background-color: transparent !important;
        padding: 0 !important;
        width: 100%;
    }
}

@media (max-width: 575px) {
    .col-xl-2-4 {
        width: 100% !important; /* Stack single column on small screens */
    }
    .drawer {
        width: 100vw;
        right: -100vw;
    }
    .coa-document {
        padding: 1.5rem !important;
    }
}

/* Print Styling for Certificates (COA) */
@media print {
    body {
        background-color: #ffffff !important;
        font-size: 11pt !important;
        color: #000000 !important;
    }
    
    .sidebar,
    .lqc-navbar,
    .btn,
    .no-print,
    footer,
    .breadcrumb,
    .drawer,
    .sidebar-backdrop {
        display: none !important;
    }
    
    .main-layout {
        height: auto !important;
        overflow: visible !important;
        background-color: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .print-container {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .print-card {
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background-color: #ffffff !important;
    }

    .badge-pass {
        color: #000000 !important;
        border: 1px solid #000000 !important;
        background-color: transparent !important;
    }
}
