/* ============================================
   Shopee Rastreio - Frontend Styles
   Premium Tracking Interface
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* === CSS Variables === */
.shr-container {
    --shr-primary: #ee4d2d;
    --shr-primary-dark: #d73211;
    --shr-primary-light: #ff6b4a;
    --shr-primary-glow: rgba(238, 77, 45, 0.25);
    --shr-bg: #0f0f14;
    --shr-bg-card: #16161e;
    --shr-bg-card-alt: #1c1c28;
    --shr-bg-input: #1e1e2a;
    --shr-border: rgba(255, 255, 255, 0.06);
    --shr-border-hover: rgba(255, 255, 255, 0.12);
    --shr-text: #e8e8ed;
    --shr-text-secondary: #8b8b9e;
    --shr-text-muted: #55556a;
    --shr-success: #34d399;
    --shr-success-bg: rgba(52, 211, 153, 0.1);
    --shr-warning: #fbbf24;
    --shr-warning-bg: rgba(251, 191, 36, 0.1);
    --shr-info: #60a5fa;
    --shr-info-bg: rgba(96, 165, 250, 0.1);
    --shr-radius: 16px;
    --shr-radius-sm: 10px;
    --shr-radius-xs: 6px;
    --shr-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shr-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Container === */
.shr-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 680px;
    margin: 40px auto;
    padding: 0 16px;
    color: var(--shr-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* === Card === */
.shr-card {
    background: var(--shr-bg-card);
    border: 1px solid var(--shr-border);
    border-radius: var(--shr-radius);
    overflow: hidden;
    box-shadow: var(--shr-shadow);
    position: relative;
}

.shr-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--shr-primary), var(--shr-primary-light), var(--shr-primary));
    background-size: 200% 100%;
    animation: shr-gradient-slide 3s ease infinite;
}

@keyframes shr-gradient-slide {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* === Header === */
.shr-header {
    text-align: center;
    padding: 40px 32px 28px;
}

.shr-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--shr-primary), var(--shr-primary-light));
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px var(--shr-primary-glow);
    animation: shr-float 3s ease-in-out infinite;
}

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

.shr-icon {
    width: 26px;
    height: 26px;
    color: white;
}

.shr-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--shr-text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.shr-subtitle {
    font-size: 14px;
    color: var(--shr-text-secondary);
    font-weight: 400;
}

/* === Search Section === */
.shr-search-wrap {
    padding: 0 32px 32px;
}

.shr-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--shr-bg-input);
    border: 1px solid var(--shr-border);
    border-radius: var(--shr-radius-sm);
    padding: 6px 6px 6px 16px;
    transition: var(--shr-transition);
}

.shr-input-group:focus-within {
    border-color: var(--shr-primary);
    box-shadow: 0 0 0 3px var(--shr-primary-glow);
}

.shr-search-icon {
    width: 20px;
    height: 20px;
    color: var(--shr-text-muted);
    flex-shrink: 0;
    transition: var(--shr-transition);
}

.shr-input-group:focus-within .shr-search-icon {
    color: var(--shr-primary);
}

.shr-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--shr-text);
    font-weight: 500;
    letter-spacing: 0.02em;
    min-width: 0;
}

.shr-input::placeholder {
    color: var(--shr-text-muted);
    font-weight: 400;
}

