/* ============================================================================
   TRACKING STYLES - HubEurope Paperwhite Design
   Compact, clean design with concertina functionality preserved
   ============================================================================ */

/* ============================================================================
   CSS CUSTOM PROPERTIES - BRAND VARIABLES
   ============================================================================ */

:root {
    /* Brand Colors */
    --e-global-color-primary: #FF4400;
    --e-global-color-secondary: #000000;
    --e-global-color-text: #000000;
    --e-global-color-accent: #FF4400;
    
    /* Typography Fonts */
    --e-global-typography-primary-font-family: "MuseoModerno";
    --e-global-typography-primary-font-weight: 600;
    --e-global-typography-secondary-font-family: "Hanken Grotesk";
    --e-global-typography-secondary-font-weight: 400;
    --e-global-typography-text-font-family: "Open Sans";
    --e-global-typography-text-font-weight: 400;
    --e-global-typography-accent-font-family: "Open Sans";
    --e-global-typography-accent-font-weight: 600;
    
    /* Paperwhite Colors */
    --color-paperwhite: #FEFEFE;
    --color-border: #E8E8E8;
    --color-text: #000000;
    --color-text-secondary: #404040;
    --color-orange: #FF4400;
    --color-orange-light: #FF6A26;
}

/* ============================================================================
   BASE STYLES - COMPACT & CLEAN
   ============================================================================ */

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

body {
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: var(--e-global-typography-text-font-weight);
    background: var(--color-paperwhite);
    min-height: 100vh;
    padding: 15px;
    color: var(--color-text);
    line-height: 1.5;
}

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

/* ============================================================================
   HEADER STYLES - LOGO ABOVE HEADING
   ============================================================================ */

.header {
    background: var(--color-paperwhite);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-with-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.tracking-logo {
    width: 320px;
    height: auto;
    flex-shrink: 0;
}

.header-content h1 {
    font-family: var(--e-global-typography-primary-font-family), 'MuseoModerno', sans-serif;
    font-weight: var(--e-global-typography-primary-font-weight);
    font-size: 28px;
    color: var(--color-text);
    margin-bottom: 5px;
}

.header-content p {
    font-family: var(--e-global-typography-secondary-font-family), 'Hanken Grotesk', sans-serif;
    font-weight: var(--e-global-typography-secondary-font-weight);
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* ============================================================================
   BACK BUTTON - COMPACT
   ============================================================================ */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-paperwhite);
    color: var(--color-orange);
    text-decoration: none;
    border: 1px solid var(--color-orange);
    border-radius: 6px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    font-size: 14px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--color-orange);
    color: white;
}

/* ============================================================================
   SEARCH FORM - COMPACT
   ============================================================================ */

.search-form {
    background: var(--color-paperwhite);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group {
    display: flex;
    gap: 10px;
}

.form-group input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 0 0 0 2px rgba(255, 68, 0, 0.1);
}

.form-group button {
    padding: 10px 25px;
    background: var(--color-orange);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.form-group button:hover {
    background: var(--color-orange-light);
}

/* ============================================================================
   MESSAGES - COMPACT
   ============================================================================ */

.error-message,
.success-message {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    font-size: 14px;
}

.error-message {
    background: #FFF5F5;
    color: #C53030;
    border-left: 3px solid #E53E3E;
}

.success-message {
    background: #F0FFF4;
    color: #2F855A;
    border-left: 3px solid #38A169;
}

/* ============================================================================
   SECTION CONTROLS (Expand/Collapse All) - COMPACT
   ============================================================================ */

.section-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.control-btn {
    padding: 8px 18px;
    background: var(--color-paperwhite);
    color: var(--color-orange);
    border: 1px solid var(--color-orange);
    border-radius: 6px;
    font-size: 14px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--color-orange);
    color: white;
}

.control-btn.reset {
    border-color: var(--color-text-secondary);
    color: var(--color-text-secondary);
}

.control-btn.reset:hover {
    background: var(--color-text-secondary);
    color: white;
}

/* ============================================================================
   COLLAPSIBLE SECTIONS - MAINTAINING FUNCTIONALITY
   ============================================================================ */

.collapsible-section {
    margin-bottom: 15px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.collapsible-section:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--color-orange);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.section-header:hover {
    background: var(--color-orange-light);
}

.section-header:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

