@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #ae0b0b;
    /* CRDB Maroon */
    --primary-hover: #8e0909;
    --secondary-color: #0f172a;
    /* Deep Navy/Black */
    --accent-color: #d4af37;
    /* Gold */
    --accent-hover: #b8962d;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Header & Nav */
nav {
    background: var(--white);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #edf2f7;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Forms */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control,
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: var(--transition);
    background: #ffffff;
    font-size: 0.95rem;
}

.form-control:focus,
.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(174, 11, 11, 0.1);
    background: #fff;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f3f4f6;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    vertical-align: middle;
}

tr:hover {
    background-color: #f9fafb;
}

/* Branding */
.logo-img {
    height: 40px;
    width: auto;
}

.hero-bg {
    background: var(--secondary-color);
    position: relative;
    background-image: url('../img/hero-ship.png');
    background-size: cover;
    background-position: center 20%;
    background-attachment: fixed;
}

.premium-glass {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-premium);
}

.gold-gradient-text {
    background: linear-gradient(to right, #d4af37, #f3e5ab);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: var(--secondary-color);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.status-in-china {
    background: #f1f5f9;
    color: #475569;
    border-left: 3px solid #64748b;
}

.status-shipped {
    background: #fef9c3;
    color: #854d0e;
    border-left: 3px solid #eab308;
}

.status-in-transit {
    background: #e0f2fe;
    color: #0369a1;
    border-left: 3px solid #0ea5e9;
}

.status-at-port {
    background: #fae8ff;
    color: #86198f;
    border-left: 3px solid #d946ef;
}

.status-customs {
    background: #ffedd5;
    color: #9a3412;
    border-left: 3px solid #f97316;
}

.status-ready {
    background: #dcfce7;
    color: #166534;
    border-left: 3px solid #22c55e;
}

.status-collected {
    background: #f3f4f6;
    color: #374151;
    border-left: 3px solid #9ca3af;
}

.status-delayed {
    background: #fee2e2;
    color: #991b1b;
    border-left: 3px solid #ef4444;
}

.day-critical {
    color: #ae0b0b;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(174, 11, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(174, 11, 11, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(174, 11, 11, 0);
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 1s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

/* Timeline Refinements */
.timeline-icon-pending {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
}

.timeline-icon-completed {
    background: var(--accent-color);
    color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.timeline-icon-current {
    background: var(--accent-color);
    color: var(--secondary-color);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
    animation: currentPulse 2s infinite;
}

@keyframes currentPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
        transform: scale(1);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
        transform: scale(1);
    }
}

/* Flying Planes Animation */
.plane-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

.plane {
    position: absolute;
    color: var(--accent-color);
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
    font-size: 2.5rem;
    left: -150px;
    opacity: 0;
    z-index: 15;
    /* Point the nose in the flight direction */
    transform: rotate(90deg);
}

.plane-1 {
    top: 15%;
    animation: flyAcross 20s linear infinite;
    opacity: 0.4;
}

.plane-2 {
    top: 35%;
    animation: flyAcross 25s linear infinite 8s;
    opacity: 0.3;
}

.plane-3 {
    top: 60%;
    animation: flyAcross 22s linear infinite 12s;
    opacity: 0.2;
}

@keyframes flyAcross {
    0% {
        left: -150px;
        opacity: 0;
        transform: translateY(0) rotate(90deg) scale(0.8);
    }

    10% {
        opacity: 0.5;
    }

    50% {
        transform: translateY(-40px) rotate(85deg) scale(1.1);
        opacity: 0.6;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        left: 120%;
        opacity: 0;
        transform: translateY(20px) rotate(95deg) scale(0.8);
    }
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-scale:hover {
    transform: scale(1.03);
}

.no-shadow {
    box-shadow: none !important;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}