@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #09294c;
    --primary-light: #0e5ed1;
    --primary-lighter: #1872f4;
    --accent: #18c4a5;
    --accent-hover: #14ac8e;
    --bg-dark: #050d1d;
    --bg-card: rgba(8, 17, 35, 0.8);
    --bg-card-solid: #07112b;
    --text: #f8fafc;
    --text-muted: #9bb7d3;
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(24, 196, 165, 0.35);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --font: 'Outfit', sans-serif;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(8, 17, 35, 0.55);
    --glass-border: rgba(24, 196, 165, 0.08);
}

/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(24, 196, 165, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(14, 94, 209, 0.10) 0%, transparent 45%);
    background-attachment: fixed;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

button, input, select, textarea {
    font-family: var(--font);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(24, 196, 165, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(24, 196, 165, 0); }
    100% { box-shadow: 0 0 0 0 rgba(24, 196, 165, 0); }
}

.animate-fade {
    animation: fadeIn 0.6s ease forwards;
}

/* Layout Elements */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

/* Navbar */
.navbar {
    background-color: rgba(7, 10, 18, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-btn {
    background-color: var(--accent);
    color: white;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.nav-btn:hover {
    background-color: var(--accent-hover);
    color: white;
    transform: translateY(-2px);
}

.nav-btn-outline {
    border: 1px solid var(--border);
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.nav-btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px var(--accent);
}

.btn-secondary {
    background-color: var(--primary-lighter);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background-color: var(--accent);
    color: white;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(24, 196, 165, 0.2);
    transform: translateY(-5px);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24, 196, 165, 0.15);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

/* Alert Boxes */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    border-color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fde68a;
    border-color: var(--warning);
}

/* Auth Pages Style */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 160px);
    padding: 40px 0;
}

.auth-card {
    width: 100%;
    max-width: 500px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
}

/* Admin Dashboard layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background-color: var(--bg-card-solid);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    background-color: var(--primary-light);
    color: var(--text);
}

.sidebar-menu li.active a {
    border-left: 3px solid var(--accent);
    background-color: rgba(24, 196, 165, 0.08);
    color: var(--accent);
}

.admin-body {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    min-height: 100vh;
}

.admin-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.admin-navbar h1 {
    font-size: 28px;
    font-weight: 700;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Grid & Dashboard Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-title {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background-color: rgba(24, 196, 165, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Data Tables */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 40px;
}

