:root {
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.3);
    --secondary: #ec4899;
    --bg-dark: #0b0e14;
    --sidebar-bg: rgba(17, 24, 39, 0.8);
    --card-bg: #1a1f2e;
    --text-main: #f3f4f6;
    --text-dim: #9ca3af;
    --border: rgba(255, 255, 255, 0.05);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1.2rem;
    left: 1.2rem;
    z-index: 1002;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 40%);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    left: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-main);
}

.nav-link.active {
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Main Content */
.main {
    margin-left: 240px;
    flex: 1;
    padding: 2.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header, .search-container, .results-grid, #loader {
    align-self: center;
    width: 100%;
}

.header {
    margin-bottom: 3rem;
    text-align: center;
    max-width: 800px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Search Box */
.search-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 3rem;
    max-width: 800px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    background: #0b0e14;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    outline: none;
}

.btn-search {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    justify-content: center;
}

.video-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.video-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.3);
}

.thumb-container {
    position: relative;
    aspect-ratio: 9/16;
    background: #000;
}

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

.video-info {
    padding: 1.5rem;
    background: linear-gradient(to top, var(--card-bg) 80%, transparent);
}

.video-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.author-name {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Download Button Modern */
.btn-download {
    width: 100%;
    background: #252a3d;
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    text-decoration: none;
}

.btn-download:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-download i {
    font-size: 1.1rem;
}

/* Status overlays */
.loading-overlay {
    text-align: center;
    padding: 4rem;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        width: 280px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        flex-direction: column;
        padding: 2rem 1.5rem;
        border-right: 1px solid var(--border);
        border-top: none;
        justify-content: flex-start;
        align-items: stretch;
        background: var(--bg-dark);
        z-index: 1001;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }

    .logo {
        display: flex;
        margin-bottom: 2.5rem;
    }

    .nav-menu {
        display: block;
        width: 100%;
        margin: 0;
    }

    .nav-item {
        margin-bottom: 0.5rem;
    }

    .nav-link {
        padding: 0.8rem 1rem;
        gap: 12px;
        flex-direction: row;
        font-size: 0.9rem;
        justify-content: flex-start;
    }

    .nav-link i {
        font-size: 1.1rem;
    }

    .main {
        margin-left: 0;
        margin-bottom: 0;
        padding: 5rem 1rem 2rem;
    }

    .header {
        margin-bottom: 2rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .search-container {
        padding: 1.2rem;
        margin-bottom: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
    }

    .input-wrapper input {
        background: #0b0e14;
        border-radius: 12px;
        border: 1px solid var(--border);
        margin-bottom: 10px;
        width: 100%;
    }

    .btn-search {
        width: 100%;
        padding: 12px;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-card {
        border-radius: 15px;
    }

    .video-info {
        padding: 1rem;
    }
}

.platform-info { margin-top: 1rem; padding: 1rem; background: rgba(255, 255, 255, 0.05); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; gap: 12px; animation: slideIn 0.3s ease; }
.platform-info i { font-size: 1.5rem; }
.platform-info div p { font-size: 0.85rem; color: var(--text-dim); line-height: 1.4; }
.platform-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
