:root {
    --bg-color: #0d0101;
    --sidebar-bg: #120303;
    --card-bg: #1a0505;
    --accent-red: #ff3b30;
    --accent-dark: #cc2e26;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-color: #2a0a0a;
    --input-bg: #220707;
    --hover-bg: #2d0a0a;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container.simplified {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
}

/* Ad Containers */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
}

/* Main Content */
.main-content {
    padding: 32px 24px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-text span {
    font-weight: 300;
    opacity: 0.8;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-red);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 59, 48, 0.3);
}

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

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

.btn-secondary.border-btn {
    border: 1px solid var(--border-color);
}

/* Content Area */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(to bottom, #fff, #999);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.downloader-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 32px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    margin: 0 auto;
    background-image: radial-gradient(circle at 0% 0%, rgba(255, 59, 48, 0.05) 0%, transparent 50%);
}

.input-wrapper {
    display: flex;
    gap: 16px;
}

input[type="text"] {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 18px 24px;
    border-radius: 16px;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

/* Result Section */
.result-container {
    max-width: 800px;
    margin: 40px auto;
    animation: fadeIn 0.5s ease-out;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.video-preview-card {
    display: flex;
    gap: 32px;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
    align-items: center;
}

.video-preview-card img {
    width: 240px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.video-meta h3 {
    margin-bottom: 12px;
    font-size: 1.4rem;
    line-height: 1.3;
}

.video-meta p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.option-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.option-card i {
    font-size: 2.2rem;
    color: var(--text-secondary);
}

.option-card.active {
    border-color: var(--accent-red);
    background: rgba(255, 59, 48, 0.08);
    box-shadow: 0 10px 20px rgba(255, 59, 48, 0.1);
}

.option-card.active i {
    color: var(--accent-red);
}

.option-card span {
    font-weight: 700;
    letter-spacing: 1px;
}

.format-selection {
    margin-bottom: 32px;
}

.format-selection label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 14px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.btn-large {
    width: 100%;
    justify-content: center;
    padding: 20px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    border-radius: 16px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 1, 1, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 24px;
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.2);
}

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

.loading-hint {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 80px;
    padding-bottom: 40px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dot {
    width: 4px;
    height: 4px;
    background: var(--border-color);
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    .hero-section h2 {
        font-size: 2.2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .video-preview-card {
        flex-direction: column;
        text-align: center;
    }

    .video-preview-card img {
        width: 100%;
        max-width: 300px;
    }
}