/**
 * Video İndirici - Ana Stylesheet
 * Modern, gradient, glassmorphism tasarım
 */

/* ========================
   CSS VARIABLES
   ======================== */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #ec4899;
    --accent-light: #f472b6;
    
    /* Platform Colors */
    --youtube: #ff0000;
    --instagram: #e4405f;
    --tiktok: #00f2ea;
    --facebook: #1877f2;
    --twitter: #1da1f2;
    
    /* Neutrals */
    --bg-dark: #0f0f23;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.3);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ========================
   RESET & BASE
   ======================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

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

@keyframes gradientMove {
    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-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ========================
   CONTAINER
   ======================== */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================
   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-icon {
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

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

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

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

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

/* ========================
   MAIN CARD
   ======================== */
.main-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow);
    flex: 1;
}

/* ========================
   INPUT SECTION
   ======================== */
.input-section {
    margin-bottom: 24px;
}

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

.url-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    outline: none;
}

.url-input::placeholder {
    color: var(--text-muted);
}

.url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.analyze-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

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

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

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

.btn-icon {
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.analyze-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Platform Badges */
.input-hint {
    text-align: center;
}

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

.platform-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.platform-badge:hover {
    transform: scale(1.05);
}

.platform-badge.youtube { border-color: var(--youtube); color: var(--youtube); }
.platform-badge.instagram { border-color: var(--instagram); color: var(--instagram); }
.platform-badge.tiktok { border-color: var(--tiktok); color: var(--tiktok); }
.platform-badge.facebook { border-color: var(--facebook); color: var(--facebook); }
.platform-badge.twitter { border-color: var(--twitter); color: var(--twitter); }

/* ========================
   LOADING STATE
   ======================== */
.loading-state {
    text-align: center;
    padding: 48px;
}

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

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

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

/* ========================
   ERROR STATE
   ======================== */
.error-state {
    text-align: center;
    padding: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.error-state p {
    color: #fca5a5;
    margin-bottom: 16px;
}

.retry-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ========================
   RESULTS SECTION
   ======================== */
.results-section {
    animation: fadeInUp 0.4s ease-out;
}

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

/* Video Preview */
.video-preview {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.thumbnail {
    width: 180px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

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

.platform-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    width: fit-content;
}

.platform-indicator.youtube { background: var(--youtube); }
.platform-indicator.instagram { background: var(--instagram); }
.platform-indicator.tiktok { background: var(--tiktok); color: #000; }
.platform-indicator.facebook { background: var(--facebook); }
.platform-indicator.twitter { background: var(--twitter); }

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

.video-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.video-meta .author::before {
    content: '👤 ';
}

.video-meta .duration::before {
    content: '⏱️ ';
}

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

.formats-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.formats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.format-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.format-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.format-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.format-quality {
    font-weight: 600;
    min-width: 100px;
}

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

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

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

/* ========================
   HIDDEN UTILITY
   ======================== */
.hidden {
    display: none !important;
}

/* ========================
   FOOTER
   ======================== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer p {
    margin: 4px 0;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 640px) {
    .container {
        padding: 24px 16px;
    }
    
    .main-card {
        padding: 20px;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .analyze-btn {
        justify-content: center;
    }
    
    .video-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .platform-indicator {
        margin: 0 auto 8px;
    }
    
    .format-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .format-info {
        flex-direction: column;
        gap: 4px;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
}
