/* Navigation Tabs (Shared style, fits both SongFetch and VideoFetch since it's imported) */
.app-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.2rem;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.nav-item svg {
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.nav-item:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:hover svg {
    opacity: 1;
}

/* SongFetch active tab theme */
.nav-item.active {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #a855f7;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

/* VideoFetch active tab theme */
.videofetch-theme .nav-item.active {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #f43f5e;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.15);
}

/* ==========================================
   VIDEOFETCH THEME OVERRIDES
   ========================================== */
.videofetch-theme {
    --color-primary: #f43f5e;
    --color-primary-glow: rgba(244, 63, 94, 0.3);
    --color-gradient: linear-gradient(135deg, #f43f5e 0%, #fb7185 50%, #fda4af 100%);
    --theme-glow-1: radial-gradient(circle, rgba(244, 63, 94, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    --theme-glow-2: radial-gradient(circle, rgba(251, 113, 133, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}

.videofetch-theme .glow-1 {
    background: var(--theme-glow-1);
}

.videofetch-theme .glow-2 {
    background: var(--theme-glow-2);
}

.videofetch-theme .logo svg {
    stroke: #f43f5e;
    filter: drop-shadow(0px 4px 12px rgba(244, 63, 94, 0.4));
}

.videofetch-theme .search-btn {
    background: var(--color-gradient);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.25);
}

.videofetch-theme .search-btn:hover {
    box-shadow: 0 6px 24px rgba(244, 63, 94, 0.4);
}

.videofetch-theme .progress-bar-fill {
    background: var(--color-gradient);
    box-shadow: 0 0 12px var(--color-primary);
}

.videofetch-theme .download-btn {
    background: var(--color-gradient);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.25);
}

.videofetch-theme .download-btn:hover {
    box-shadow: 0 6px 24px rgba(244, 63, 94, 0.4);
}

/* ==========================================
   VIDEO CARD SPECIFICS
   ========================================== */
.video-card {
    display: flex;
    gap: 1.5rem;
}

.video-thumbnail-container {
    flex-shrink: 0;
    width: 220px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.video-thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-secondary);
    letter-spacing: 0.05em;
    z-index: 5;
}

.platform-info-text svg {
    color: var(--color-primary);
}

/* Quality dropdown styles */
.quality-selector-container {
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selector-label {
    font-family: var(--font-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1.1rem;
    color: var(--color-text);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.12);
}

.custom-select-trigger:focus-visible,
.custom-select-wrapper.open .custom-select-trigger {
    outline: none;
    border-color: #f43f5e;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.selected-quality-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.selected-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-quality-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.selected-size-pill {
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.07);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.quality-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-4k {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.badge-2k {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #ffffff;
}

.badge-hd {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
}

.badge-sd {
    background: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

.badge-audio {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.select-arrow {
    color: var(--color-text-muted);
    transition: transform 0.25s ease, color 0.25s ease;
}

.custom-select-wrapper.open .select-arrow {
    color: #f43f5e;
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #0f111a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-options.hidden {
    display: none;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #e2e8f0;
}

.custom-option-item:hover {
    background: rgba(244, 63, 94, 0.12);
    color: #ffffff;
}

.custom-option-item.selected {
    background: rgba(244, 63, 94, 0.18);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #ffffff;
}

.option-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.option-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.option-size {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
}

.option-check {
    opacity: 0;
    color: #f43f5e;
    transition: opacity 0.15s ease;
}

.custom-option-item.selected .option-check {
    opacity: 1;
}

/* Custom scrollbar for options popup */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}
.custom-select-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}
.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .video-thumbnail-container {
        width: 100%;
        max-width: 100%;
    }
    
    .quality-selector-container {
        align-items: stretch;
    }
    
    .select-wrapper {
        max-width: 100%;
    }
}
