:root {
    --primary: #2c5aa0;
    --primary-dark: #1e3d72;
    --secondary: #ff6b35;
    --accent: #00a8cc;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --gray: #95a5a6;
}

/* Print styles - isolate receipt and remove UI clutter */
@media print {
    /* hide everything except the printable receipt area and its children */
    body * { visibility: hidden; }
    #printableReceipt, #printableReceipt * { visibility: visible; }
    #printableReceipt { position: absolute; left: 0; top: 0; width: 100%; margin: 0; }
    /* hide interactive controls */
    .no-print { display: none !important; }
    /* improve printing colours */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    @page { size: A4; margin: 18mm; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo i {
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-menu a:hover {
    color: var(--secondary);
    background: rgba(255,255,255,0.1);
}

.admin-btn {
    background: var(--secondary);
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-btn.primary {
    background: var(--secondary);
    color: white;
}

.cta-btn.primary:hover {
    background: #e55a2b;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255,107,53,0.3);
}

.cta-btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-btn.secondary:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-3px);
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Services Section */
.services {
    padding: 6rem 0;
    background: white;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #f0f0f0;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.service-icon i {
    font-size: 2rem;
    color: white;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.service-card p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.service-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.service-features span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    font-size: 0.9rem;
}

.service-features i {
    color: var(--success);
}

/* Tracking Section */
.tracking {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.tracking-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.track-input-section {
    margin-bottom: 2rem;
}

.track-form {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.track-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.track-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.track-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.track-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.track-examples {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Tracking Result */
.tracking-result {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e0e0e0;
}

.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.print-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.print-btn:hover {
    background: #219653;
    transform: translateY(-2px);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.info-item span {
    color: #555;
    font-size: 1.1rem;
}

.status-badge {
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending { background: #fff3cd; color: #856404; }
.status-badge.picked-up { background: #d1ecf1; color: #0c5460; }
.status-badge.in-transit { background: #cce7ff; color: #004085; }
.status-badge.out-for-delivery { background: #fff3cd; color: #856404; }
.status-badge.delivered { background: #d4edda; color: #155724; }

/* Map Section */
.tracking-map-section {
    margin: 2rem 0;
    width: 100%;
}

.tracking-map-section h4 {
    margin-bottom: 1rem;
    color: var(--dark);
}

#trackingMap {
    height: 400px;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* Desktop improvements for map */
@media (min-width: 768px) {
    #trackingMap {
        height: 500px;
        min-height: 500px;
    }
    
    .tracking-map-section {
        margin: 2.5rem 0;
    }
}

@media (min-width: 1024px) {
    #trackingMap {
        height: 600px;
        min-height: 600px;
    }
    
    .tracking-map-section {
        margin: 3rem 0;
        max-width: 100%;
    }
}

/* Quick Tracking Result Styles */
.quick-track-result {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quick-track-info {
    font-size: 14px;
}

.quick-track-info .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.quick-track-info .row {
    margin: 0;
}

.quick-track-info .mb-2 {
    margin-bottom: 0.75rem;
}

.quick-track-info strong {
    color: #ffd700;
    margin-right: 0.5rem;
}

/* Timeline */
.tracking-timeline h4 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray);
    position: absolute;
    left: 15px;
    top: 5px;
}

.timeline-item.active::before {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
}

.timeline-item.completed::before {
    background: var(--success);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 2rem;
}

.timeline-item.active .timeline-icon {
    background: var(--success);
    color: white;
}

.timeline-content {
    flex: 1;
}

.timeline-content h5 {
    margin-bottom: 0.3rem;
    color: var(--dark);
}

.timeline-content p {
    color: var(--gray);
    font-size: 0.9rem;
}

.timeline-content .time {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.receipt-content {
    max-width: 600px;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger);
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-grid input,
.form-grid select {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-grid input:focus,
.form-grid select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    text-align: center;
}

.form-summary h3 {
    color: var(--dark);
}

#priceEstimate {
    color: var(--secondary);
    font-size: 1.5rem;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(44, 90, 160, 0.3);
}

/* Receipt Styles */
.receipt {
    background: white;
    padding: 2rem;
    border: 2px solid #333;
    font-family: 'Courier New', monospace;
}

.receipt-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #333;
    padding-bottom: 1rem;
}

.receipt-header h2 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.receipt-details {
    margin-bottom: 2rem;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
}

.receipt-row.total {
    border-top: 2px solid #333;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.receipt-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.download-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .track-form {
        flex-direction: column;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 1rem;
    }
}

/* Enhanced mobile nav overlay (overrides above for small devices) */
@media (max-width: 900px) {
    .nav-menu {
        position: fixed;
        top: 64px;
        right: 0;
        height: calc(100% - 64px);
        width: 80%;
        max-width: 320px;
        background: linear-gradient(180deg, var(--primary), var(--primary-dark));
        flex-direction: column;
        gap: 0;
        padding: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.28s ease-in-out;
        box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    .nav-menu a {
        display: block;
        padding: 0.9rem 1rem;
        margin: 0.2rem 0;
        border-radius: 8px;
    }

    .hamburger {
        display: flex;
    }

    .nav-container {
        padding: 0 1rem;
    }

    main { padding-top: 90px; }
}