/* =====================================================================
   Woo Custom Shipping Syncer — Tracking UI Styles
   Premium tracking form + results with animated timeline
   Version: 1.0.0
   ===================================================================== */

/* === Wrapper === */
.wcss-tracking-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Card === */
.wcss-tracking-card {
    width: 100%;
    max-width: 800px;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 36px 36px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 6px 24px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.wcss-tracking-card:hover {
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.06),
        0 12px 32px rgba(0, 0, 0, 0.09);
}

/* === Title === */
.wcss-tracking-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    text-align: center;
    letter-spacing: -0.02em;
}

.wcss-tracking-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
    text-align: center;
    margin: 0 0 28px 0;
    line-height: 1.5;
}

/* === Search Form === */
.wcss-tracking-search {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.wcss-tracking-input-wrap {
    flex: 1;
    position: relative;
}

#wcss-tracking-form .wcss-tracking-input {
    display: block;
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
}

#wcss-tracking-form .wcss-tracking-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

#wcss-tracking-form .wcss-tracking-input:focus {
    background: #ffffff;
    border-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08);
}

#wcss-tracking-form .wcss-tracking-input:hover:not(:focus) {
    border-color: #cbd5e1;
}

#wcss-tracking-form .wcss-tracking-input.wcss-input-error {
    border-color: #dc2626;
    background: #fef2f2;
}

#wcss-tracking-form .wcss-tracking-input.wcss-input-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Input Icon */
#wcss-tracking-form .wcss-tracking-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

#wcss-tracking-form .wcss-tracking-input:focus ~ .wcss-tracking-input-icon,
#wcss-tracking-form .wcss-tracking-input-wrap:focus-within .wcss-tracking-input-icon {
    color: #1e293b;
}

/* === Track Button === */
#wcss-tracking-form .wcss-track-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #ffffff;
    background: #0f172a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    white-space: nowrap;
    flex-shrink: 0;
}

#wcss-tracking-form .wcss-track-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#wcss-tracking-form .wcss-track-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
}

#wcss-tracking-form .wcss-track-btn:hover::before {
    opacity: 1;
}

#wcss-tracking-form .wcss-track-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

#wcss-tracking-form .wcss-track-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button loader */
#wcss-tracking-form .wcss-track-btn .wcss-btn-text {
    transition: opacity 0.2s ease;
}

#wcss-tracking-form .wcss-track-btn .wcss-btn-loader {
    display: none;
    position: absolute;
    color: #ffffff;
}

#wcss-tracking-form .wcss-track-btn.wcss-loading .wcss-btn-text {
    opacity: 0;
}

#wcss-tracking-form .wcss-track-btn.wcss-loading .wcss-btn-loader {
    display: flex;
}

/* === Error message === */
.wcss-tracking-error {
    display: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-top: 16px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    animation: wcss-track-fade-in 0.3s ease;
}

.wcss-tracking-error.wcss-visible {
    display: block;
}

/* =====================================================================
   RESULTS SECTION
   ===================================================================== */

.wcss-tracking-results {
    display: none;
    margin-top: 28px;
    animation: wcss-track-slide-down 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wcss-tracking-results.wcss-visible {
    display: block;
}

/* === Divider === */
.wcss-results-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin-bottom: 24px;
}

/* === Status Header === */
.wcss-status-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.wcss-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wcss-status-icon svg {
    width: 24px;
    height: 24px;
}