.section-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: var(--e-global-typography-primary-font-weight);
    font-family: var(--e-global-typography-primary-font-family), 'MuseoModerno', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    font-size: 13px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 110px;
    width: 110px;
}

.toggle-chip:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chip-text-open,
.chip-text-closed {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    white-space: nowrap;
    opacity: 1;
}

.chip-text-closed {
    opacity: 0;
}

.section-header.collapsed .chip-text-open {
    opacity: 0;
}

.section-header.collapsed .chip-text-closed {
    opacity: 1;
}

.section-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                padding 0.3s ease;
    opacity: 1;
    padding: 20px;
    background: var(--color-paperwhite);
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
}

/* Animation for content reveal */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-content:not(.collapsed) > * {
    animation: slideDown 0.3s ease forwards;
}

/* Adjust existing shipment-details to work with collapsible */
.shipment-details {
    background: var(--color-paperwhite);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.shipment-details.collapsible {
    padding: 0;
    margin-bottom: 15px;
    box-shadow: none;
    border: none;
}

.shipment-details.collapsible .section-title {
    display: none;
}

/* ============================================================================
   SECTION TITLES - COMPACT
   ============================================================================ */

.section-title {
    font-size: 18px;
    font-weight: var(--e-global-typography-primary-font-weight);
    font-family: var(--e-global-typography-primary-font-family), 'MuseoModerno', sans-serif;
    color: var(--color-text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================================
   INFO GRID - COMPACT
   ============================================================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.info-item {
    background: var(--color-paperwhite);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-orange);
    transition: all 0.2s ease;
}

.info-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.info-label {
    font-size: 11px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 15px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    color: var(--color-text);
}

/* ============================================================================
   BADGES - COMPACT
   ============================================================================ */

.scan-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    margin-left: 6px;
}

.scan-badge.scanned {
    background: #E6F4EA;
    color: #1E7E34;
}

.scan-badge.not-scanned {
    background: #FCE8E6;
    color: #C5221F;
}

.customer-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    margin-left: 6px;
}

.customer-badge.vip {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFB74D;
}

.customer-badge.repeat {
    background: #F5F5F5;
    color: #424242;
    border: 1px solid #9E9E9E;
}

.customer-badge.new {
    background: #FFE8E0;
    color: var(--color-orange);
    border: 1px solid var(--color-orange);
}

.expected-delivery-badge {
    display: inline-block;
    padding: 10px 20px;
    background: var(--color-orange);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--e-global-typography-primary-font-family), 'MuseoModerno', sans-serif;
}

.early-balloon {
    display: inline-block;
    padding: 4px 10px;
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFB74D;
    border-radius: 15px;
    font-size: 12px;
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    margin-left: 10px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ============================================================================
   ADDRESS CARDS - COMPACT
   ============================================================================ */

.address-card {
    background: var(--color-paperwhite);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-orange);
}

.address-card h3 {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--e-global-typography-secondary-font-family), 'Hanken Grotesk', sans-serif;
    color: var(--color-orange);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.address-card p {
    margin: 4px 0;
    color: var(--color-text);
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================================================
   TRACKING MAP - COMPACT
   ============================================================================ */

#tracking-map {
    width: 100%;
    height: 400px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.popup-buttons {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.popup-btn {
    flex: 1;
    padding: 6px 10px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    transition: all 0.2s ease;
}

.popup-btn.street-view {
    background: var(--color-orange);
    color: white;
}

.popup-btn.street-view:hover {
    background: var(--color-orange-light);
}

.popup-btn.maps {
    background: var(--color-text);
    color: white;
}

.popup-btn.maps:hover {
    background: var(--color-text-secondary);
}

/* ============================================================================
   TRACKING TIMELINE - COMPACT WITH COLOR HIGHLIGHTS
   ============================================================================ */

.tracking-timeline {
    position: relative;
}

.tracking-event {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--color-paperwhite);
    border-radius: 6px;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-orange);
    transition: all 0.2s ease;
}

.tracking-event:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Keep tracking code color highlights */
.tracking-event[data-code="7"] {
    border-left-color: #34A853;
    background: #F0FFF4;
}

.tracking-event[data-code="6"] {
    border-left-color: #4285F4;
    background: #F0F7FF;
}

.tracking-event[data-code="5"] {
    border-left-color: #FBBC04;
    background: #FFFBF0;
}

.event-content {
    flex: 1;
}

