/* /public/global.css */
/* COMPLETE REPLACEMENT - Enhanced global design system for ShowSeeker */

/* Import Modern Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* CSS Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    font-family: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Glassmorphism Design System */
:root {
    /* Color System */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.125);
    --glass-backdrop: blur(16px) saturate(180%);

    --glass-card-bg: rgba(255, 255, 255, 0.9);
    --glass-card-border: rgba(255, 255, 255, 0.3);
    --glass-card-backdrop: blur(20px);

    /* Interactive States */
    --glass-hover-bg: rgba(255, 255, 255, 0.95);
    --glass-active-bg: rgba(255, 255, 255, 0.85);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing System */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-2xl: 2.5rem;
    --radius-3xl: 3rem;
}

/* Global Glass Effects */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-card-bg);
    backdrop-filter: var(--glass-card-backdrop);
    border: 1px solid var(--glass-card-border);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.glass-card:active {
    background: var(--glass-active-bg);
    transform: translateY(0);
}

/* Global Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-slide-up-delayed {
    animation: slideUp 0.6s ease-out 0.2s both;
}

.animate-pulse-soft {
    animation: pulseSoft 4s ease-in-out infinite;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.animate-bounce-gentle {
    animation: bounceGentle 2s ease-in-out infinite;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseSoft {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes bounceGentle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Global Utility Classes */
.gradient-bg {
    background: var(--primary-gradient);
}

.gradient-bg-secondary {
    background: var(--secondary-gradient);
}

.gradient-bg-accent {
    background: var(--accent-gradient);
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

/* Enhanced Form Styling */
.form-input {
    background: var(--glass-card-bg);
    border: 1px solid var(--glass-card-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.125rem;
    font-weight: 500;
    color: rgb(17, 24, 39);
    transition: all var(--transition-normal);
    outline: none;
}

.form-input:focus {
    background: var(--glass-hover-bg);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: rgb(156, 163, 175);
}

/* Enhanced Button Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    outline: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    background: rgb(99, 102, 241);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    background: rgb(79, 70, 229);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--glass-card-bg);
    color: rgb(99, 102, 241);
    border: 1px solid var(--glass-card-border);
    backdrop-filter: var(--glass-card-backdrop);
}

.btn-secondary:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-ghost {
    background: transparent;
    color: rgb(99, 102, 241);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Enhanced Card Styling */
.card {
    background: var(--glass-card-bg);
    backdrop-filter: var(--glass-card-backdrop);
    border: 1px solid var(--glass-card-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.card:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

.card-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(156, 163, 175, 0.2);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(17, 24, 39);
    margin-bottom: var(--space-sm);
}

.card-description {
    color: rgb(107, 114, 128);
    font-size: 1rem;
    line-height: 1.6;
}

/* Search Page Specific Styles */
.search-page {
    min-height: 100vh;
    background: var(--primary-gradient);
}

.search-input {
    background: var(--glass-card-bg);
    border: 1px solid var(--glass-card-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    font-size: 1.125rem;
    font-weight: 500;
    color: rgb(17, 24, 39);
    transition: all var(--transition-normal);
    outline: none;
}

.search-input:focus {
    background: var(--glass-hover-bg);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Result Item Styling */
.result-item {
    animation: slideUp 0.4s ease-out;
    animation-fill-mode: both;
}

.result-item:nth-child(1) { animation-delay: 0.1s; }
.result-item:nth-child(2) { animation-delay: 0.2s; }
.result-item:nth-child(3) { animation-delay: 0.3s; }
.result-item:nth-child(4) { animation-delay: 0.4s; }
.result-item:nth-child(5) { animation-delay: 0.5s; }

.live-indicator {
    position: relative;
    overflow: hidden;
}

.live-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.3), transparent);
    animation: shimmer 3s infinite;
}

/* Favorites Section */
.favorites-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.3s ease-out, margin 0.3s ease-out;
}

.favorites-section.expanded {
    max-height: 500px;
    padding: var(--space-xl);
    margin-top: var(--space-xl);
}

/* Navigation Styling */
.nav-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
    max-width: 400px;
}

.toast-success {
    background: rgb(34, 197, 94);
}

.toast-error {
    background: rgb(239, 68, 68);
}

.toast-warning {
    background: rgb(245, 158, 11);
}

.toast-info {
    background: rgb(59, 130, 246);
}

/* Responsive Design */
@media (max-width: 640px) {
    :root {
        --space-xs: 0.125rem;
        --space-sm: 0.25rem;
        --space-md: 0.75rem;
        --space-lg: 1rem;
        --space-xl: 1.25rem;
        --space-2xl: 2rem;
        --space-3xl: 2.5rem;
    }

    .card {
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
    }

    .form-input {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }

    .btn {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(17, 24, 39, 0.75);
        --glass-border: rgba(75, 85, 99, 0.3);
        --glass-card-bg: rgba(31, 41, 55, 0.9);
        --glass-card-border: rgba(75, 85, 99, 0.3);
        --glass-hover-bg: rgba(31, 41, 55, 0.95);
        --glass-active-bg: rgba(17, 24, 39, 0.85);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Keyboard Navigation */
.btn:focus-visible,
.form-input:focus-visible {
    outline: 2px solid rgb(99, 102, 241);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .glass-effect,
    .glass-card {
        background: white !important;
        backdrop-filter: none !important;
        border: 1px solid #e5e7eb !important;
    }

    .btn {
        background: #f3f4f6 !important;
        color: #111827 !important;
        border: 1px solid #d1d5db !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.95);
        --glass-card-bg: rgba(255, 255, 255, 0.98);
        --glass-border: rgba(0, 0, 0, 0.3);
        --glass-card-border: rgba(0, 0, 0, 0.2);
    }

    .form-input:focus,
    .btn:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
}