/* ============================================
   Rastreio Express - My Account Styles
   [meu_rastreio] Shortcode
   ============================================ */

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

/* === Account Container === */
.rexp-account {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 720px;
    margin: 20px auto;
    color: var(--shr-text, #e8e8ed);
    -webkit-font-smoothing: antialiased;
}

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

/* === Header === */
.rexp-account-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 24px 28px;
    background: var(--shr-bg-card, #16161e);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

.rexp-account-header::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: rexp-gradient 3s ease infinite;
}

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

.rexp-account-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--shr-primary), var(--shr-primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px var(--shr-primary-glow, rgba(238,77,45,0.25));
}

.rexp-account-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.rexp-account-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--shr-text);
    letter-spacing: -0.02em;
}

/* === Empty State === */
.rexp-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--shr-bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
}

.rexp-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.rexp-empty p {
    font-size: 16px;
    font-weight: 600;
    color: var(--shr-text);
    margin-bottom: 6px;
}

.rexp-empty span {
    font-size: 13px;
    color: var(--shr-text-secondary);
}

/* === Order Cards List === */
.rexp-orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* === Order Card === */
.rexp-order-card {
    background: var(--shr-bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 20px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: rexp-card-in 0.4s ease backwards;
}

.rexp-order-card:nth-child(1) { animation-delay: 0.05s; }
.rexp-order-card:nth-child(2) { animation-delay: 0.1s; }
.rexp-order-card:nth-child(3) { animation-delay: 0.15s; }
.rexp-order-card:nth-child(4) { animation-delay: 0.2s; }
.rexp-order-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes rexp-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rexp-order-card:hover {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* === Order Top Row === */
.rexp-order-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rexp-order-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rexp-order-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--shr-text);
}

.rexp-order-date {
    font-size: 12px;
    color: var(--shr-text-secondary);
    font-weight: 500;
}

/* === Status Badge === */
.rexp-order-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

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

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

.rexp-status-pending {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.rexp-status-created {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.rexp-status-transit {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.rexp-status-delivered {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* === Tracking Code === */
.rexp-order-tracking {
    margin-bottom: 12px;
}

.rexp-tracking-code-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--shr-bg-card-alt);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
}

.rexp-code-icon {
    width: 18px;
    height: 18px;
    color: var(--shr-primary);
    flex-shrink: 0;
}

.rexp-code-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shr-text-secondary);
    font-weight: 600;
    margin-bottom: 2px;
}

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

/* === Status Message === */
.rexp-order-status-msg {
    margin-bottom: 14px;
}

.rexp-last-msg {
    font-size: 13px;
    color: var(--shr-text-secondary);
    font-weight: 400;
    line-height: 1.5;
}

/* === Bottom Row === */
.rexp-order-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.rexp-last-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--shr-text-secondary);
    font-weight: 500;
}

.rexp-last-check svg {
    width: 13px;
    height: 13px;
    opacity: 0.6;
}

/* === Refresh Button === */
.rexp-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--shr-primary), var(--shr-primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.rexp-refresh-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.rexp-refresh-icon {
    width: 14px;
    height: 14px;
}

.rexp-refresh-btn.rexp-loading .rexp-refresh-icon {
    animation: rexp-spin 0.8s linear infinite;
}

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

/* === Detail Expandable Area === */
.rexp-order-detail {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.04);
    animation: rexp-detail-in 0.3s ease;
}

@keyframes rexp-detail-in {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 800px; }
}

/* Detail timeline (reuses shr-timeline styles from frontend.css) */
.rexp-detail-timeline {
    position: relative;
    padding-left: 28px;
}

.rexp-detail-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 1px;
}

.rexp-detail-item {
    position: relative;
    padding-bottom: 18px;
    animation: rexp-item-in 0.3s ease backwards;
}

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

.rexp-detail-item:nth-child(1) { animation-delay: 0.05s; }
.rexp-detail-item:nth-child(2) { animation-delay: 0.1s; }
.rexp-detail-item:nth-child(3) { animation-delay: 0.15s; }
.rexp-detail-item:nth-child(4) { animation-delay: 0.2s; }

@keyframes rexp-item-in {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.rexp-detail-dot {
    position: absolute;
    left: -22px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    background: var(--shr-bg-card);
    z-index: 1;
}

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

.rexp-detail-content {
    background: var(--shr-bg-card-alt);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 12px 14px;
}

.rexp-detail-item:first-child .rexp-detail-content {
    border-color: rgba(238, 77, 45, 0.12);
    background: rgba(238, 77, 45, 0.03);
}

.rexp-detail-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--shr-text);
    margin-bottom: 3px;
}

.rexp-detail-msg {
    font-size: 12px;
    color: var(--shr-text-secondary);
    margin-bottom: 6px;
}

.rexp-detail-time {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rexp-detail-time svg {
    width: 11px;
    height: 11px;
}

/* === Success flash === */
.rexp-order-card.rexp-updated {
    border-color: rgba(52, 211, 153, 0.3) !important;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.1) !important;
}

/* === Responsive === */
@media (max-width: 600px) {
    .rexp-account {
        margin: 12px auto;
    }

    .rexp-account-header {
        padding: 18px 20px;
    }

    .rexp-account-title {
        font-size: 17px;
    }

    .rexp-order-card {
        padding: 16px 18px;
    }

    .rexp-order-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rexp-order-bottom {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .rexp-refresh-btn {
        width: 100%;
        justify-content: center;
    }
}
