/* ============================
   Video Uniqueifier — Styles
   Premium dark theme with glassmorphism
   ============================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(22, 22, 35, 0.8);
    --bg-card-hover: rgba(30, 30, 50, 0.9);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #7c5cfc;
    --accent-hover: #9578ff;
    --accent-glow: rgba(124, 92, 252, 0.3);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: all 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Animated mesh gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124, 92, 252, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(52, 211, 153, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(124, 92, 252, 0.03) 0%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.app {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Back Link === */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 16px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

.back-link svg {
    transition: transform 0.2s;
}

.back-link:hover svg {
    transform: translateX(-3px);
}

/* === Header === */
.header {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.error {
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.step-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #5a3fd9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.step-done {
    background: linear-gradient(135deg, var(--success), #2ac77c);
}

/* === Drop Zone === */
.drop-zone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.05);
}

.drop-zone.drag-over {
    transform: scale(1.01);
}

.drop-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.drop-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.drop-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.drop-formats {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

/* === File List === */
.file-list {
    margin-top: 20px;
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.file-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.file-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.file-item-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.file-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-size {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.file-item-remove:hover {
    color: var(--error);
    background: var(--error-bg);
}

/* === Profiles === */
.profiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .profiles {
        grid-template-columns: 1fr;
    }
}

.profile-card {
    position: relative;
    cursor: pointer;
}

.profile-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profile-content {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-align: center;
}

.profile-card:hover .profile-content {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.profile-card.selected .profile-content,
.profile-card input:checked+.profile-content {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.08);
    box-shadow: 0 0 20px var(--accent-glow);
}

.profile-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.profile-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-content>p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.profile-content ul {
    list-style: none;
    text-align: left;
    margin-bottom: 16px;
}

.profile-content li {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 3px 0;
    padding-left: 16px;
    position: relative;
}

.profile-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 11px;
}

.profile-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-light {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
}

.tag-medium {
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent-hover);
}

