:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #f59e0b;
    --accent: #10b981;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--light); color: var(--dark); line-height: 1.6; }

/* Navigation */
.navbar { background: var(--primary); color: white; padding: 1rem 0; position: fixed; width: 100%; top: 0; z-index: 1000; box-shadow: var(--shadow); }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; color: white; text-decoration: none; }
.logo i { color: var(--secondary); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a { color: white; text-decoration: none; font-weight: 500; transition: color 0.3s; cursor: pointer; }
.nav-links a:hover, .nav-links a.active { color: var(--secondary); }
.nav-links .btn { background: var(--secondary); color: var(--dark); padding: 0.5rem 1.5rem; border-radius: 50px; font-weight: 600; }
.nav-links .btn:hover { background: #fbbf24; color: var(--dark); }
.mobile-menu { display: none; font-size: 1.5rem; cursor: pointer; }

/* Layout */
main { padding-top: 80px; min-height: 100vh; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%); color: white; padding: 6rem 2rem 4rem; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px; background: rgba(255,255,255,0.03); border-radius: 50%; }
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; font-weight: 800; }
.hero p { font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }
.tracking-box { background: white; color: var(--dark); max-width: 600px; margin: 0 auto; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow-lg); }
.tracking-box h3 { margin-bottom: 1rem; color: var(--primary); }
.track-input-group { display: flex; gap: 0.5rem; }
.track-input { flex: 1; padding: 1rem; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; outline: none; transition: border-color 0.3s; }
.track-input:focus { border-color: var(--primary-light); }
.track-btn { background: var(--secondary); color: var(--dark); border: none; padding: 1rem 2rem; border-radius: 8px; font-weight: 700; cursor: pointer; transition: all 0.3s; }
.track-btn:hover { background: #fbbf24; transform: translateY(-2px); }

/* Stats Bar */
.stats-bar { background: white; padding: 2rem; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1000px; margin: -3rem auto 0; border-radius: 16px; box-shadow: var(--shadow-lg); position: relative; z-index: 10; }
.stat-item { text-align: center; padding: 1rem; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--gray); font-weight: 500; }

