/*
Theme Name: YouTube Thumbnail Downloader
Description: A modern, customizable WordPress theme for YouTube thumbnail downloading with dark mode, glassmorphism effects, and neon accents.
Version: 1.0.0
Author: Your Name
Text Domain: yt-thumbnail-downloader
*/

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Design System Variables */
:root {
    /* Dark Theme Base */
    --background: #0f0f1b;
    --foreground: #f1f5f9;
    --card: #1e1e2e;
    --card-foreground: #e2e8f0;
    --popover: #1e1e2e;
    --popover-foreground: #e2e8f0;
    --primary: #8b5cf6;
    --primary-foreground: #f1f5f9;
    --secondary: #334155;
    --secondary-foreground: #cbd5e1;
    --muted: #475569;
    --muted-foreground: #94a3b8;
    --accent: #3b82f6;
    --accent-foreground: #f1f5f9;
    --destructive: #ef4444;
    --destructive-foreground: #f1f5f9;
    --border: #334155;
    --input: #1e293b;
    --ring: #8b5cf6;
    --radius: 1rem;
    
    /* Neon Colors */
    --neon-blue: #3b82f6;
    --neon-violet: #8b5cf6;
    --neon-cyan: #06b6d4;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-backdrop: blur(20px);
    
    /* Gradients */
    --gradient-neon: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-violet) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    
    /* Shadows & Effects */
    --shadow-neon: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 40px rgba(139, 92, 246, 0.2);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5);
    
    /* Animations */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-glow: all 0.3s ease-in-out;
}

/* Light theme overrides */
.theme-light {
    --background: #ffffff;
    --foreground: #1e293b;
    --card: #f8fafc;
    --card-foreground: #334155;
    --popover: #ffffff;
    --popover-foreground: #1e293b;
    --primary: #8b5cf6;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --secondary-foreground: #334155;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #334155;
    --destructive: #ef4444;
    --destructive-foreground: #ffffff;
    --border: #e2e8f0;
    --input: #ffffff;
    --ring: #8b5cf6;
    --glass-bg: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.site-header {
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

.site-header .container {
    text-align: center;
    position: relative;
    z-index: 1;
}

.site-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    font-weight: bold;
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-title svg {
    width: 3rem;
    height: 3rem;
    color: var(--neon-blue);
    margin-right: 1rem;
}

.site-description {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    max-width: 32rem;
    margin: 0 auto 2rem;
}

/* Glass morphism components */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-glass);
}

/* Input Section */
.input-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-glass);
}

.input-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.youtube-input {
    flex: 1;
    padding: 1.5rem;
    font-size: 1.125rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--foreground);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.youtube-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.youtube-input::placeholder {
    color: var(--muted-foreground);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    white-space: nowrap;
}

.btn-neon {
    background: var(--gradient-neon);
    color: white;
    box-shadow: var(--shadow-neon);
}

.btn-neon:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-neon);
}

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    color: var(--foreground);
}

.btn-glass:hover {
    background: var(--glass-border);
}

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

/* Thumbnail Grid */
.thumbnails-container {
    animation: fadeIn 0.5s ease-out;
}

.thumbnails-header {
    text-align: center;
    margin-bottom: 2rem;
}

.thumbnails-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.video-id {
    font-family: 'Courier New', monospace;
    color: var(--neon-blue);
}

.thumbnails-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .input-group {
        flex-direction: row;
    }
}

/* Thumbnail Cards */
.thumbnail-card {
    background: var(--gradient-card);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    transition: var(--transition-smooth);
}

.thumbnail-card:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.thumbnail-card.available:hover {
    transform: translateY(-2px);
}

.thumbnail-image-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.thumbnail-image {
    width: 100%;
    height: auto;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: var(--transition-smooth);
}

.thumbnail-card:hover .thumbnail-image {
    transform: scale(1.05);
}

.thumbnail-info {
    text-align: center;
    margin-bottom: 1rem;
}

.thumbnail-quality {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.thumbnail-size {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.thumbnail-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-sm {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.btn-download {
    flex: 1;
}

/* Not Available State */
.thumbnail-unavailable {
    text-align: center;
    padding: 3rem 0;
}

.unavailable-icon {
    width: 3rem;
    height: 3rem;
    color: var(--muted-foreground);
    opacity: 0.5;
    margin: 0 auto 1rem;
}

.unavailable-text {
    color: var(--destructive);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* Widget Areas */
.widget-area {
    margin: 2rem 0;
}

.widget {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-glass);
}

.widget-title {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
}

.footer-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-glass);
}

.footer-text {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer-subtext {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dark-mode-toggle:hover {
    background: var(--glass-border);
}

/* Responsive Design */
@media (max-width: 767px) {
    .site-title {
        flex-direction: column;
        font-size: 2rem;
    }
    
    .site-title svg {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .input-section {
        padding: 1.5rem;
    }
    
    .youtube-input {
        padding: 1rem;
    }
    
    .btn {
        padding: 1rem 1.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.youtube-input:focus,
.btn:focus {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
}