/* Global styling overrides */
body {
    font-family: 'Inter', sans-serif;
}

/* Card entrance animation */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card-in { animation: cardIn 0.3s ease-out both; }

/* Active sidebar link indicator */
.sidebar-active {
    position: relative;
    background-color: #f0f5fa;
    color: #162f4a;
}
.sidebar-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: #1B3A5C;
    border-radius: 0 3px 3px 0;
}

/* Status Badge Chips */
.chip-waiting {
    background-color: #fef3c7;
    color: #92400e;
}
.chip-in-plant {
    background-color: #dbeafe;
    color: #1e40af;
}
.chip-loading {
    background-color: #e0e7ff;
    color: #3730a3;
}
.chip-completed {
    background-color: #dcfce7;
    color: #166534;
}
.chip-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Autocomplete suggestion dropdown */
.autocomplete-suggestions {
    position: absolute;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.autocomplete-suggestion {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.autocomplete-suggestion:hover,
.autocomplete-suggestion.active {
    background-color: #f3f4f6;
    color: #111827;
}

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

/* ── Dark Mode Scrollbar ── */
html.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
html.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── Auth Background Animations ── */
.bg-animated {
    background: #090d18ff;
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

.dark .bg-animated {
    --bg-gradient-1: #090d18ff;
    --bg-gradient-2: #161f3aff;
    --bg-gradient-3: #090d18ff;
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.dark .login-card {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatA {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-18px) rotate(6deg); }
}

@keyframes floatB {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(14px) rotate(-4deg); }
}

.float-a { animation: floatA 7s ease-in-out infinite; }
.float-b { animation: floatB 9s ease-in-out infinite; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease-out both; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease; }

/* Strength bar transition */
#strength-bar {
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* ── Print Media Queries ── */
@media print {
    /* 1. Force the browser to print background colors and images */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 2. Break out of any flex/h-screen constraints that clip the page */
    html, body, #main-content, main, .min-h-screen, .h-screen {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        display: block !important;
        background-color: white !important; /* Force white bg for paper */
    }

    /* 3. Ensure tables expand and page breaks nicely */
    table {
        width: 100% !important;
        table-layout: fixed !important;
        page-break-inside: auto !important;
    }
    tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }
    td, th {
        word-wrap: break-word !important;
    }

    /* 4. Hide interactive elements */
    button, .no-print, header, #sidebar, #sidebar-overlay, .print\:hidden {
        display: none !important;
    }

    #main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tab-content {
        display: block !important;
        page-break-after: always;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* ── Sidebar & layout shell ─────────────────────────────── */

/* IDs used by sidebar toggle buttons (legacy, keep hidden by default) */
#sidebar-toggle,
#sidebar-close {
    display: none;
}

/* Bulletproof Intranet Logos */
.company-logo {
    filter: brightness(1);
    opacity: 0.8;
    transition: opacity 0.3s ease, filter 0.3s ease;
}
.company-logo:hover {
    opacity: 0.9;
}
html.dark .company-logo {
    filter: brightness(0) invert(1) !important;
    opacity: 0.7 !important;
}
html.dark .company-logo:hover {
    opacity: 0.8 !important;
}