.table-header-bar {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header-bar h3 {
    font-size: 18px;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: rgba(15, 23, 42, 0.4);
    padding: 16px 24px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    color: var(--text);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.badge-info { background: rgba(6, 182, 212, 0.1); color: #22d3ee; }
.badge-neutral { background: rgba(148, 163, 184, 0.1); color: #cbd5e1; }

/* Grid systems */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* =====================================================
   HAMBURGER / MOBILE NAV TOGGLE
   ===================================================== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    backdrop-filter: blur(4px);
}

.mobile-nav-overlay.open { display: block; }

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: var(--bg-card-solid);
    border-left: 1px solid var(--border);
    z-index: 1100;
    padding: 80px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-drawer.open { right: 0; }

.mobile-nav-drawer a {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.mobile-nav-drawer a:last-child { border-bottom: none; }

.mobile-nav-drawer a:hover {
    background-color: rgba(24, 196, 165, 0.1);
    color: var(--accent);
    padding-left: 22px;
}

.mobile-nav-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-nav-actions a, .mobile-nav-actions button {
    display: block;
    text-align: center;
    padding: 13px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

/* =====================================================
   TABLET  (≤ 1024px)
   ===================================================== */
@media (max-width: 1024px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }

    /* Shrink sidebar to icon-only */
    .admin-sidebar { width: 80px; }
    .admin-sidebar span { display: none; }
    .admin-body { margin-left: 80px; }
    .sidebar-header h2 { display: none; }

    /* Collapse some nav links */
    .nav-links { gap: 20px; }
    .nav-links li a { font-size: 14px; }
}

/* =====================================================
   MOBILE  (≤ 768px)
   ===================================================== */
@media (max-width: 768px) {
    /* Grids */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    /* Section padding */
    .section { padding: 50px 0; }
    .container { padding: 0 16px; }

    /* Navbar */
    .navbar { padding: 12px 0; }
    .nav-links { display: none; }          /* hidden — use mobile drawer */
    .navbar .container > div:last-child { display: none; } /* hide desktop auth btns */
    .hamburger { display: flex; }

    /* Admin / Portal sidebar */
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        overflow-x: auto;
        padding: 0;
    }
    .sidebar-header { padding: 14px 16px; flex-shrink: 0; }
    .sidebar-menu {
        flex-direction: row;
        padding: 8px 12px;
        gap: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .sidebar-menu li { flex-shrink: 0; }
    .sidebar-menu a { padding: 10px 14px; font-size: 13px; }
    .sidebar-menu a span { display: inline; }
    .admin-body { margin-left: 0; padding: 20px 16px; }
    .admin-navbar { flex-direction: column; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
    .admin-navbar h1 { font-size: 22px; }

    /* Metric cards */
    .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .metric-value { font-size: 24px; }

    /* Table scrollable */
    .table-wrapper { overflow-x: auto; }
    .data-table { min-width: 600px; }
    .table-header-bar { flex-direction: column; gap: 12px; align-items: flex-start; }

    /* Footer */
    .footer { padding: 40px 0 24px 0; margin-top: 50px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .footer-bottom div { justify-content: center; }

    /* Auth pages */
    .auth-wrapper { padding: 24px 0; }

    /* Glass cards */
    .glass-card { padding: 20px; }
}

/* =====================================================
   SMALL MOBILE  (≤ 480px)
   ===================================================== */
@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .metric-value { font-size: 28px; }
    .btn { padding: 11px 20px; font-size: 14px; }
    .section { padding: 36px 0; }
}

/* FAQ Accordion */
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.faq-question {
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--accent);
}

.faq-answer {
    padding-top: 12px;
    color: var(--text-muted);
    font-size: 15px;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Frontend Footer */
.footer {
    background-color: var(--primary);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
}

.footer-col p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* =====================================================
   PAGE-LEVEL MOBILE OVERRIDES
   Handles inline-styled elements across blade templates
   ===================================================== */
@media (max-width: 768px) {
    /* Scale down large inline page headings */
    .section h1[style*="font-size: 44px"],
    .section h1[style*="font-size:44px"] {
        font-size: 28px !important;
    }

    .section h2[style*="font-size: 36px"],
    .section h2[style*="font-size:36px"] {
        font-size: 24px !important;
    }

    .section h2[style*="font-size: 28px"],
    .section h2[style*="font-size:28px"] {
        font-size: 22px !important;
    }

    /* Fallback hero heading (when no banners) */
    .glass-card h1[style*="font-size: 48px"] {
        font-size: 28px !important;
    }

    /* FAQ tab buttons row — wrap on mobile */
    .section div[style*="display: flex"][style*="justify-content: center"] {
        flex-wrap: wrap !important;
    }

    /* Tracking form — stack input + button vertically */
    .glass-card form[style*="display: flex"][style*="gap: 16px"] {
        flex-direction: column !important;
    }

    /* POD bar on tracking page — stack */
    div[style*="display: flex"][style*="align-items: center"][style*="justify-content: space-between"][style*="padding: 16px"] {
        flex-direction: column !important;
        gap: 12px !important;
        text-align: center !important;
    }

    /* Contact card — large text */
    .glass-card p[style*="font-size: 18px"] {
        font-size: 15px !important;
        word-break: break-word;
    }

    /* Hero fallback buttons row */
    .glass-card div[style*="display: flex"][style*="justify-content: center"][style*="gap: 16px"] {
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Section inline padding */
    .section[style*="padding: 80px 0"] {
        padding: 50px 0 !important;
    }
}

@media (max-width: 480px) {
    .section h1[style*="font-size: 44px"],
    .section h1[style*="font-size:44px"] {
        font-size: 24px !important;
    }

    .section h2[style*="font-size: 36px"],
    .section h2[style*="font-size:36px"] {
        font-size: 20px !important;
    }

    .glass-card h1[style*="font-size: 48px"] {
        font-size: 24px !important;
    }
}
