/**
 * Loomis Vault - Premium Custom Styles
 * 
 * Brand colours, dark theme, glass-morphism, premium animations & component styling.
 */

/* ===== CSS Custom Properties ===== */
:root {
    --navy: #0A192F;
    --navy-light: #112240;
    --navy-lighter: #1A2F4E;
    --gold: #C8A15E;
    --gold-light: #D4B87A;
    --gold-dark: #A88542;
    --text: #E2E8F0;
    --text-muted: #8892B0;
    --border: #233554;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 4px 20px rgba(200, 161, 94, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Keyframe Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(200, 161, 94, 0.2); }
    50% { box-shadow: 0 0 20px rgba(200, 161, 94, 0.4); }
}

@keyframes pulseBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ===== Base ===== */
body {
    background: linear-gradient(160deg, var(--navy) 0%, #0D1F3C 50%, var(--navy-light) 100%);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    animation: fadeIn 0.4s ease-out;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

body > * {
    position: relative;
    z-index: 1;
}

/* Premium headings */
h1, h2, h3, .heading-serif {
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

h1 { letter-spacing: 0.02em; }

a {
    color: var(--gold);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--gold-light);
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--navy);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    border: 2px solid var(--navy);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--navy);
}

/* ===== Utility Classes ===== */
.bg-navy { background-color: var(--navy) !important; }
.bg-navy-light { background-color: var(--navy-light) !important; }
.bg-gold { background-color: var(--gold) !important; }
.text-gold { color: var(--gold) !important; }
.text-gold-light { color: var(--gold-light) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.border-gold { border-color: var(--gold) !important; }
.font-serif { font-family: var(--font-heading) !important; }

/* Glass-morphism effect */
.glass {
    background: rgba(17, 34, 64, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(200, 161, 94, 0.1);
}

.glass-strong {
    background: rgba(17, 34, 64, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 161, 94, 0.15);
}

/* Animation utilities */
.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.4s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Staggered delay utilities */
.delay-100 { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.delay-200 { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.delay-300 { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }
.delay-400 { animation-delay: 0.4s; opacity: 0; animation-fill-mode: forwards; }
.delay-500 { animation-delay: 0.5s; opacity: 0; animation-fill-mode: forwards; }

/* Gold decorative line */
.gold-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border: none;
}

.gold-line-left {
    height: 3px;
    width: 40px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border: none;
    border-radius: 2px;
}

/* ===== Sidebar ===== */
.sidebar {
    background: linear-gradient(180deg, var(--navy-light) 0%, #0E1B33 100%);
    min-height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-right: 1px solid var(--border);
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar .brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.sidebar .brand h4 {
    color: var(--gold);
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 20px rgba(200, 161, 94, 0.3);
}

.sidebar .nav-link {
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gold);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar .nav-link:hover::before,
.sidebar .nav-link.active::before {
    transform: scaleY(1);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--gold);
    background-color: rgba(200, 161, 94, 0.05);
    border-left-color: var(--gold);
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
    transition: var(--transition);
}

.sidebar .nav-link:hover i {
    transform: scale(1.1);
}

/* ===== Main Content ===== */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* ===== Cards ===== */
.card {
    background: rgba(17, 34, 64, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out forwards;
}

.card:hover {
    border-color: rgba(200, 161, 94, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(200, 161, 94, 0.08);
    transform: translateY(-2px);
}

.card-header {
    background-color: rgba(200, 161, 94, 0.05);
    border-bottom: 1px solid var(--border);
    color: var(--gold);
    font-weight: 600;
}

.card-body {
    color: var(--text);
}

/* ===== Stat Cards ===== */
.stat-card {
    background: linear-gradient(135deg, var(--navy-light) 0%, rgba(200, 161, 94, 0.05) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(200, 161, 94, 0.08) 0%, transparent 70%);
    border-radius: 0 var(--radius) 0 0;
}

.stat-card:hover {
    border-color: rgba(200, 161, 94, 0.3);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    font-family: var(--font-heading);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Forms ===== */
.form-control,
.form-select {
    background-color: var(--navy);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--navy);
    border-color: var(--gold);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(200, 161, 94, 0.12), 0 0 15px rgba(200, 161, 94, 0.05);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.4rem;
}

/* Focus accessibility ring (gold) */
*:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ===== Buttons ===== */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-color: var(--gold);
    color: var(--navy);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-gold::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-gold:hover::after {
    left: 100%;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border-color: var(--gold-light);
    color: var(--navy);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(200, 161, 94, 0.3);
}

.btn-outline-gold {
    border-color: var(--gold);
    color: var(--gold);
    transition: var(--transition);
}

.btn-outline-gold:hover {
    background-color: var(--gold);
    color: var(--navy);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(200, 161, 94, 0.2);
}

/* All buttons scale on hover */
button, .btn, [type="submit"] {
    transition: var(--transition);
    min-height: 44px;
    min-width: 44px;
}

button:hover, .btn:hover, [type="submit"]:hover {
    transform: scale(1.02);
}

button:active, .btn:active, [type="submit"]:active {
    transform: scale(0.98);
}

/* ===== Tables ===== */
.table {
    color: var(--text);
}

.table thead th {
    background-color: rgba(200, 161, 94, 0.08);
    color: var(--gold);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(200, 161, 94, 0.03);
}

/* ===== Badges ===== */
.badge-status {
    padding: 0.4em 0.8em;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending { background-color: rgba(255, 193, 7, 0.15); color: var(--warning); animation: pulseBadge 2s ease-in-out infinite; }
.badge-active { background-color: rgba(40, 167, 69, 0.15); color: var(--success); }
.badge-completed { background-color: rgba(23, 162, 184, 0.15); color: var(--info); }
.badge-cancelled { background-color: rgba(220, 53, 69, 0.15); color: var(--danger); }
.badge-in-transit { animation: pulseBadge 2s ease-in-out infinite; }

/* ===== Alerts ===== */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    animation: fadeInDown 0.4s ease-out forwards;
}

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--navy) 0%, #0D1F3C 50%, var(--navy-light) 100%);
    position: relative;
    overflow: hidden;
}

.login-card {
    background: rgba(17, 34, 64, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 161, 94, 0.15);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(200, 161, 94, 0.05);
    animation: fadeInUp 0.6s ease-out;
}

.login-card .logo {
    color: var(--gold);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    text-shadow: 0 0 30px rgba(200, 161, 94, 0.3);
    letter-spacing: 0.05em;
}

/* ===== Login Background Animation ===== */
.login-bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.login-bg-particles span {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(200, 161, 94, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.login-bg-particles span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 8s; }
.login-bg-particles span:nth-child(2) { left: 20%; top: 80%; animation-delay: 1s; animation-duration: 6s; }
.login-bg-particles span:nth-child(3) { left: 30%; top: 40%; animation-delay: 2s; animation-duration: 7s; }
.login-bg-particles span:nth-child(4) { left: 50%; top: 60%; animation-delay: 0.5s; animation-duration: 9s; }
.login-bg-particles span:nth-child(5) { left: 65%; top: 30%; animation-delay: 1.5s; animation-duration: 5s; }
.login-bg-particles span:nth-child(6) { left: 75%; top: 70%; animation-delay: 3s; animation-duration: 8s; }
.login-bg-particles span:nth-child(7) { left: 85%; top: 15%; animation-delay: 2.5s; animation-duration: 7s; }
.login-bg-particles span:nth-child(8) { left: 40%; top: 90%; animation-delay: 1s; animation-duration: 6s; }
.login-bg-particles span:nth-child(9) { left: 90%; top: 50%; animation-delay: 0s; animation-duration: 10s; }
.login-bg-particles span:nth-child(10) { left: 55%; top: 10%; animation-delay: 2s; animation-duration: 7s; }

/* Trust indicators row */
.trust-indicators {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.trust-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: rgba(200, 161, 94, 0.04);
    border: 1px solid rgba(200, 161, 94, 0.1);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.trust-indicator:hover {
    border-color: rgba(200, 161, 94, 0.25);
    background: rgba(200, 161, 94, 0.08);
}

.trust-indicator i {
    color: var(--gold);
    font-size: 0.8rem;
    width: 18px;
    text-align: center;
}

.trust-indicator span {
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

/* ===== Loading Skeleton ===== */
.skeleton {
    background: linear-gradient(90deg, var(--navy-light), var(--navy-lighter), var(--navy-light));
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-title {
    height: 20px;
    margin-bottom: 12px;
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast-item {
    pointer-events: all;
    background: rgba(17, 34, 64, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    min-width: 280px;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s ease-out forwards;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-item.removing {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-item.toast-success { border-left: 3px solid var(--success); }
.toast-item.toast-error { border-left: 3px solid var(--danger); }
.toast-item.toast-warning { border-left: 3px solid var(--warning); }
.toast-item.toast-info { border-left: 3px solid var(--info); }

/* ===== Loading Spinner ===== */
.lv-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.lv-spinner-ring {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spinSlow 0.8s linear infinite;
}

.lv-spinner-lg .lv-spinner-ring {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

/* ===== Page Header Gold Underline ===== */
.page-header-gold::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    margin-top: 0.75rem;
    border-radius: 2px;
}

/* ===== Money / Value Styling ===== */
.money-value {
    font-family: var(--font-heading);
    font-size: 1.4em;
    color: var(--gold);
    font-weight: 700;
}

/* ===== Security Badge ===== */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(200, 161, 94, 0.05);
    border: 1px solid rgba(200, 161, 94, 0.15);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.security-badge i {
    color: var(--gold);
}

/* ===== Footer ===== */
.lv-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.lv-footer-public {
    background: linear-gradient(180deg, transparent, rgba(10, 25, 47, 0.5));
    border-top: 1px solid rgba(200, 161, 94, 0.1);
    padding: 3rem 1.5rem 2rem;
    margin-top: 4rem;
}

.footer-trust-seals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-seal {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(200, 161, 94, 0.15);
    border-radius: 50px;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-seal i {
    color: var(--gold);
    font-size: 0.6rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }

    .main-content {
        margin-left: 0;
    }

    .trust-indicators {
        grid-template-columns: 1fr;
    }

    .footer-trust-seals {
        gap: 0.75rem;
    }
}

/* ===== Smooth transitions on interactive elements ===== */
input, select, textarea, button, a, .card, .stat-card, .nav-link {
    transition: var(--transition);
}
