/**
 * Ship24 Integration Styles
 * Loading animation and Ship24 result display
 */

/* Loading Overlay */
.ship24-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ship24-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ship24-loading-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

/* Countdown Timer */
.ship24-countdown {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
}

.ship24-countdown-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(59, 130, 246, 0.2);
}

.ship24-countdown-ring.outer {
    animation: spin-slow 8s linear infinite;
    border-top-color: rgba(59, 130, 246, 0.6);
    border-right-color: transparent;
}

.ship24-countdown-ring.middle {
    inset: 15px;
    animation: spin-slow 6s linear infinite reverse;
    border-left-color: rgba(147, 51, 234, 0.6);
    border-bottom-color: transparent;
}

.ship24-countdown-ring.inner {
    inset: 30px;
    animation: spin-slow 4s linear infinite;
    border-top-color: rgba(59, 130, 246, 0.8);
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ship24-countdown-number {
    position: absolute;
    inset: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent);
    border-radius: 50%;
}

.ship24-loading-message {
    color: #9ca3af;
    font-size: 1rem;
    margin-bottom: 1rem;
    min-height: 1.5rem;
}

.ship24-loading-hint {
    color: #6b7280;
    font-size: 0.85rem;
}

/* Ship24 Result Section */
.ship24-result {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

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

.ship24-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 1rem 1rem 0 0;
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #fff;
}

.ship24-tracking-number {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.ship24-courier-badge {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
}

.ship24-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ship24-status-badge.delivered {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ship24-status-badge.in-transit {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Ship24 Info Grid */
.ship24-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(30, 41, 59, 0.5);
    border-left: 1px solid rgba(59, 130, 246, 0.2);
    border-right: 1px solid rgba(59, 130, 246, 0.2);
}

.ship24-info-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
}

.ship24-info-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.ship24-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

/* Ship24 Timeline */
.ship24-timeline {
    padding: 1.5rem;
    background: var(--color-neutral-0);
    border-radius: 0 0 1rem 1rem;
    border: 1px solid var(--color-neutral-200);
    border-top: none;
}

.ship24-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ship24-timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-neutral-900);
}

.ship24-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.5rem;
    color: #3b82f6;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ship24-copy-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

.ship24-events-list {
    position: relative;
    padding-left: 2rem;
}

.ship24-events-list::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #3b82f6, #e5e7eb);
}

.ship24-event {
    position: relative;
    padding-bottom: 1.5rem;
}

.ship24-event:last-child {
    padding-bottom: 0;
}

.ship24-event-marker {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e5e7eb;
    z-index: 1;
}

.ship24-event:first-child .ship24-event-marker {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.ship24-event.delivered .ship24-event-marker {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.ship24-event-content {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-200);
    border-radius: 0.5rem;
    padding: 1rem;
}

.ship24-event:first-child .ship24-event-content {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.ship24-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ship24-event-status {
    font-weight: 600;
    color: var(--color-neutral-900);
}

.ship24-event-time {
    font-size: 0.85rem;
    color: var(--color-neutral-500);
}

.ship24-event-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--color-neutral-600);
}

.ship24-event-courier-tag {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-neutral-100);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-neutral-600);
}

/* Error state */
.ship24-error {
    text-align: center;
    padding: 2rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 1rem;
    color: #ef4444;
}

.ship24-error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.ship24-retry-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

/* No events state */
.ship24-no-events {
    text-align: center;
    padding: 2rem;
    color: var(--color-neutral-500);
}

/* Responsive */
@media (max-width: 640px) {
    .ship24-result-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .ship24-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ship24-countdown {
        width: 140px;
        height: 140px;
    }

    .ship24-countdown-number {
        font-size: 2.5rem;
    }
}
