/* CSS Variables for Premium Dark Theme */
:root {
    --bg-color: #050505;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --primary: #8b5cf6; /* Vibrant Purple */
    --secondary: #3b82f6; /* Electric Blue */
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --glass-blur: blur(12px);
    --danger: #ef4444;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Custom cursor takes over */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Animated Background Orbs */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-color);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-main);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Premium Glass Navbar */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1300px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 15px 30px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

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

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
    position: relative;
}

.nav-menu a:hover {
    color: var(--text-main);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 5% 50px; /* Top padding to account for fixed navbar */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.pill-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: var(--text-muted);
    backdrop-filter: blur(5px);
    animation: fadeUp 1s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 0.2s forwards;
}

.hero-title span {
    display: block;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 0.4s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bento Card / Glass Panel */
.bento-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: var(--glass-blur);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.bento-card:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4);
}

/* Inputs and Buttons */
.input-group {
    display: flex;
    gap: 1rem;
}

input[type="url"] {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: none;
    position: relative;
    overflow: hidden;
    gap: 10px;
    z-index: 1;
    cursor: none; /* Inherits custom cursor */
    font-family: inherit;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-color);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
}

.error-message {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.5s ease-out;
}

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

.video-info {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.thumbnail {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
}

.video-details {
    flex: 1;
}

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

.video-duration {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Tabs */
.format-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
}

.tab-btn {
    background: none;
    padding: 0.5rem 0.5rem;
    color: var(--text-muted);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.8rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

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

.download-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.2);
}

.format-quality {
    font-size: 1.2rem;
    font-weight: 800;
}

.format-ext {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.format-size {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 500;
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    .input-group {
        flex-direction: column;
    }
    input[type="url"] {
        border-radius: 16px;
    }
    .btn {
        border-radius: 16px;
    }
    .video-info {
        flex-direction: column;
        text-align: center;
    }
    .thumbnail {
        width: 100%;
        height: auto;
    }
}
