/* 
    PRO DOWNLOADER - CORE STYLES 
    Modern, Premium, Responsive
*/

:root {
    --primary: #4F46E5; /* Indigo */
    --primary-hover: #4338ca;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --light-bg: #f8fafc;
    --light-card: #ffffff;
    --text-main-light: #1e293b;
    --text-sub-light: #64748b;
    --text-main-dark: #f8fafc;
    --text-sub-dark: #94a3b8;
    --border-light: #e2e8f0;
    --border-dark: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Current Theme Variables (Default Light) */
    --bg-color: var(--light-bg);
    --card-color: var(--light-card);
    --text-main: var(--text-main-light);
    --text-sub: var(--text-sub-light);
    --border-color: var(--border-light);
}

body.dark-mode {
    --bg-color: var(--dark-bg);
    --card-color: var(--dark-card);
    --text-main: var(--text-main-dark);
    --text-sub: var(--text-sub-dark);
    --border-color: var(--border-dark);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: transform 0.3s ease, background 0.3s;
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode header { background: rgba(15, 23, 42, 0.9); }

header.hide { transform: translateY(-100%); }

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Desktop Nav */
.desktop-menu { display: none; gap: 2rem; }
.desktop-menu a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.desktop-menu a:hover { color: var(--primary); }

@media (min-width: 768px) { .desktop-menu { display: flex; align-items: center; } }

/* Right Actions */
.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* iPhone Style Toggle */
.theme-toggle {
    width: 50px;
    height: 28px;
    background: #e2e8f0;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}
body.dark-mode .theme-toggle { background: #4F46E5; }
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
body.dark-mode .theme-toggle::after { transform: translateX(22px); }

/* Hamburger */
.hamburger {
    width: 30px;
    height: 20px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
@media (min-width: 768px) { .hamburger { display: none; } }

.bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--card-color);
    padding: 2rem;
    transform: translateY(-150%);
    transition: transform 0.4s ease;
    z-index: 999;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-color);
}
.mobile-menu.active { transform: translateY(0); }
.mobile-menu a {
    display: block;
    padding: 1rem 0;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

/* --- HERO & TOOL --- */
.hero-section {
    padding: 140px 1.5rem 4rem;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.hero-subtitle {
    color: var(--text-sub);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Downloader Card */
.downloader-card {
    background: var(--card-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

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

@media (min-width: 640px) {
    .input-group { flex-direction: row; }
}

.url-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.url-input:focus { border-color: var(--primary); }

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-primary:hover { background: var(--primary-hover); }

/* Result Container */
#result-container {
    margin-top: 2rem;
    display: none; /* Hidden by default */
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

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

@media (min-width: 640px) {
    .preview-box { flex-direction: row; align-items: flex-start; }
}

.thumbnail {
    width: 100%;
    max-width: 300px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.info-side {
    flex: 1;
    text-align: left;
    width: 100%;
}

.video-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-info {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.8rem;
}

.dl-btn {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-main);
    text-decoration: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.dl-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

/* Loader */
.loader {
    display: none;
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    margin: 2rem auto;
}
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- FAQ SECTION --- */
.faq-section {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}
.section-title { text-align: center; margin-bottom: 2rem; font-size: 2rem; }
.accordion-item {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}
.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 0;
    background: none;
    border: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: left;
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: var(--text-sub);
}
.accordion-content p { padding-bottom: 1.5rem; }
.arrow { transition: transform 0.3s; }
.active .arrow { transform: rotate(180deg); }

/* --- FOOTER --- */
footer {
    background: var(--card-color);
    padding: 4rem 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: space-between;
}
.footer-col h4 { margin-bottom: 1.5rem; color: var(--text-main); }
.footer-links { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-links a { text-decoration: none; color: var(--text-sub); transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }
.social-icons { display: flex; gap: 1rem; margin-top: 1rem; }
.social-icons svg { width: 24px; height: 24px; fill: var(--text-sub); transition: fill 0.2s; }
.social-icons a:hover svg { fill: var(--primary); }
.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-sub);
    font-size: 0.9rem;
}