/* ============================================
   QUEUE PLAYER — Design system GUpload
   ============================================ */
:root {
    --primary: #00ff88;
    --primary-dim: rgba(0,255,136,0.10);
    --primary-glow: rgba(0,255,136,0.30);
    --secondary: #8247e5;

    --bg-base: #080c14;
    --bg-card: #111827;
    --bg-elevated: #1a2235;

    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.13);

    --text-primary: #f0f4f8;
    --text-secondary: #7a8ba0;
    --text-muted: #4a5568;

    --error: #ff4757;
    --warning: #ffa502;
    --info: #3b82f6;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-base);
    font-family: var(--font-body);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow: hidden;
}

/* Background grid */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Glow orb */
body::after {
    content: '';
    position: fixed;
    top: -100px; left: 50%;
    transform: translateX(-50%);
    width: 700px; height: 400px;
    background: radial-gradient(ellipse, rgba(0,255,136,0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   CONTAINER
   ============================================ */
.queue-container {
    width: 100%;
    max-width: 520px;
    position: relative;
    z-index: 1;
    animation: fadeUp 0.45s ease both;
}

/* ============================================
   HEADER
   ============================================ */
.queue-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.queue-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-dim);
    border: 1px solid rgba(0,255,136,0.2);
    color: var(--primary);
    padding: 5px 16px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.queue-badge i { font-size: 0.8rem; }

.queue-title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 4vw, 1.75rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.queue-video-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.75rem;
}
.queue-video-name i { color: var(--primary); flex-shrink: 0; }

/* ============================================
   QUEUE POSITION
   ============================================ */
.queue-position-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.queue-position-card.pending {
    border-color: rgba(0,255,136,0.2);
    color: var(--primary);
}
.queue-position-card.pending .pos-icon {
    background: var(--primary-dim);
    color: var(--primary);
    border-color: rgba(0,255,136,0.2);
}

.queue-position-card.processing {
    border-color: rgba(255,165,2,0.2);
    color: var(--warning);
}
.queue-position-card.processing .pos-icon {
    background: rgba(255,165,2,0.1);
    color: var(--warning);
    border-color: rgba(255,165,2,0.2);
}

.pos-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ============================================
   MAIN CARD
   ============================================ */
.queue-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}

.queue-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* Spinner */
.spinner-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.spinner-ring {
    width: 64px; height: 64px;
    position: relative;
}

.spinner-ring::before,
.spinner-ring::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.spinner-ring::before {
    inset: 0;
    border: 2px solid var(--border);
}

.spinner-ring::after {
    inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.spinner-inner {
    position: absolute;
    inset: 10px;
    border: 2px solid transparent;
    border-top-color: rgba(0,255,136,0.3);
    border-radius: 50%;
    animation: spin 1.8s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status message */
.status-msg {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    min-height: 1.4em;
    transition: var(--transition);
}

/* Progress bar */
.progress-track {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #00cc6a);
    border-radius: 2px;
    width: 0%;
    transition: width 0.6s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Steps */
.steps {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 0.855rem;
    transition: var(--transition);
}

.step-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.step.completed {
    border-color: rgba(0,255,136,0.15);
}
.step.completed .step-dot {
    background: var(--primary-dim);
    border: 1px solid rgba(0,255,136,0.3);
    color: var(--primary);
}
.step.completed .step-label { color: var(--text-primary); }

.step.active {
    border-color: rgba(0,255,136,0.25);
    background: rgba(0,255,136,0.04);
}
.step.active .step-dot {
    background: var(--primary);
    color: var(--bg-base);
    animation: pulse 1.5s ease-in-out infinite;
}
.step.active .step-label { color: var(--primary); font-weight: 600; }

.step.pending .step-dot {
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.step.pending .step-label { color: var(--text-muted); }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
    50% { box-shadow: 0 0 0 6px transparent; }
}

/* ETA */
.eta {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.eta i { color: var(--primary); }

/* ============================================
   ERROR STATE
   ============================================ */
.error-card {
    background: rgba(255,71,87,0.06);
    border: 1px solid rgba(255,71,87,0.2);
    border-left: 3px solid var(--error);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}
.error-card h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--error);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.error-card p { color: var(--text-secondary); font-size: 0.875rem; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .queue-card { padding: 1.5rem 1.25rem; }
    .queue-title { font-size: 1.25rem; }
}