:root {
    --bg-dark: #050914;
    --cyan-primary: #00f2fe;
    --cyan-dark: #0081a7;
    --cyan-glow: rgba(0, 242, 254, 0.4);
    --glass-bg: rgba(20, 25, 40, 0.6);
    --glass-border: rgba(0, 242, 254, 0.2);
    --text-main: #f0f4f8;
    --text-muted: #94a3b8;
    --danger: #ef4444;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animations */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

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

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

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

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

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--cyan-primary);
    text-shadow: 0 0 20px var(--cyan-glow);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 0.5rem;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 242, 254, 0.15);
}

/* Search Area */
.search-card {
    margin-bottom: 2rem;
}

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

input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--cyan-primary);
    box-shadow: 0 0 15px var(--cyan-glow);
    background: rgba(255, 255, 255, 0.08);
}

button {
    background: linear-gradient(135deg, var(--cyan-primary) 0%, var(--cyan-dark) 100%);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 0 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--cyan-glow);
}

button:active {
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-msg {
    color: var(--danger);
    margin-top: 1rem;
    text-align: center;
    font-size: 0.95rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Results Area */
.results-container {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.video-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.thumbnail-wrapper {
    position: relative;
    width: 240px;
    height: 135px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.thumbnail-wrapper:hover img {
    transform: scale(1.05);
}

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

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

#video-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
    transform: none;
    box-shadow: none;
}

.tab-btn.active {
    background: var(--cyan-primary);
    color: #000;
    border-color: var(--cyan-primary);
    box-shadow: 0 0 15px var(--cyan-glow);
}

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

.tab-content.active {
    display: grid;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Format Cards */
.format-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.format-card:hover {
    background: rgba(0, 242, 254, 0.05);
    border-color: var(--cyan-primary);
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.1);
}

.format-quality {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cyan-primary);
}

.format-details {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.format-size {
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
}

.download-btn {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.95rem;
    border-radius: 8px;
    margin-top: auto;
}

@media (max-width: 768px) {
    .video-info {
        flex-direction: column;
    }
    .thumbnail-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    .input-group {
        flex-direction: column;
    }
    button {
        padding: 1rem;
    }
}

