/**
 * Custom CSS for Video Downloader
 * Enhanced UI/UX with modern design patterns
 */

/* ============================================
   Custom Animations & Transitions
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes bounceGentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ============================================
   Enhanced Form Styles
   ============================================ */

#download-form {
    animation: fadeIn 0.6s ease-out;
}

#video-url {
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#video-url:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#download-btn {
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

#download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

#download-btn:active {
    transform: translateY(0);
}

#download-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#download-btn:active::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   Results Container Animations
   ============================================ */

#results-container {
    animation: slideUp 0.5s ease-out;
}

#video-info {
    animation: fadeIn 0.6s ease-out 0.2s both;
}

#quality-selection {
    animation: fadeIn 0.6s ease-out 0.4s both;
}

#download-section {
    animation: fadeIn 0.6s ease-out 0.6s both;
}

/* ============================================
   Quality Option Cards
   ============================================ */

.quality-option {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.quality-option::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;
}

.quality-option:hover::before {
    left: 100%;
}

.quality-option:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
}

.quality-option.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ============================================
   Loading States
   ============================================ */

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.spinner {
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Platform Badges
   ============================================ */

.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.platform-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Feature Cards
   ============================================ */

.feature-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Smooth Scrolling
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   Footer Spacing Fix
   ============================================ */

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    margin-top: auto;
    margin-bottom: 0;
    padding-bottom: 0;
    width: 100%;
}

/* Remove any spacing after footer */
body > footer:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure footer is at the bottom */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    height: auto;
}

footer {
    position: relative;
    bottom: 0;
    margin-top: 0;
}

/* Remove any white space */
body::after {
    display: none;
    content: none;
}

/* ============================================
   Focus States for Accessibility
   ============================================ */

*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Mobile Optimizations
   ============================================ */

@media (max-width: 640px) {
    .platform-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    #download-btn {
        font-size: 0.875rem;
        padding: 0.75rem 1.5rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ============================================
   Dark Mode Support (Future)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* ============================================
   Performance Optimizations
   ============================================ */

img {
    loading: lazy;
    decoding: async;
}

/* ============================================
   Custom Scrollbar (Webkit)
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   Utility Classes
   ============================================ */

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

