/*
|--------------------------------------------------------------------------
| Requisition & Approval System — Custom Styles
|--------------------------------------------------------------------------
| These styles supplement Tailwind CSS for animations, custom components,
| and effects that utility classes alone can't achieve.
|
*/

/* ── Alpine.js cloak (hide elements until Alpine initializes) ────── */
[x-cloak] {
    display: none !important;
}

/* ── Smooth page transitions ──────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ── Custom scrollbar (subtle, professional) ──────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar scrollbar — subtle on dark bg */
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Animations ───────────────────────────────────────────────────── */

/* Fade in up — for page content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out both;
}

/* Staggered children animation */
.stagger-children>* {
    animation: fadeInUp 0.4s ease-out both;
}

.stagger-children>*:nth-child(1) {
    animation-delay: 0ms;
}

.stagger-children>*:nth-child(2) {
    animation-delay: 60ms;
}

.stagger-children>*:nth-child(3) {
    animation-delay: 120ms;
}

.stagger-children>*:nth-child(4) {
    animation-delay: 180ms;
}

.stagger-children>*:nth-child(5) {
    animation-delay: 240ms;
}

.stagger-children>*:nth-child(6) {
    animation-delay: 300ms;
}

/* Pulse animation for notification badges */
@keyframes pulse-soft {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* Count up animation trigger */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-count-up {
    animation: countUp 0.5s ease-out both;
}

/* Slide in from left — for sidebar on mobile */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/* ── Login page specific ──────────────────────────────────────────── */
.login-brand-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1d4ed8 100%);
}

/* Floating dots animation for login branding */
@keyframes floatDot {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.6;
    }
}

.float-dot {
    animation: floatDot 6s ease-in-out infinite;
}

.float-dot:nth-child(2) {
    animation-delay: 1s;
    animation-duration: 8s;
}

.float-dot:nth-child(3) {
    animation-delay: 2s;
    animation-duration: 7s;
}

.float-dot:nth-child(4) {
    animation-delay: 3s;
    animation-duration: 9s;
}

/* ── Form input focus enhancement ─────────────────────────────────── */
.form-input-enhanced {
    transition: all 0.2s ease;
    border: 1.5px solid #e2e8f0;
}

.form-input-enhanced:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-input-enhanced:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* ── Status badge styles ──────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* ── Workflow stepper ─────────────────────────────────────────────── */
.workflow-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.workflow-stepper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 0;
}

/* ── Card hover effect ────────────────────────────────────────────── */
.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* ── Print styles ─────────────────────────────────────────────────── */
@media print {

    /* Hide chrome */
    .no-print,
    aside,
    header,
    footer,
    .sidebar-nav,
    button:not(.print-include),
    .fixed,
    [x-show],
    nav {
        display: none !important;
    }

    /* Reset layout */
    body {
        background: white !important;
        font-size: 12pt;
        color: #000 !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
    }

    .lg\:ml-64 {
        margin-left: 0 !important;
    }

    /* Cards → plain bordered boxes */
    .bg-white,
    [class*="rounded-xl"],
    [class*="rounded-2xl"] {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
    }

    /* Status badges → plain text */
    .status-badge {
        border: 1px solid currentColor;
    }

    /* Workflow stepper → compact */
    .workflow-stepper {
        page-break-inside: avoid;
    }

    /* Force full width */
    .max-w-4xl,
    .max-w-lg {
        max-width: 100% !important;
    }

    .grid {
        display: block !important;
    }

    .grid>* {
        margin-bottom: 12pt;
    }

    /* Voucher header — injected by JS */
    .print-voucher-header {
        display: block !important;
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 8pt;
        margin-bottom: 12pt;
    }

    .print-voucher-header h1 {
        font-size: 16pt;
        font-weight: bold;
        margin: 0;
    }

    .print-voucher-header p {
        font-size: 10pt;
        color: #666;
        margin: 4pt 0 0;
    }

    /* Signature lines for print */
    .print-signature-area {
        display: flex !important;
        justify-content: space-between;
        margin-top: 40pt;
        padding-top: 8pt;
    }

    .print-signature-area>div {
        text-align: center;
        width: 30%;
    }

    .print-signature-area>div::before {
        content: '';
        display: block;
        border-top: 1px solid #000;
        margin-bottom: 4pt;
    }

    /* Avoid page breaks inside important sections */
    .page-break-avoid {
        page-break-inside: avoid;
    }

    /* Force background colors for badges */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ── Responsive table wrapper ─────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── File upload zone ─────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}