/* Speed Tracking — Brand Colors & Variables */
:root {
    --navy: #1a2744;
    --navy-light: #243352;
    --navy-dark: #111b30;
    --red: #e63228;
    --red-dark: #c4261e;
    --red-light: #ff4d42;
    --blue-accent: #2563eb;
    --blue-bright: #3b82f6;
    --blue-light: #dbeafe;
    --gold: #f59e0b;
    --gold-light: #fbbf24;

    --background: #f8f9fc;
    --background-subtle: #f1f3f8;
    --card-bg: #ffffff;
    --card-bg-alt: linear-gradient(145deg, #ffffff 0%, #fafbfd 100%);

    --text-primary: #1a2744;
    --text-secondary: #5a6578;
    --text-light: #8b95a8;
    --white: #ffffff;

    --border-color: #e3e7ef;
    --shadow-sm: 0 1px 3px rgba(26, 39, 68, 0.06), 0 1px 2px rgba(26, 39, 68, 0.04);
    --shadow-md: 0 4px 12px rgba(26, 39, 68, 0.08), 0 2px 4px rgba(26, 39, 68, 0.04);
    --shadow-lg: 0 20px 50px rgba(26, 39, 68, 0.12);
    --shadow-red: 0 8px 24px rgba(230, 50, 40, 0.25);

    --radius: 12px;
    --radius-lg: 20px;
    --font-heading: 'Exo 2', 'Segoe UI', sans-serif;
    --font-body: 'DM Sans', 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    font-weight: 400;
}

/* ===== HEADER ===== */
.header {
    background: var(--navy);
    padding: 1rem 0;
    position: relative;
    overflow: hidden;
}

/* Subtle speed-line pattern */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            -4deg,
            transparent,
            transparent 30px,
            rgba(255,255,255,0.015) 30px,
            rgba(255,255,255,0.015) 31px
        );
    pointer-events: none;
}

/* Red accent line at bottom */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}

.header__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.header__brand {
    text-align: center;
}

.header__logo-link {
    display: inline-block;
    text-decoration: none;
}

.header__logo-img {
    height: 80px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.header__logo-img:hover {
    transform: scale(1.03);
}

/* ===== MAIN CONTENT ===== */
.app-content {
    flex: 1;
    padding: 4rem 0;
    position: relative;
}

/* Subtle background texture */
.app-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(230, 50, 40, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ===== CARD ===== */
.tracking-section {
    margin-bottom: 3rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

/* Red top accent bar */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red), var(--red-light), var(--gold));
}

.card--center {
    text-align: center;
}

.tracking-id-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.tracking-id-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== FORM ===== */
.tracking-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.input-container-wrapper {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.input-container {
    position: relative;
    width: 100%;
}

.input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.input:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.input-label {
    position: absolute;
    top: 1.2rem;
    left: 1.5rem;
    color: var(--text-light);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    padding: 0 0.5rem;
    font-weight: 500;
}

.input:focus + .input-label,
.input:not(:placeholder-shown) + .input-label {
    top: -0.7rem;
    left: 1rem;
    font-size: 0.9rem;
    color: var(--blue-accent);
    font-weight: 600;
}

.input-error-message {
    color: var(--red);
    font-size: 0.95rem;
    margin-top: 0.75rem;
    text-align: left;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== BUTTON ===== */
.button {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: var(--white);
    padding: 1rem 3rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.button:hover::before {
    left: 100%;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

.button:active {
    transform: translateY(0);
}

.button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== RESULTS ===== */
.results-container {
    margin-top: 3rem;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.tracking-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.progress-bar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue-accent), var(--navy));
}

.progress__track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 6px;
    background: var(--blue-light);
    border-radius: 3px;
    margin: 2rem 0;
}

.progress__track-progress {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--blue-accent), var(--navy));
    border-radius: 3px;
    left: 0;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.progress__point-wrapper {
    display: flex;
    justify-content: space-between;
    width: 100%;
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
}

.progress__point {
    width: 24px;
    height: 24px;
    background: var(--white);
    border: 3px solid var(--blue-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.progress__point--completed {
    background: var(--blue-accent);
    border-color: var(--blue-accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: scale(1.1);
}

.progress__point--completed::after {
    content: '\2713';
    color: var(--white);
    font-size: 0.8rem;
    font-weight: bold;
}

.progress__point--first {
    left: 0px !important;
    transform: translateX(-50%);
}

.progress__point--last {
    right: 0px !important;
    transform: translateX(50%);
    left: auto !important;
}

.progress__point--completed.progress__point--first {
    transform: translateX(-50%) scale(1.1);
}

.progress__point--completed.progress__point--last {
    transform: translateX(50%) scale(1.1);
}

.progress__name {
    position: absolute;
    top: -45px;
    white-space: nowrap;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    transform: translateX(-50%);
    left: 50%;
    text-align: center;
    min-width: 90px;
}

.progress__point--first .progress__name {
    transform: translateX(0%);
    left: 0;
    text-align: left;
    min-width: unset;
}

.progress__point--last .progress__name {
    transform: translateX(-100%);
    left: 100%;
    text-align: right;
    min-width: unset;
}

.progress__point--completed .progress__name {
    color: var(--blue-accent);
    font-weight: 700;
}

/* ===== DETAIL CARDS ===== */
.detail-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: var(--card-bg-alt);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold));
}

