/**
 * Universal Video Downloader - Luxury Dark Theme CSS
 */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe, #fd79a8);
    --success: #00d26a;
    --warning: #ffd93d;
    --error: #ff6b6b;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(108, 92, 231, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

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

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #6c5ce7 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #fd79a8 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #00d26a 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -50px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }

    75% {
        transform: translate(30px, 50px) scale(1.05);
    }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

/* Glass Card Effect */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px var(--shadow-color);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 15px 50px var(--shadow-color), 0 0 30px rgba(108, 92, 231, 0.1);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-badge {
    background: rgba(0, 210, 106, 0.15);
    border: 1px solid rgba(0, 210, 106, 0.3);
    color: var(--success);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.input-icon {
    padding: 12px 15px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

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

#urlInput::placeholder {
    color: var(--text-muted);
}

.input-hint {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(108, 92, 231, 0.1);
}

.btn-download {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    margin-top: 20px;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(108, 92, 231, 0.5);
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 50px;
}

.loading-spinner {
    margin-bottom: 20px;
}

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

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

/* Error Section */
.error-section {
    text-align: center;
    padding: 40px;
    border-color: rgba(255, 107, 107, 0.3);
}

.error-section>i {
    font-size: 3rem;
    color: var(--error);
    margin-bottom: 15px;
}

.error-section p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.error-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 15px;
}

.error-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

.error-tip {
    font-size: 0.95rem;
    color: var(--success);
    background: rgba(0, 210, 106, 0.1);
    padding: 12px 20px;
    border-radius: 10px;
    margin: 15px 0;
}

.error-github {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.error-github p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.error-reason {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 3px solid var(--warning);
    text-align: left;
    line-height: 1.6;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s;
}

.github-link:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.github-link i {
    font-size: 1.2rem;
}

/* Video Section */
.video-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    overflow: hidden;
}

.video-thumbnail {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
}

.video-platform {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.video-info {
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-uploader {
    color: var(--accent-secondary);
    font-weight: 500;
    margin-bottom: 5px;
}

.video-stats {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Download Options */
.download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: auto;
}

.option-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.option-group select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
}

.option-group select:focus {
    border-color: var(--accent-primary);
}

.format-toggle {
    display: flex;
    gap: 10px;
}

.format-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.format-btn.active {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.format-btn:hover:not(.active) {
    border-color: var(--text-muted);
}

/* Playlist Section */
.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.playlist-info h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.playlist-info p {
    color: var(--text-muted);
}

.playlist-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.playlist-actions select {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
}

.playlist-videos {
    display: grid;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.playlist-videos::-webkit-scrollbar {
    width: 6px;
}

.playlist-videos::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.playlist-videos::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.playlist-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    transition: all 0.3s;
}

.playlist-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

.playlist-item-thumb {
    width: 120px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.playlist-item-btn {
    align-self: center;
    padding: 10px 20px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.playlist-item-btn:hover {
    transform: scale(1.05);
}

/* Progress Section */
.progress-section {
    margin-top: 20px;
}

.progress-header {
    margin-bottom: 20px;
}

.progress-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-secondary);
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.progress-item-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: rgba(108, 92, 231, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.progress-item-info {
    flex: 1;
}

.progress-item-title {
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-item-status {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.progress-item-status.complete {
    color: var(--success);
}

.progress-item-status.error {
    color: var(--error);
}

/* Platforms Section */
.platforms-section {
    margin-top: 50px;
    text-align: center;
}

.platforms-section h3 {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.platforms-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.platform-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.platform-badge:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.platform-badge i {
    font-size: 1.1rem;
}

/* Footer */
.footer {
    margin-top: 60px;
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border-color);
}

.footer .social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer .social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer .social-links a:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

.footer .social-links a:nth-child(1):hover {
    color: #ffffff;
}

/* GitHub */
.footer .social-links a:nth-child(2):hover {
    color: #0077B5;
}

/* LinkedIn */
.footer .social-links a:nth-child(3):hover {
    color: #E4405F;
}

/* Instagram */
.footer .social-links a:nth-child(4):hover {
    color: #1877F2;
}

/* Facebook */

.footer .social-links a:nth-child(5):hover {
    color: #e31912;
}

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

.footer .disclaimer {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .title {
        font-size: 2rem;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .input-wrapper {
        flex-direction: column;
        padding: 15px;
    }

    #urlInput {
        width: 100%;
        text-align: center;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .video-card {
        grid-template-columns: 1fr;
    }

    .video-thumbnail {
        max-width: 100%;
    }

    .download-options {
        grid-template-columns: 1fr;
    }

    .playlist-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .playlist-actions {
        width: 100%;
        flex-direction: column;
    }

    .playlist-actions .btn-primary {
        width: 100%;
    }

    .playlist-item {
        flex-direction: column;
        text-align: center;
    }

    .playlist-item-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
}

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

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

.video-section:not(.hidden),
.playlist-section:not(.hidden),
.progress-section:not(.hidden) {
    animation: fadeIn 0.5s ease;
}