:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #a855f7;
    --accent: #f43f5e;
    --bg-dark: #0f172a;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border-radius: 10px;
}

.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
}

.header {
    padding: 3rem 1rem;
    text-align: center;
}

.main-logo {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    transition: var(--transition);
}

.main-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.premium-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-top: 1rem;
    letter-spacing: -1px;
}

.accent {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-content {
    max-width: 900px;
    padding-bottom: 5rem;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    animation: slideUp 0.6s ease-out;
}

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

.search-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.input-group-custom {
    display: flex;
    gap: 1rem;
}

.modern-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 16px;
    padding: 0 2rem;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
}

.btn-upload-trigger {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    width: 60px;
    color: var(--text-main);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
}

.btn-upload-trigger:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
}

.error-card {
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--accent);
    display: none;
}

/* Result Section Styles */
.video-info-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.thumbnail-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 280px;
}

.video-thumbnail {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.video-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
}

.video-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.channel-name {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Trim Options Styling */
.trim-options {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.trim-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.trim-inputs {
    display: flex;
    gap: 15px;
}

.trim-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trim-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.trim-input {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px 12px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.trim-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.trim-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
    opacity: 0.8;
}

.modern-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.5rem;
    border-radius: 14px;
    border: none;
    flex-wrap: nowrap;
}

.modern-tabs.nav {
    border-bottom: none;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 10px;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--glass);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.modern-table {
    color: var(--text-main);
    border-collapse: separate;
    border-spacing: 0 8px;
}

.modern-table tr {
    background: rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

.modern-table tr:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: scale(1.01);
}

.modern-table td, .modern-table th {
    padding: 1rem;
    border: none;
    vertical-align: middle;
}

.modern-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.modern-table tr td:first-child { border-radius: 12px 0 0 12px; }
.modern-table tr td:last-child { border-radius: 0 12px 12px 0; }

.btn-download-sm {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-download-sm:hover {
    background: var(--primary);
    color: white;
}

/* Loader Styles */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.4s ease;
}

#progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

#file-size-info {
    margin-top: 5px;
    opacity: 0.7;
}

.animation {
    display: none;
    padding: 3rem;
}

.loader-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.quality-tag {
    font-weight: 600;
    color: var(--text-main);
}

.premium-tag {
    color: #fbbf24 !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.format-ext {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-left: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.quality-info {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.badge-audio, .badge-no-audio {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-audio {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-no-audio {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.playlist-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.playlist-thumb {
    position: relative;
    aspect-ratio: 16/9;
}

.playlist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-duration {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.8);
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
}

.playlist-info {
    padding: 10px;
}

.playlist-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-channel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.playlist-quick-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(2px);
}

.playlist-thumb:hover .playlist-quick-actions {
    opacity: 1;
}

.playlist-quick-actions button {
    background: var(--primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.playlist-quick-actions button:hover {
    transform: scale(1.1);
    background: var(--secondary);
}

.playlist-quick-actions button[title*="Video"] {
    background: var(--secondary);
}

/* --- FIX MEDIA QUERIES --- */
@media (max-width: 992px) {
    .thumbnail-wrapper {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .playlist-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .bulk-actions { 
        width: 100%; 
        flex-direction: column; 
    }
    .video-info-container { 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
    }
    .thumbnail-wrapper { 
        width: 100%; 
    }
    .input-group-custom { 
        flex-direction: column; 
    }
    .btn-premium { 
        padding: 1rem; 
        justify-content: center; 
        width: 100%; 
    }
    .modern-tabs { 
        overflow-x: auto; 
        white-space: nowrap; 
    }
}