.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.detail-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-item:hover {
    background-color: var(--background-subtle);
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 8px;
}

.detail-item strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-item span {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Delivery card — navy themed */
.detail-card--delivery {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    text-align: center;
}

.detail-card--delivery::before {
    background: linear-gradient(90deg, var(--gold), var(--red), var(--gold));
}

.detail-card--delivery h3 {
    color: var(--white);
    margin-bottom: 2rem;
}

.detail-delivery-day {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.detail-delivery-date {
    font-size: 1.6rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ===== TIMELINE / EVENTS ===== */
.latest-update {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.latest-update::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--navy), var(--blue-accent));
}

.latest-update-status-highlight {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.latest-update-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.latest-update-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 2px;
}

.event-list {
    list-style: none;
    padding: 0;
    position: relative;
    text-align: left;
}

.event-list::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 10px;
    bottom: 20px;
    width: 3px;
    background: linear-gradient(180deg, var(--blue-accent), var(--navy));
    border-radius: 2px;
    z-index: 0;
}

.event-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-left: 60px;
    position: relative;
    transition: all 0.3s ease;
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-item:hover {
    transform: translateX(8px);
}

.event-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 8px;
    width: 16px;
    height: 16px;
    background: var(--blue-accent);
    border-radius: 50%;
    z-index: 1;
    border: 4px solid var(--white);
    box-shadow: 0 0 0 2px var(--blue-accent);
}

.event-date-time {
    flex: 0 0 140px;
    margin-right: 2rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    line-height: 1.4;
    padding: 0.5rem 0;
}

.event-details {
    flex: 1;
    padding: 0.5rem 0;
}

.event-process {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-location {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.5;
}

/* ===== LOADER ===== */
.loader {
    width: 50px;
    height: 50px;
    margin: 3rem auto;
    position: relative;
}

.loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid var(--blue-light);
    border-top: 4px solid var(--red);
    border-radius: 50%;
    animation: modernSpin 1s linear infinite;
}

.loader::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border: 2px solid transparent;
    border-top: 2px solid var(--blue-accent);
    border-radius: 50%;
    animation: modernSpin 0.7s linear infinite reverse;
}

@keyframes modernSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== FOOTER ===== */
.footer {
    background: var(--navy);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}

.footer p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header__logo-img {
        height: 60px;
    }

    .tracking-id-title {
        font-size: 2.2rem;
    }

    .tracking-id-subtitle {
        font-size: 1.1rem;
    }

    .card {
        padding: 2rem;
    }

    .detail-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-card {
        padding: 1.5rem;
    }

    .progress-bar-container {
        padding: 2rem 1.5rem;
    }

    .progress__name {
        font-size: 0.85rem;
        top: -40px;
        min-width: 70px;
    }

    .progress__point--first .progress__name,
    .progress__point--last .progress__name {
        min-width: unset;
    }

    .event-item {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 50px;
        margin-bottom: 1.5rem;
    }

    .event-item::before {
        left: 10px;
        top: 10px;
    }

    .event-list::before {
        left: 18px;
    }

    .event-date-time {
        text-align: left;
        margin-right: 0;
        margin-bottom: 0.75rem;
        flex-basis: auto;
        font-size: 0.9rem;
    }

    .event-details {
        width: 100%;
    }

    .latest-update-status-highlight {
        font-size: 1.6rem;
    }

    .latest-update-title {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .app-content {
        padding: 2rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .card {
        padding: 1.5rem;
        border-radius: var(--radius);
    }

    .header__logo-img {
        height: 50px;
    }

    .tracking-id-title {
        font-size: 1.8rem;
    }

    .input {
        padding: 1rem 1.2rem;
        font-size: 1rem;
    }

    .button {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-width: 160px;
    }

    .progress__name {
        font-size: 0.8rem;
        top: -35px;
        min-width: 60px;
    }

    .progress__point {
        width: 20px;
        height: 20px;
    }

    .detail-card {
        padding: 1.2rem;
    }

    .latest-update {
        padding: 1.5rem;
    }

    .latest-update-status-highlight {
        font-size: 1.4rem;
    }

    .latest-update-title {
        font-size: 1.1rem;
        margin-bottom: 1.2rem;
    }

    .event-process {
        font-size: 1rem;
    }

    .event-location {
        font-size: 0.9rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-card:hover .detail-item {
    transition: all 0.2s ease;
}

.input:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}