/* Status badge colors */
.wcss-status-delivered .wcss-status-icon {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.wcss-status-in_transit .wcss-status-icon,
.wcss-status-out_for_delivery .wcss-status-icon {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.wcss-status-picked_up .wcss-status-icon,
.wcss-status-manifest .wcss-status-icon {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #3730a3;
}

.wcss-status-exception .wcss-status-icon,
.wcss-status-returned .wcss-status-icon {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.wcss-status-unknown .wcss-status-icon {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
}

.wcss-status-info {
    flex: 1;
    min-width: 0;
}

.wcss-status-label {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.wcss-status-tracking-num {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Details Grid === */
.wcss-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.wcss-detail-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #f1f5f9;
}

.wcss-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 4px 0;
}

.wcss-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    word-break: break-word;
}

/* =====================================================================
   TIMELINE
   ===================================================================== */

.wcss-timeline-heading {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.wcss-timeline {
    position: relative;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Vertical line */
.wcss-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 11px;
    width: 2px;
    background: #e2e8f0;
    border-radius: 1px;
}

.wcss-timeline-item {
    position: relative;
    padding: 0 0 20px 38px;
    animation: wcss-track-fade-in 0.3s ease backwards;
}

.wcss-timeline-item:last-child {
    padding-bottom: 0;
}

/* Stagger animation */
.wcss-timeline-item:nth-child(1) { animation-delay: 0.05s; }
.wcss-timeline-item:nth-child(2) { animation-delay: 0.10s; }
.wcss-timeline-item:nth-child(3) { animation-delay: 0.15s; }
.wcss-timeline-item:nth-child(4) { animation-delay: 0.20s; }
.wcss-timeline-item:nth-child(5) { animation-delay: 0.25s; }
.wcss-timeline-item:nth-child(6) { animation-delay: 0.30s; }
.wcss-timeline-item:nth-child(7) { animation-delay: 0.35s; }
.wcss-timeline-item:nth-child(8) { animation-delay: 0.40s; }
.wcss-timeline-item:nth-child(9) { animation-delay: 0.45s; }
.wcss-timeline-item:nth-child(10) { animation-delay: 0.50s; }

/* Timeline dot */
.wcss-timeline-dot {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 1px #e2e8f0;
    z-index: 1;
}

/* First dot is highlighted */
.wcss-timeline-item:first-child .wcss-timeline-dot {
    background: #0f172a;
    box-shadow: 0 0 0 1px #0f172a, 0 0 0 4px rgba(15, 23, 42, 0.1);
}

.wcss-status-delivered .wcss-timeline-item:first-child .wcss-timeline-dot {
    background: #16a34a;
    box-shadow: 0 0 0 1px #16a34a, 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.wcss-status-exception .wcss-timeline-item:first-child .wcss-timeline-dot {
    background: #d97706;
    box-shadow: 0 0 0 1px #d97706, 0 0 0 4px rgba(217, 119, 6, 0.15);
}

.wcss-timeline-description {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.wcss-timeline-meta {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.wcss-timeline-meta span + span::before {
    content: '·';
    margin: 0 5px;
    color: #cbd5e1;
}

/* === Loading Skeleton === */
.wcss-skeleton {
    display: none;
    margin-top: 28px;
}

.wcss-skeleton.wcss-visible {
    display: block;
}

.wcss-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: wcss-shimmer 1.5s ease-in-out infinite;
    margin-bottom: 12px;
}

.wcss-skeleton-line.wcss-skeleton-lg {
    height: 20px;
    width: 60%;
    margin-bottom: 16px;
}

.wcss-skeleton-line.wcss-skeleton-md {
    width: 80%;
}

.wcss-skeleton-line.wcss-skeleton-sm {
    width: 45%;
}

/* === Animations === */
@keyframes wcss-track-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wcss-track-slide-down {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wcss-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 600px) {
    .wcss-tracking-wrapper {
        padding: 20px 12px;
    }

    .wcss-tracking-card {
        padding: 28px 20px 24px;
        border-radius: 12px;
    }

    .wcss-tracking-title {
        font-size: 19px;
    }

    .wcss-tracking-subtitle {
        font-size: 13px;
    }

    .wcss-tracking-search {
        flex-direction: column;
    }

    .wcss-tracking-input {
        padding: 12px 14px 12px 40px;
        font-size: 14px;
    }

    .wcss-track-btn {
        padding: 13px 20px;
        font-size: 13px;
        min-width: unset;
    }

    .wcss-details-grid {
        grid-template-columns: 1fr 1fr;
    }

    .wcss-status-header {
        gap: 10px;
    }

    .wcss-status-label {
        font-size: 17px;
    }

    .wcss-status-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }
}
