/* =============================================================
   MetaoFly — Target Size Video Compressor (Social & Email MB Reducer)
   Dedicated Scoped Stylesheet for 100% In-Browser Video Compressor
   ============================================================= */

/* ── 1. Top Header Banner ─────────────────────────────────── */
.svc-workspace {
    position: relative;
    box-sizing: border-box;
}

.svc-header-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-6) var(--space-8);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.svc-header-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
    filter: blur(40px);
}

.svc-badge-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: var(--space-2);
}

.svc-studio-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3.2vw, 2.2rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.svc-title-gradient {
    background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.svc-studio-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    max-width: 680px;
    line-height: 1.6;
    margin: 0;
}

.svc-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.svc-quick-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.svc-pill-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.svc-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: svcPulse 2s infinite ease-in-out;
}

@keyframes svcPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.25); }
}

/* ── 2. Upload Dropzone ────────────────────────────────────── */
.svc-upload-stage {
    width: 100%;
}

.svc-dropzone {
    border: 2px dashed rgba(6, 182, 212, 0.35);
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius-xl);
    padding: var(--space-16) var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.svc-dropzone:hover,
.svc-dropzone.svc-dragover {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(6, 182, 212, 0.15);
}

.svc-hidden-file-input {
    display: none;
}

.svc-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.svc-dropzone-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(6, 182, 212, 0.3);
    margin-bottom: var(--space-2);
}

.svc-dropzone-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.svc-dropzone-sub {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-3) 0;
}

.svc-browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
}

/* ── 3. Workspace 2-Column Grid ────────────────────────────── */
.svc-workspace-grid {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: var(--space-6);
    align-items: start;
}

.svc-col-config {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.svc-col-preview {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    position: sticky;
    top: calc(76px + var(--space-4));
}

/* ── 4. Configuration Cards & Controls ─────────────────────── */
.svc-info-card,
.svc-section-card,
.svc-gauge-card,
.svc-player-card,
.svc-progress-card,
.svc-result-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.svc-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.svc-info-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
}

.svc-remove-file-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.15s;
}

.svc-remove-file-btn:hover {
    color: #ef4444;
}

.svc-meta-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.svc-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.svc-meta-k {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.svc-meta-v {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.svc-highlight-size {
    color: #38bdf8;
    font-size: 15px;
    font-weight: 700;
}

.svc-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.svc-card-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 0 0 14px 0;
    line-height: 1.45;
}

/* Preset Buttons Grid */
.svc-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.svc-preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md, 8px);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 56px;
    justify-content: center;
    outline: none;
    user-select: none;
    box-sizing: border-box;
    position: relative;
}

/* Neutral Hover on Inactive Presets (No Cyan Clash) */
.svc-preset-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.svc-preset-btn:not(.active):hover .svc-preset-mb {
    color: #ffffff;
}

.svc-preset-btn:not(.active):hover .svc-preset-label {
    color: #cbd5e1;
}

.svc-preset-btn:active {
    transform: translateY(0);
}

/* Cyan Exclusively for Active Preset */
.svc-preset-btn.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(8, 145, 178, 0.35) 100%) !important;
    border-color: #06b6d4 !important;
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.4) !important;
}

.svc-preset-btn.active:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.28) 0%, rgba(8, 145, 178, 0.42) 100%) !important;
    border-color: #22d3ee !important;
    box-shadow: 0 0 22px rgba(6, 182, 212, 0.55) !important;
    transform: translateY(-2px);
}

.svc-preset-mb {
    font-size: 13.5px;
    font-weight: 700;
    color: #cbd5e1;
    display: block;
    transition: color 0.18s ease;
}

.svc-preset-label {
    font-size: 9.5px;
    color: var(--color-text-muted, #94a3b8);
    text-align: center;
    display: block;
    transition: color 0.18s ease;
}

.svc-preset-btn.active .svc-preset-mb {
    color: #22d3ee !important;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.svc-preset-btn.active .svc-preset-label {
    color: #a5f3fc !important;
}

.svc-input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.svc-input-with-unit input {
    padding-right: 50px;
}

.svc-unit-tag {
    position: absolute;
    right: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #06b6d4;
}

/* Option Pills */
.svc-form-item {
    margin-bottom: 14px;
}

.svc-form-item:last-child {
    margin-bottom: 0;
}

.svc-item-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.svc-pill-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.svc-fps-options .svc-option-pill {
    flex: 1;
}

.svc-option-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    outline: none;
    user-select: none;
    box-sizing: border-box;
    position: relative;
}

