:root {
    --bg-dark: #09090b;
    --bg-card: #18181b;
    --bg-card-hover: #27272a;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #27272a;
    --radius-lg: 16px;
    --radius-md: 12px;
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Glow Effect */
.bg-glow {
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Navbar */
.navbar {
    border-bottom: 1px solid var(--border);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 24px;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to right, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: #a855f7;
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
    width: 100%;
}

.hero-section {
    text-align: center;
    margin-bottom: 50px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Box */
.downloader-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    margin-bottom: 60px;
}

.search-box-wrapper {
    position: relative;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px;
    transition: border-color 0.3s;
}

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

.input-icon {
    font-size: 24px;
    color: #ff0000;
    margin-left: 15px;
}

#ytUrlInput {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    padding: 15px 10px;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loader */
.loader-container {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

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

/* Result Card */
.result-panel {
    margin-top: 30px;
    border-top: 1px solid var(--border);
    padding-top: 30px;
}

.video-info-card {
    display: flex;
    gap: 20px;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
}

.thumbnail-wrapper {
    position: relative;
    width: 200px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail-wrapper img {
    width: 100%;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

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

.video-details h3 {
    font-size: 18px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-tag {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Formats Grid */
.section-heading {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.format-item {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.format-item:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.format-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.format-icon {
    font-size: 20px;
}

.format-icon.video { color: #ec4899; }
.format-icon.audio { color: #06b6d4; }

.format-label {
    font-weight: 600;
    font-size: 14px;
}

.dl-btn {
    background: rgba(255,255,255,0.05);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
}

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

/* Download Progress Panel */
.download-progress-panel {
    margin-top: 30px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 25px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-pulse {
    font-size: 24px;
    color: var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.truncate-text {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    margin-bottom: 5px;
}

.quality-badge {
    background: rgba(255,255,255,0.1);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--text-muted);
}

.percent-val {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.progress-bar-container {
    height: 8px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ec4899);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.status span {
    font-weight: 600;
}

.final-download-group {
    margin-top: 25px;
    text-align: center;
}

.success-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--success);
    color: white;
    text-decoration: none;
    padding: 15px 40px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s;
    width: 100%;
}

.success-btn:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.05);
}

.feature-icon {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Section Containers (How It Works & Supported Sites) */
.section-container {
    margin-top: 80px;
    padding-top: 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title-icon {
    color: var(--primary);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* How It Works Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.step-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 35px 25px 25px 25px;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s;
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.step-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), #ec4899);
    color: white;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.step-icon {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 18px;
}

.step-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.step-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Supported Sites Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.site-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}

.site-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.site-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.site-icon.youtube { color: #ff0000; background: rgba(255,0,0,0.1); }
.site-icon.facebook { color: #1877f2; background: rgba(24,119,242,0.1); }
.site-icon.instagram { color: #e4405f; background: rgba(228,64,95,0.1); }
.site-icon.tiktok { color: #00f2fe; background: rgba(0,242,254,0.1); }
.site-icon.twitter { color: #ffffff; background: rgba(255,255,255,0.1); }
.site-icon.vimeo { color: #1ab7ea; background: rgba(26,183,234,0.1); }

.site-info {
    flex: 1;
}

.site-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

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

.site-tag {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.more-sites-notice {
    margin-top: 30px;
    text-align: center;
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--border);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
}

.more-sites-notice i {
    color: var(--primary);
    margin-right: 6px;
}

footer {
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.disclaimer-text {
    font-size: 12px;
    line-height: 1.6;
    color: #71717a;
    margin-bottom: 15px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.disclaimer-text i {
    color: var(--primary);
    margin-right: 4px;
}

.copyright-text {
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .input-group { flex-direction: column; }
    .primary-btn { width: 100%; justify-content: center; }
    .video-info-card { flex-direction: column; }
    .thumbnail-wrapper { width: 100%; }
    .features-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
    .sites-grid { grid-template-columns: 1fr; }
    .site-card { flex-wrap: wrap; }
    .progress-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .percent-val { align-self: flex-end; }
    .progress-stats { flex-direction: column; gap: 10px; }
}

