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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --accent: #10b981;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    transition: all 0.2s ease;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo img {
    height: 80px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

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

/* Hero Section */
.hero {
    padding: 6rem 0;
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.hero-image {
    flex: 1;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #0f172a;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f1f5f9;
}

/* Tracking Search Card */
.track-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: -4rem auto 0;
    position: relative;
    z-index: 10;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

/* Progress Bar (Matching User Image) */
.tracking-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.progress-header {
    margin-bottom: 2rem;
}

.progress-header h3 {
    margin-bottom: 0.5rem;
}

.progress-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-track {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 4rem 0;
}

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

.progress-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: var(--accent);
    transform: translateY(-50%);
    z-index: 2;
    transition: width 0.5s ease;
}

.step {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.circle {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    color: transparent;
}

.circle svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.step.active .circle {
    background: var(--accent);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.step.active .step-label {
    color: var(--accent);
}

/* Features */
.features {
    padding: 6rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Admin Table */
.admin-table-container {
    margin-top: 2rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f1f5f9;
    font-weight: 600;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-placed { background: #e0f2fe; color: #0369a1; }
.status-packed { background: #fef3c7; color: #92400e; }
.status-shipped { background: #dcfce7; color: #15803d; }
.status-delivered { background: #d1fae5; color: #065f46; }

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
}

.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ============================================
   RESPONSIVE - Tablet (≤ 900px)
   ============================================ */
@media (max-width: 900px) {
    /* Nav */
    .nav-links {
        gap: 1.2rem;
    }

    /* Hero */
    .hero {
        flex-direction: column;
        padding: 4rem 0 3rem;
        gap: 2.5rem;
    }
    .hero-content,
    .hero-image {
        flex: none;
        width: 100%;
    }
    .hero h1 {
        font-size: 2.6rem;
    }

    /* Features grid */
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Footer grid */
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 2.5rem !important;
    }
}

/* ============================================
   RESPONSIVE - Mobile (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Nav */
    nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    .nav-links {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: flex-start;
        width: 100%;
    }
    .nav-links a {
        font-size: 0.85rem;
    }

    /* Logo */
    .logo img {
        height: 56px;
    }

    /* Hero */
    .hero {
        flex-direction: column;
        padding: 3rem 0 2rem;
        gap: 2rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1rem;
    }

    /* Two-column content sections (Western + Security) */
    .container[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    /* Stats bar */
    .container[style*="repeat(4, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }

    /* Contact section grid */
    .container > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Features grid */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Footer bottom bar */
    .container[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    /* Track page: log history grid */
    div[style*="grid-template-columns: 150px 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    /* Track card input group */
    .input-group {
        flex-direction: column;
    }
    .input-group .btn {
        width: 100%;
    }

    /* Admin table — allow horizontal scroll */
    .admin-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 600px;
    }

    /* Sections padding */
    section[style*="padding: 6rem 0"] {
        padding: 3.5rem 0 !important;
    }
}

/* ============================================
   RESPONSIVE - Small Mobile (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 1rem;
    }

    /* Stats: single column */
    .container[style*="repeat(4, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }

    h2[style*="font-size: 2.8rem"] {
        font-size: 2rem !important;
    }
    h2[style*="font-size: 2.2rem"] {
        font-size: 1.7rem !important;
    }
    h2[style*="font-size: 2.5rem"] {
        font-size: 1.8rem !important;
    }

    /* Track page heading */
    h1[style*="font-size: 2.5rem"] {
        font-size: 1.8rem !important;
    }

    /* Progress tracker steps — tighter */
    .step {
        width: 60px;
    }
    .step-label {
        font-size: 0.7rem;
        text-align: center;
    }
}