/* Neutral Hover on Inactive Pill (Clean White Lift, No Cyan Clash) */
.svc-option-pill:not(.active):hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.svc-option-pill:active {
    transform: translateY(0);
}

/* Cyan Exclusively for Active Pill */
.svc-option-pill.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(8, 145, 178, 0.35) 100%) !important;
    border-color: #06b6d4 !important;
    color: #22d3ee !important;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.4) !important;
}

.svc-option-pill.active:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.28) 0%, rgba(8, 145, 178, 0.45) 100%) !important;
    border-color: #22d3ee !important;
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.55) !important;
    transform: translateY(-1px);
}

.svc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.svc-trim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.svc-trim-dur-val {
    font-size: 11px;
    font-weight: 700;
    color: #06b6d4;
}

.svc-slider-sub {
    font-size: 12px;
    color: var(--color-text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Bitrate Gauge Card */
.svc-gauge-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: rgba(6, 182, 212, 0.25);
}

.svc-gauge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.svc-gauge-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.svc-quality-pill {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.svc-gauge-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.svc-gauge-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.svc-gm-k {
    font-size: 10px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.svc-gm-v {
    font-size: 14px;
    color: #ffffff;
    font-weight: 700;
}

.svc-start-compress-btn {
    width: 100%;
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.35);
    min-height: 52px;
}

.svc-start-compress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(6, 182, 212, 0.5);
}

/* ── 5. Right Column (Video Player & Comparison) ────────────── */
.svc-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.svc-player-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.svc-mini-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.svc-video-viewport {
    width: 100%;
    background: #000000;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svc-video-viewport video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Progress Card */
.svc-progress-card {
    border-color: rgba(6, 182, 212, 0.4);
    background: rgba(15, 23, 42, 0.9);
}

.svc-progress-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.svc-pulse-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(6, 182, 212, 0.2);
    border-top-color: #06b6d4;
    border-radius: 50%;
    animation: svcSpin 0.9s infinite linear;
}

@keyframes svcSpin {
    to { transform: rotate(360deg); }
}

.svc-progress-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 2px 0;
}

.svc-progress-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 0;
}

.svc-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.svc-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #10b981);
    transition: width 0.15s ease;
    border-radius: 999px;
}

.svc-progress-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-bottom: 14px;
}

.svc-cancel-btn {
    width: 100%;
}

/* Result Card */
.svc-result-card {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.svc-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.svc-success-check {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.svc-result-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 2px 0;
}

.svc-result-sub {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 0;
}

.svc-delta-box {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 16px;
}

.svc-delta-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.svc-delta-k {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.svc-delta-v {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.svc-highlight-green {
    color: #10b981;
}

.svc-delta-badge {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
}

.svc-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.svc-download-btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.svc-restart-btn {
    width: 100%;
}

/* ── 6. Mobile & Touch Responsive Breakpoints ──────────────── */
@media (max-width: 1024px) {
    .svc-workspace-grid {
        grid-template-columns: 1fr;
    }

    .svc-col-preview {
        position: static;
    }
}

@media (max-width: 768px) {
    .svc-header-banner {
        padding: var(--space-5);
    }

    .svc-preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .svc-gauge-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .svc-option-pill {
        padding: 8px 16px;
        min-height: 44px; /* Ergonomic 44px hit target */
    }

    .svc-preset-btn {
        min-height: 64px;
    }
}

@media (max-width: 480px) {
    .svc-meta-row {
        grid-template-columns: 1fr;
    }

    .svc-preset-grid {
        grid-template-columns: 1fr;
    }

    .svc-gauge-metrics {
        grid-template-columns: 1fr;
    }

    .svc-delta-box {
        flex-direction: column;
        gap: 8px;
    }
}
