/* ========================================
   Video Downloader - kolayo.net
   Modern Glassmorphism Design
======================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --youtube: #ff0000;
    --tiktok: #000000;
    --instagram: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Sidebar Ads */
.sidebar-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    max-height: 600px;
    z-index: 100;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.sidebar-ad:hover {
    opacity: 1;
}

.sidebar-ad-left {
    left: 20px;
}

.sidebar-ad-right {
    right: 20px;
}

/* Hide sidebar ads on smaller screens */
@media (max-width: 1400px) {
    .sidebar-ad {
        display: none;
    }
}

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

.bg-gradient {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(2%, 2%) rotate(1deg);
    }

    50% {
        transform: translate(-1%, 3%) rotate(-1deg);
    }

    75% {
        transform: translate(3%, -2%) rotate(2deg);
    }
}

.bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particleFloat 30s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50px);
    }
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

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

.logo i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
}

.logo .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* SEO Content Section */
.seo-content {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.seo-content article {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.seo-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.seo-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .seo-content {
        grid-template-columns: 1fr;
    }

    .lang-switcher {
        position: static;
        text-align: right;
        margin-bottom: 20px;
    }
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.tab[data-platform="youtube"].active {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
}

.tab[data-platform="tiktok"].active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.tab[data-platform="instagram"].active {
    background: linear-gradient(135deg, rgba(240, 148, 51, 0.2), rgba(204, 35, 102, 0.2));
    color: #e1306c;
}

.tab i {
    font-size: 1.2rem;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1rem;
}

#videoUrl {
    width: 100%;
    padding: 16px 100px 16px 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

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

#videoUrl:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.paste-btn {
    position: absolute;
    right: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.paste-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
}

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

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px;
}

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

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

.loading-state p {
    color: var(--text-secondary);
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    margin-top: 20px;
}

.error-state i {
    font-size: 2rem;
    color: #ef4444;
}

.error-state p {
    color: #fca5a5;
    text-align: center;
}

/* Results Section */
.results-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.video-preview {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.video-preview img {
    width: 100%;
    height: auto;
    display: block;
}

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

.video-info {
    margin-bottom: 20px;
}

.video-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.video-author {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.download-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.download-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.download-option .quality {
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-option .quality-badge {
    padding: 4px 10px;
    background: var(--primary);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.download-option .quality-badge.hd {
    background: linear-gradient(135deg, #10b981, #059669);
}

.download-option .quality-badge.audio {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.download-option .format {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.download-option .download-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.download-option:hover .download-icon {
    transform: scale(1.1);
    background: var(--primary-light);
}

.direct-badge {
    padding: 2px 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.no-formats {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* Service Badge */
.service-badge {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Embed Download Button */
.embed-download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.embed-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.5);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 80vh;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.modal-body {
    height: calc(100% - 60px);
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    background: white;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    font-size: 1.5rem;
}

.feature h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

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

/* How to Use */
.how-to-use {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 40px;
    text-align: center;
}

.how-to-use h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.step-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 140px;
}

.step-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

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

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

.disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem !important;
    color: var(--text-muted);
}

.disclaimer i {
    color: var(--accent);
}

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

    .logo {
        font-size: 1.6rem;
    }

    .logo i {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .main-card {
        padding: 24px 20px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        justify-content: flex-start;
        padding: 14px 16px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .steps {
        flex-direction: column;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    .step p {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }

    #videoUrl {
        padding: 14px 80px 14px 44px;
        font-size: 0.95rem;
    }

    .download-btn {
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    .paste-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}