:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-color: #ee4d2d; /* Shopee Orange */
    --accent-hover: #f15e42;
    --success-color: #26aa99;
    --danger-color: #ff4742;
    --glass-bg: rgba(22, 22, 22, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --mobile-header-bg: #121212;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animated Orbs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #0a0a0a 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: 10%;
    width: 600px;
    height: 600px;
    background: var(--accent-color);
}

.blob-2 {
    bottom: -10%;
    right: 10%;
    width: 700px;
    height: 700px;
    background: #ff8a00;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.1); }
}

/* Base / Desktop Layout */
.app-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 4rem 2rem;
}

.container {
    width: 100%;
    max-width: 900px;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.logo h1 {
    font-weight: 900;
    letter-spacing: -2px;
}

.logo span {
    color: var(--text-primary);
    font-weight: 300;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.6;
}

/* Glass Panel (Desktop) */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 2.5rem;
    padding: 3.5rem;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Search Box */
.input-group {
    display: flex;
    align-items: stretch;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.6);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.75rem 2.5rem;
    color: var(--text-primary);
    font-size: 1.3rem;
    outline: none;
}

.input-group input::placeholder {
    color: #444;
}

.input-group button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0 3rem;
    font-weight: 800;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-group button:hover {
    background: var(--accent-hover);
    padding-right: 3.5rem;
}

/* Results Section */
.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.tracking-info h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.tracking-info span {
    color: var(--accent-color);
    font-size: 2.2rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
}

.status-badge {
    padding: 0.85rem 1.75rem;
    border-radius: 1.25rem;
    font-weight: 800;
    font-size: 1.1rem;
    background: rgba(238, 77, 45, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(238, 77, 45, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 3.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-marker {
    position: absolute;
    left: -3.5rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 4px solid #333;
    z-index: 2;
}

.timeline-item.active .timeline-marker {
    background: var(--accent-color);
    border-color: rgba(238, 77, 45, 0.4);
    box-shadow: 0 0 25px var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(238, 77, 45, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(238, 77, 45, 0); }
    100% { box-shadow: 0 0 0 0 rgba(238, 77, 45, 0); }
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 1.5rem;
}

.timeline-item.active .timeline-content {
    border-color: rgba(238, 77, 45, 0.4);
    background: rgba(238, 77, 45, 0.05);
}

.timeline-time {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-desc {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.6;
}

/* Utilities */
.hidden { display: none !important; }

#loading {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(238, 77, 45, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ */
/* MOBILE - NATIVE APP EXPERIENCE OVERRIDES */
/* ============================================================ */

@media (max-width: 768px) {
    body {
        background: var(--bg-primary); /* Darker on mobile */
    }

    .background-elements {
        display: none; /* Cleaner on mobile */
    }

    .app-wrapper {
        display: block; /* Normal flow */
        padding: 0;
        min-height: auto;
    }

    .container {
        max-width: none;
    }

    /* Sticky Mobile Header */
    .header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--mobile-header-bg);
        margin-bottom: 0;
        padding: 1rem 0;
        border-bottom: 1px solid #222;
        text-align: left;
    }

    .logo {
        font-size: 1.5rem;
        justify-content: flex-start;
        padding: 0 1.25rem;
        margin-bottom: 0;
        gap: 0.75rem;
    }

    .logo i { font-size: 1.3rem; }
    .header p { display: none; } /* Hide sub-text on mobile header */

    /* Input & Search */
    .main-content {
        display: flex;
        flex-direction: column;
    }

    .search-box.glass-panel {
        background: transparent;
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 1.5rem 1.25rem;
        margin-bottom: 0;
        border-bottom: 8px solid #111; /* Section divider */
    }

    .input-group {
        border-radius: 0.75rem;
        background: #1a1a1a;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    }

    .input-group input {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
    }

    .input-group button {
        padding: 0 1.25rem;
    }

    .input-group button span { display: none; } /* Only icon on mobile */

    /* Result Container - Full Screen List */
    #result-container.glass-panel {
        background: transparent;
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 1.5rem 1.25rem;
        border-radius: 0;
    }

    .tracking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .tracking-info span {
        font-size: 1.6rem;
    }

    .status-badge {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        font-size: 1rem;
    }

    /* Compact Timeline on Mobile */
    .timeline {
        padding-left: 2rem;
    }

    .timeline::before {
        left: 8px;
    }

    .timeline-marker {
        left: -2rem;
        width: 18px;
        height: 18px;
        border-width: 3px;
    }

    .timeline-item {
        margin-bottom: 1.5rem;
    }

    .timeline-content {
        padding: 1.25rem;
        border-radius: 1rem;
        background: #151515;
    }

    .timeline-time {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .timeline-desc {
        font-size: 1rem;
    }
}