.tag-max {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #5a3fd9);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

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

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.btn-icon {
    font-size: 18px;
}

.action-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* === Progress === */
.progress-container {
    padding: 8px 0;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 4px;
    transition: width 0.4s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-info span:first-child {
    font-weight: 600;
    color: var(--accent);
}

.progress-current {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* === Results === */
.results-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.summary-card {
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border);
}

.summary-card .value {
    font-size: 28px;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.summary-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-success .value {
    color: var(--success);
}

.summary-total .value {
    color: var(--accent);
}

.summary-failed .value {
    color: var(--error);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

/* === Result Item Card (new comparison layout) === */
.result-item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    animation: fadeInUp 0.4s ease;
}

.result-item-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.035);
}

.result-error-card {
    border-color: rgba(248, 113, 113, 0.2);
}

/* Header row: status + download */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.result-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.result-status-badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.result-status-badge.error {
    background: var(--error-bg);
    color: var(--error);
}

.result-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #5a3fd9);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.result-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* Filename row */
.result-filename-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.result-original-name {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40%;
}

.result-arrow {
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.result-new-name {
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40%;
}

/* Before / After comparison */
.result-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.comparison-col {
    padding: 16px;
}

.comparison-before {
    background: rgba(255, 255, 255, 0.02);
}

.comparison-after {
    background: rgba(52, 211, 153, 0.03);
}

.comparison-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.comparison-before .comparison-label {
    color: var(--text-muted);
}

.comparison-after .comparison-label {
    color: var(--success);
}

.comparison-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.stat-key {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.stat-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.hash-val {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 500;
}

.hash-new {
    color: var(--success);
}

.hash-same {
    color: var(--error);
}

.stat-change {
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.stat-up {
    color: var(--warning);
}

.stat-down {
    color: var(--success);
}

.comparison-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.divider-icon {
    font-size: 20px;
    opacity: 0.9;
}

/* Verdict */
.result-verdict {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    text-align: center;
}

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

.verdict-warning {
    background: rgba(251, 191, 36, 0.08);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.verdict-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Processing details row */
.result-details {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.detail-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-icon {
    font-size: 14px;
}

/* Applied techniques */
.result-techniques {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.technique-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(124, 92, 252, 0.08);
    border: 1px solid rgba(124, 92, 252, 0.15);
    border-radius: 4px;
    font-size: 10px;
    color: var(--accent-hover);
    font-family: 'SF Mono', 'Fira Code', monospace;
    transition: var(--transition);
}

.technique-badge:hover {
    background: rgba(124, 92, 252, 0.15);
    border-color: rgba(124, 92, 252, 0.3);
}

/* Mobile responsiveness for comparison */
@media (max-width: 600px) {
    .result-comparison {
        grid-template-columns: 1fr;
    }

    .comparison-divider {
        width: 100%;
        height: 32px;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .result-filename-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-original-name,
    .result-new-name {
        max-width: 100%;
    }

    .result-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* === Source Tabs === */
.source-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.source-tab {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.source-tab:first-child {
    border-right: 1px solid var(--border);
}

.source-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.source-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--accent), #5a3fd9);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.tab-icon {
    font-size: 16px;
}

/* === Instagram Panel === */
.ig-cookies-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    gap: 12px;
    flex-wrap: wrap;
}

.ig-cookies-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.ig-cookies-ok {
    color: var(--success);
}

.ig-cookies-warn {
    color: #f0ad4e;
}

.ig-cookies-err {
    color: var(--error);
}

.ig-cookies-actions {
    display: flex;
    gap: 8px;
}

.ig-cookies-upload-label {
    cursor: pointer;
}

.ig-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.ig-input-wrapper {
    flex: 1;
    position: relative;
}

.ig-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
}

.ig-url-input {
    width: 100%;
    padding: 13px 16px 13px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.ig-url-input:focus {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.05);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.ig-url-input::placeholder {
    color: var(--text-muted);
}

.ig-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.ig-error {
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 13px;
    margin-bottom: 16px;
}

/* === Instagram Video Grid === */
.ig-videos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.ig-videos-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.ig-select-controls {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.ig-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.ig-video-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.ig-video-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.ig-video-card.selected {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.06);
    box-shadow: 0 0 16px var(--accent-glow);
}

.ig-video-thumb {
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 200px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ig-no-thumb {
    font-size: 32px;
    opacity: 0.4;
}

.ig-video-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    transition: var(--transition);
}

.ig-video-card.selected .ig-video-check {
    border-color: var(--success);
    background: var(--success);
}

.ig-video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.ig-video-info {
    padding: 10px 12px;
}

.ig-video-title {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.ig-video-views {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.ig-video-caption-preview {
    font-size: 10px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    margin-top: 3px;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .ig-input-row {
        flex-direction: column;
    }

    .ig-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--accent-hover);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === Animations === */
.card {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Instagram Result Metadata === */
.ig-result-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    margin: 16px 0;
    padding: 16px;
    background: rgba(131, 58, 180, 0.06);
    border: 1px solid rgba(131, 58, 180, 0.15);
    border-radius: var(--radius-md);
}

@media (max-width: 640px) {
    .ig-result-meta {
        grid-template-columns: 1fr;
    }
}

.ig-cover-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 200px;
}

.ig-cover-label,
.ig-caption-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ig-cover-img {
    width: 180px;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ig-cover-dl {
    width: 100%;
    text-align: center;
}

.ig-caption-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ig-caption-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: all;
    border: 1px solid var(--border);
}

.ig-caption-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Ghost / small buttons */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

/* ig-hint block */
.ig-hint {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
    line-height: 1.5;
}

/* === New IG Header Styles === */
.ig-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.ig-videos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.ig-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 12px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.ig-select:hover {
    border-color: var(--accent);
}

.ig-sort-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ig-min-views {
    width: 140px;
}

.ig-min-views::placeholder {
    color: var(--text-muted);
    font-size: 12px;
}

/* Remove spinner arrows in number input */
.ig-min-views::-webkit-inner-spin-button,
.ig-min-views::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ig-min-views {
    -moz-appearance: textfield;
}

.ig-video-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.ig-video-date {
    opacity: 0.7;
}

/* === Live Results === */
.live-results {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.5s ease;
}

.live-results-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 20px;
}

.results-list.live-results-list {
    gap: 16px;
}

/* Fix for thumbnails not showing due to CORS/Referrer */
.ig-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ig-video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}