.event-status {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--e-global-typography-secondary-font-family), 'Hanken Grotesk', sans-serif;
    color: var(--color-text);
    margin-bottom: 4px;
}

.event-details {
    font-size: 13px;
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    color: var(--color-text-secondary);
}

.day-badge {
    background: var(--color-orange);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    white-space: nowrap;
}

/* ============================================================================
   ITEMS TABLE - COMPACT
   ============================================================================ */

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.items-table thead {
    background: var(--color-orange);
    color: white;
}

.items-table th {
    padding: 10px;
    text-align: left;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-secondary-font-family), 'Hanken Grotesk', sans-serif;
    font-size: 13px;
}

.items-table td {
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    font-size: 14px;
}

.items-table tbody tr:hover {
    background: #FAFAFA;
}

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

/* ============================================================================
   POD IMAGE - COMPACT
   ============================================================================ */

.pod-image-container {
    text-align: center;
}

.pod-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #34A853;
    color: white;
    border-radius: 15px;
    font-weight: 700;
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    font-size: 13px;
    margin-bottom: 12px;
}

.pod-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

/* ============================================================================
   FLOATING EMAIL BUTTON - COMPACT
   ============================================================================ */

.floating-email-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 68, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 1000;
}

.floating-email-btn:hover {
    background: var(--color-orange-light);
    transform: scale(1.05);
}

.floating-email-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

/* Orbiting wisp effect */
.floating-email-btn::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #FF4400;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin-top: -4px;
    margin-left: -4px;
    box-shadow: 
        0 0 6px 2px rgba(255, 68, 0, 0.8),
        0 0 12px 4px rgba(255, 68, 0, 0.4),
        0 0 20px 6px rgba(255, 68, 0, 0.2);
    animation: orbit 2.5s linear infinite;
    pointer-events: none;
}

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(35px);
    }
    to {
        transform: rotate(360deg) translateX(35px);
    }
}

/* ============================================================================
   EMAIL MODAL - COMPACT
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-paperwhite);
    border-radius: 8px;
    padding: 25px;
    max-width: 450px;
    width: 90%;
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header h2 {
    font-size: 20px;
    font-weight: var(--e-global-typography-primary-font-weight);
    font-family: var(--e-global-typography-primary-font-family), 'MuseoModerno', sans-serif;
    color: var(--color-text);
    margin-bottom: 6px;
}

.modal-header p {
    color: var(--color-text-secondary);
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-form input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: var(--e-global-typography-text-font-family), 'Open Sans', sans-serif;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.modal-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 0 0 0 2px rgba(255, 68, 0, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: var(--e-global-typography-accent-font-weight);
    font-family: var(--e-global-typography-accent-font-family), 'Open Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.modal-btn.primary:hover {
    background: var(--color-orange-light);
}

.modal-btn.secondary {
    background: #F5F5F5;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.modal-btn.secondary:hover {
    background: #EEEEEE;
}

/* ============================================================================
   RESPONSIVE DESIGN - COMPACT
   ============================================================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header-with-logo {
        gap: 12px;
    }
    
    .tracking-logo {
        width: 240px;
    }
    
    .header-content h1 {
        font-size: 22px;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        padding: 12px 15px;
    }
    
    .section-header h2 {
        font-size: 14px;
    }
    
    .section-content {
        padding: 15px;
    }
    
    .section-content.collapsed {
        padding: 0 15px;
    }
    
    .section-controls {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
    }
    
    .toggle-chip {
        font-size: 11px;
        padding: 5px 12px;
        min-width: 95px;
        width: 95px;
    }
    
    #tracking-map {
        height: 250px;
    }
    
    .tracking-event {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .items-table {
        display: block;
        overflow-x: auto;
    }
    
    .floating-email-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .floating-email-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 18px;
    }
    
    .tracking-logo {
        width: 200px;
    }
    
    .expected-delivery-badge {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .early-balloon {
        display: block;
        margin: 6px 0 0 0;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .back-btn,
    .search-form,
    .section-controls,
    .floating-email-btn {
        display: none;
    }
    
    .collapsible-section {
        box-shadow: none;
        border: 1px solid var(--color-border);
    }
    
    .section-header {
        background: var(--color-orange) !important;
        color: white !important;
        page-break-after: avoid;
    }
    
    .section-content {
        page-break-inside: avoid;
    }
    
    .shipment-details {
        box-shadow: none;
        border: 1px solid var(--color-border);
        page-break-inside: avoid;
    }
}