.shr-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--shr-primary), var(--shr-primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--shr-transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.shr-btn:hover {
    background: linear-gradient(135deg, var(--shr-primary-light), var(--shr-primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--shr-primary-glow);
}

.shr-btn:active {
    transform: translateY(0);
}

.shr-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.shr-spinner {
    width: 18px;
    height: 18px;
    animation: shr-spin 0.8s linear infinite;
}

@keyframes shr-spin {
    to { transform: rotate(360deg); }
}

/* === Error Message === */
.shr-error {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--shr-radius-xs);
    color: #f87171;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shr-shake 0.4s ease;
}

@keyframes shr-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* === Results Section === */
.shr-results {
    padding: 0 32px 32px;
    animation: shr-fade-in 0.5s ease;
}

@keyframes shr-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Tracking Badge === */
.shr-tracking-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--shr-bg-card-alt);
    border: 1px solid var(--shr-border);
    border-radius: var(--shr-radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.shr-badge-code {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shr-badge-icon {
    width: 18px;
    height: 18px;
    color: var(--shr-primary);
}

.shr-badge-label {
    font-size: 11px;
    color: var(--shr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.shr-badge-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--shr-text);
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.04em;
}

.shr-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.shr-badge-status.shr-status-created {
    background: var(--shr-info-bg);
    color: var(--shr-info);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.shr-badge-status.shr-status-transit {
    background: var(--shr-warning-bg);
    color: var(--shr-warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.shr-badge-status.shr-status-delivered {
    background: var(--shr-success-bg);
    color: var(--shr-success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.shr-badge-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: shr-pulse-dot 2s ease infinite;
}

@keyframes shr-pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === Progress Section === */
.shr-progress-section {
    margin-bottom: 24px;
}

.shr-progress-bar {
    height: 4px;
    background: var(--shr-bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.shr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--shr-primary), var(--shr-primary-light));
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.shr-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    animation: shr-progress-shine 2s ease infinite;
}

@keyframes shr-progress-shine {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.shr-milestones {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.shr-milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.shr-milestone-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--shr-bg-input);
    border: 2px solid var(--shr-text-muted);
    transition: var(--shr-transition);
    flex-shrink: 0;
}

.shr-milestone.active .shr-milestone-dot {
    background: var(--shr-primary);
    border-color: var(--shr-primary);
    box-shadow: 0 0 10px var(--shr-primary-glow);
}

.shr-milestone.completed .shr-milestone-dot {
    background: var(--shr-success);
    border-color: var(--shr-success);
}

.shr-milestone-label {
    font-size: 10px;
    color: var(--shr-text-muted);
    text-align: center;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.shr-milestone.active .shr-milestone-label,
.shr-milestone.completed .shr-milestone-label {
    color: var(--shr-text-secondary);
}

/* === Status Card === */
.shr-status-card {
    background: var(--shr-bg-card-alt);
    border: 1px solid var(--shr-border);
    border-radius: var(--shr-radius-sm);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.shr-status-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}

.shr-status-icon-wrap.shr-color-info {
    background: var(--shr-info-bg);
}

.shr-status-icon-wrap.shr-color-warning {
    background: var(--shr-warning-bg);
}

.shr-status-icon-wrap.shr-color-success {
    background: var(--shr-success-bg);
}

.shr-status-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--shr-text);
    margin-bottom: 4px;
}

.shr-status-info p {
    font-size: 13px;
    color: var(--shr-text-secondary);
    font-weight: 400;
}

/* === Timeline === */
.shr-timeline-section {
    margin-top: 8px;
}

.shr-timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--shr-text-secondary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.shr-timeline {
    position: relative;
    padding-left: 28px;
}

.shr-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--shr-border);
    border-radius: 1px;
}

.shr-timeline-item {
    position: relative;
    padding-bottom: 24px;
    animation: shr-slide-in 0.4s ease backwards;
}

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

.shr-timeline-item:nth-child(1) { animation-delay: 0.1s; }
.shr-timeline-item:nth-child(2) { animation-delay: 0.2s; }
.shr-timeline-item:nth-child(3) { animation-delay: 0.3s; }
.shr-timeline-item:nth-child(4) { animation-delay: 0.4s; }
.shr-timeline-item:nth-child(5) { animation-delay: 0.5s; }
.shr-timeline-item:nth-child(6) { animation-delay: 0.6s; }
.shr-timeline-item:nth-child(7) { animation-delay: 0.7s; }
.shr-timeline-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes shr-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.shr-timeline-dot {
    position: absolute;
    left: -22px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--shr-text-muted);
    background: var(--shr-bg-card);
    z-index: 1;
}

.shr-timeline-item:first-child .shr-timeline-dot {
    background: var(--shr-primary);
    border-color: var(--shr-primary);
    box-shadow: 0 0 10px var(--shr-primary-glow);
}

.shr-timeline-content {
    background: var(--shr-bg-card-alt);
    border: 1px solid var(--shr-border);
    border-radius: var(--shr-radius-xs);
    padding: 14px 16px;
    transition: var(--shr-transition);
}

.shr-timeline-content:hover {
    border-color: var(--shr-border-hover);
    transform: translateX(4px);
}

.shr-timeline-item:first-child .shr-timeline-content {
    border-color: rgba(238, 77, 45, 0.15);
    background: rgba(238, 77, 45, 0.04);
}

.shr-timeline-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--shr-text);
    margin-bottom: 4px;
}

.shr-timeline-message {
    font-size: 13px;
    color: var(--shr-text-secondary);
    font-weight: 400;
    margin-bottom: 8px;
    line-height: 1.5;
}

.shr-timeline-time {
    font-size: 11px;
    color: var(--shr-text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.shr-timeline-time svg {
    width: 12px;
    height: 12px;
}

/* === Footer === */
.shr-footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--shr-text-muted);
}

/* === Responsive === */
@media (max-width: 600px) {
    .shr-container {
        margin: 20px auto;
        padding: 0 8px;
    }

    .shr-header {
        padding: 28px 20px 20px;
    }

    .shr-title {
        font-size: 19px;
    }

    .shr-search-wrap {
        padding: 0 16px 24px;
    }

    .shr-input-group {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }

    .shr-search-icon {
        display: none;
    }

    .shr-input {
        width: 100%;
        text-align: center;
        font-size: 14px;
    }

    .shr-btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .shr-results {
        padding: 0 16px 24px;
    }

    .shr-tracking-badge {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .shr-badge-code {
        flex-direction: column;
        gap: 4px;
    }

    .shr-milestone-label {
        font-size: 9px;
    }

    .shr-status-card {
        flex-direction: column;
        text-align: center;
    }
}
