/* CargoSphere International - Main Stylesheet */

/* ===== CSS Variables ===== */
:root {
    --primary: #1e3a5f;
    --primary-dark: #142942;
    --primary-light: #2a5080;
    --accent: #0ea5e9;
    --accent-light: #e0f2fe;
    --dark-blue: #0f172a;
    --dark-blue-120: #070d1a;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-shade: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition: all 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ===== Header & Navigation ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 72px;
    max-width: 1400px;
    margin: 0 auto;
}
.logo-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-link img { height: 48px; width: 48px; object-fit: contain; border-radius: 8px; }
.logo-text { font-size: 1.25rem; font-weight: 700; color: var(--primary); letter-spacing: -0.02em; }
.logo-text span { color: var(--accent); }

/* Desktop Nav */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { color: var(--primary); background: var(--accent-light); }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-primary); margin: 6px 0; transition: var(--transition); }

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 72px; left: 0; right: 0; bottom: 0;
    background: var(--bg-white);
    z-index: 999;
    padding: 24px;
    overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
    display: block;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: var(--bg-light); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Hero Section ===== */
.hero {
    position: relative;
    background: var(--dark-blue);
    color: #fff;
    padding: 120px 0 80px;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 1;
}
.hero-content { position: relative; z-index: 2; }
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    color: #fff;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
}
.hero h1 { font-size: 3rem; margin-bottom: 20px; color: #fff; max-width: 700px; }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 600px; margin-bottom: 32px; }

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section-dark { background: var(--dark-blue); color: #fff; }
.section-dark h2, .section-dark h3, .section-dark p { color: #fff; }
.section-dark p { opacity: 0.85; }
.section-light { background: var(--bg-light); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { max-width: 640px; margin: 0 auto; color: var(--text-muted); }

/* ===== Grid System ===== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Cards ===== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-icon {
    width: 56px; height: 56px;
    background: var(--accent-light);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--primary);
}
.card h3 { margin-bottom: 12px; font-size: 1.2rem; }
.card p { color: var(--text-muted); font-size: 0.9rem; }

.card-dark {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}
.card-dark:hover { background: rgba(255,255,255,0.1); }

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    color: #fff;
}
.service-card-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    transition: var(--transition);
}
.service-card:hover .service-card-bg { transform: scale(1.05); }
.service-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.05) 100%);
}
.service-card-content { position: relative; z-index: 2; padding: 32px; width: 100%; }
.service-card-content h3 { color: #fff; font-size: 1.4rem; margin-bottom: 8px; }
.service-card-content p { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 0; }

/* ===== Stats ===== */
.stats { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--accent); display: block; }
.stat-label { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.form-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ===== Alerts ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
th { font-weight: 600; color: var(--text-primary); background: var(--bg-light); white-space: nowrap; }
tr:hover td { background: var(--bg-light); }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-sent { background: #e0e7ff; color: #3730a3; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-draft { background: #f3f4f6; color: #374151; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }
.badge-issued { background: #dbeafe; color: #1e40af; }
.badge-in_transit { background: #fef3c7; color: #92400e; }
.badge-delivered { background: #d1fae5; color: #065f46; }

/* ===== Footer ===== */
.site-footer {
    background: var(--dark-blue-120);
    color: rgba(255,255,255,0.7);
    padding: 64px 0 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer-brand p { font-size: 0.9rem; margin-top: 16px; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(255,255,255,0.6); font-size: 0.85rem; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: rgba(255,255,255,0.5); font-size: 1.2rem; }
.footer-social a:hover { color: #fff; }

/* ===== Tracking ===== */
.tracking-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
}
.tracking-input-group {
    display: flex;
    gap: 12px;
}
.tracking-input-group .form-control { flex: 1; }

.timeline { position: relative; padding-left: 32px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid var(--bg-white);
}
.timeline-item.active .timeline-dot { background: var(--success); }
.timeline-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.timeline-status { font-weight: 600; font-size: 0.95rem; }
.timeline-location { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Accordion ===== */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.accordion-header {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white);
    transition: var(--transition);
}
.accordion-header:hover { background: var(--bg-light); }
.accordion-header .icon { transition: transform 0.3s; font-size: 1.2rem; }
.accordion-item.open .accordion-header .icon { transform: rotate(180deg); }
.accordion-body { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.accordion-item.open .accordion-body { max-height: 500px; padding: 0 20px 20px; }

/* ===== Feature Boxes ===== */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.feature-box { text-align: center; padding: 40px 24px; }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-box h3 { font-size: 1.1rem; margin-bottom: 12px; }
.feature-box p { font-size: 0.9rem; color: var(--text-muted); }

/* ===== CTA Section ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 80px 0;
}
.cta-section h2 { color: #fff; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.85); margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== Quote Form Specific ===== */
.quote-form-wrapper {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-md);
}
.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-light);
}
.shipment-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.shipment-type-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.shipment-type-option:hover { border-color: var(--accent); }
.shipment-type-option.selected { border-color: var(--primary); background: var(--accent-light); }
.shipment-type-option .icon { font-size: 2rem; margin-bottom: 8px; display: block; }
.shipment-type-option .label { font-weight: 600; font-size: 0.9rem; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero { padding: 80px 0 60px; min-height: 400px; }
    .main-nav { display: none; }
    .hamburger { display: block; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
    .stats { gap: 24px; }
    .quote-form-wrapper { padding: 24px; }
    .section { padding: 48px 0; }
    .shipment-type-selector { flex-direction: column; }
    .tracking-input-group { flex-direction: column; }
}
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .header-inner { padding: 0 16px; }
}