/* Sections */
.section { padding: 4rem 2rem; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary); }
.section-subtitle { text-align: center; color: var(--gray); margin-bottom: 3rem; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.service-card { background: white; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); transition: all 0.3s; border: 1px solid #e2e8f0; }
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.service-icon { width: 60px; height: 60px; background: var(--primary); color: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.service-card h3 { margin-bottom: 0.5rem; color: var(--primary); }
.service-card p { color: var(--gray); }

/* Features */
.features { background: white; }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; margin-bottom: 4rem; }
.feature-row.reverse { direction: rtl; }
.feature-row.reverse > * { direction: ltr; }
.feature-img { width: 100%; border-radius: 16px; box-shadow: var(--shadow-lg); object-fit: cover; height: 350px; }
.feature-content h2 { font-size: 2rem; color: var(--primary); margin-bottom: 1rem; }
.feature-content p { color: var(--gray); margin-bottom: 1.5rem; }
.feature-list { list-style: none; }
.feature-list li { padding: 0.5rem 0; display: flex; align-items: center; gap: 0.5rem; }
.feature-list i { color: var(--accent); }

/* Tracking Page */
.tracking-hero { background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%); color: white; padding: 6rem 2rem 3rem; text-align: center; }
.tracking-hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.tracking-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.tracking-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.tracking-info { background: white; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); }
.tracking-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid #e2e8f0; }
.tracking-id { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.status-badge { padding: 0.5rem 1rem; border-radius: 50px; font-weight: 600; font-size: 0.875rem; display: inline-block; }
.status-in-transit { background: #dbeafe; color: var(--primary); }
.status-delivered { background: #d1fae5; color: var(--accent); }
.status-pending { background: #fef3c7; color: #92400e; }
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item::before { content: ''; position: absolute; left: -2rem; top: 0.5rem; width: 12px; height: 12px; border-radius: 50%; background: var(--gray); border: 2px solid white; box-shadow: 0 0 0 2px var(--gray); }
.timeline-item.active::before { background: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.timeline-item.completed::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.timeline-time { font-size: 0.875rem; color: var(--gray); margin-bottom: 0.25rem; }
.timeline-title { font-weight: 600; color: var(--dark); }
.timeline-desc { font-size: 0.875rem; color: var(--gray); margin-top: 0.25rem; }
#map { height: 500px; border-radius: 16px; box-shadow: var(--shadow); }
.shipment-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.detail-box { background: #f8fafc; padding: 1rem; border-radius: 8px; }
.detail-label { font-size: 0.75rem; text-transform: uppercase; color: var(--gray); font-weight: 600; letter-spacing: 0.05em; }
.detail-value { font-weight: 700; color: var(--dark); margin-top: 0.25rem; }

/* Contact Page */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-info-card { background: white; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 1.5rem; display: flex; align-items: flex-start; gap: 1rem; }
.contact-icon { width: 50px; height: 50px; background: var(--primary); color: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.contact-form { background: white; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); }
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--dark); }
.form-input { width: 100%; padding: 0.75rem; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; outline: none; transition: border-color 0.3s; }
.form-input:focus { border-color: var(--primary-light); }
textarea.form-input { min-height: 120px; resize: vertical; }
.submit-btn { background: var(--primary); color: white; border: none; padding: 1rem 2rem; border-radius: 8px; font-weight: 700; cursor: pointer; width: 100%; transition: all 0.3s; }
.submit-btn:hover { background: #1e40af; }

/* Admin Login */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%); }
.login-card { background: white; padding: 3rem; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; }
.login-card h2 { text-align: center; margin-bottom: 2rem; color: var(--primary); }
.login-input { width: 100%; padding: 1rem; border: 2px solid #e2e8f0; border-radius: 8px; margin-bottom: 1rem; font-size: 1rem; outline: none; }
.login-input:focus { border-color: var(--primary-light); }
.login-btn { width: 100%; padding: 1rem; background: var(--primary); color: white; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; transition: all 0.3s; }
.login-btn:hover { background: #1e40af; }
.login-error { color: var(--danger); text-align: center; margin-top: 1rem; }

/* Admin Dashboard */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar { width: 280px; background: var(--dark); color: white; position: fixed; height: 100vh; padding: 2rem; overflow-y: auto; }
.admin-logo { font-size: 1.5rem; font-weight: 800; margin-bottom: 2rem; display: flex; align-items: center; gap: 0.5rem; }
.admin-nav { list-style: none; }
.admin-nav li { margin-bottom: 0.5rem; }
.admin-nav a { color: #94a3b8; text-decoration: none; padding: 0.75rem 1rem; display: block; border-radius: 8px; transition: all 0.3s; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.1); color: white; }
.admin-nav i { margin-right: 0.75rem; width: 20px; text-align: center; }
.admin-main { margin-left: 280px; padding: 2rem; background: #f1f5f9; min-height: 100vh; width: calc(100% - 280px); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.75rem; color: var(--dark); }
.logout-btn { background: var(--danger); color: white; border: none; padding: 0.5rem 1.5rem; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* Admin Panels */
.admin-panel { background: white; padding: 2rem; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.admin-card { background: #f8fafc; padding: 1.5rem; border-radius: 12px; border: 1px solid #e2e8f0; }
.admin-card h3 { margin-bottom: 1rem; color: var(--primary); font-size: 1rem; }
.admin-input { width: 100%; padding: 0.75rem; border: 2px solid #e2e8f0; border-radius: 8px; margin-bottom: 0.75rem; font-size: 0.9rem; outline: none; }
.admin-input:focus { border-color: var(--primary-light); }
.admin-textarea { min-height: 80px; resize: vertical; }
.save-btn { background: var(--accent); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.save-btn:hover { background: #059669; }
.save-btn.danger { background: var(--danger); }
.save-btn.danger:hover { background: #dc2626; }
.image-preview { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 0.75rem; background: #e2e8f0; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid #e2e8f0; }
.data-table th { background: #f8fafc; font-weight: 600; color: var(--primary); }
.data-table tr:hover { background: #f8fafc; }
.action-btn { padding: 0.5rem; border: none; border-radius: 6px; cursor: pointer; margin-right: 0.5rem; color: white; }
.edit-btn { background: var(--primary-light); }
.delete-btn { background: var(--danger); }
.add-btn { background: var(--primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; margin-bottom: 1rem; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: white; padding: 2rem; border-radius: 16px; width: 90%; max-width: 700px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray); }

/* Footer */
.footer { background: var(--dark); color: white; padding: 3rem 2rem 1rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto; }
.footer-section h3 { margin-bottom: 1rem; color: var(--secondary); }
.footer-section p, .footer-section a { color: #94a3b8; text-decoration: none; line-height: 2; }
.footer-section a:hover { color: white; }
.footer-bottom { text-align: center; padding-top: 2rem; margin-top: 2rem; border-top: 1px solid #334155; color: #64748b; }
.social-links { display: flex; gap: 1rem; margin-top: 1rem; }
.social-links a { width: 40px; height: 40px; background: #334155; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.3s; color: white; }
.social-links a:hover { background: var(--primary-light); }

/* Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--dark); color: white; padding: 1rem 2rem; border-radius: 8px; box-shadow: var(--shadow-lg); transform: translateY(100px); opacity: 0; transition: all 0.3s; z-index: 3000; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--accent); }
.toast.error { background: var(--danger); }

/* Alerts */
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Not found */
.not-found { text-align: center; padding: 4rem; background: white; border-radius: 16px; box-shadow: var(--shadow); }
.not-found i { font-size: 4rem; color: var(--gray); margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--primary); flex-direction: column; padding: 1rem; gap: 1rem; }
    .nav-links.active { display: flex; }
    .mobile-menu { display: block; }
    .hero h1 { font-size: 2rem; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); margin-top: -2rem; }
    .feature-row, .tracking-layout, .contact-grid { grid-template-columns: 1fr; }
    .admin-sidebar { width: 100%; position: relative; height: auto; }
    .admin-main { margin-left: 0; width: 100%; }
    .admin-wrapper { flex-direction: column; }
    .shipment-details { grid-template-columns: 1fr; }
}
