:root {
    --bg-color: #0f0f0f;
    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --accent-primary: #ff0000;
    --accent-secondary: #cc0000;
    --glass-bg: rgba(39, 39, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --danger: #ff0000;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    animation: float 10s ease-in-out infinite alternate;
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    animation: float 12s ease-in-out infinite alternate-reverse;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    color: #ff0000;
    -webkit-text-fill-color: #ff0000; /* Reset gradient for icon */
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Search Section */
.search-section {
    position: relative;
}

.input-group {
    display: flex;
    position: relative;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.3);
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 15px 15px 50px;
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
}

#url-input::placeholder {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.6);
}

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

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.download-btn {
    background: rgba(255, 0, 0, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 0, 0, 0.3);
    width: 100%;
}

.download-btn:hover {
    background: rgba(255, 0, 0, 0.25);
    border-color: var(--accent-primary);
}

/* Loading & Error */
.hidden {
    display: none !important;
}

#loading {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

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

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

#error-message {
    margin-top: 20px;
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: var(--danger);
    text-align: center;
}

/* Results Section */
.video-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 768px) {
    .video-info {
        flex-direction: row;
    }
}

.thumbnail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#video-thumbnail {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    object-fit: cover;
    aspect-ratio: 16/9;
}

#download-thumbnail {
    width: 100%;
}

.details {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#video-title {
    font-size: 1.4rem;
    line-height: 1.4;
    font-weight: 700;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.quality-badge {
    font-size: 0.8rem;
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

/* Ad Slots */
.ad-slot {
    width: 100%;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 20px 0;
    text-align: center;
    padding: 10px;
}

/* Side Ads */
.side-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    display: none;
    z-index: 10;
}

.left-ad {
    left: 20px;
}

.right-ad {
    right: 20px;
}

@media (min-width: 1300px) {
    .side-ad {
        display: block;
    }
}
