/**
 * JM Eventos - Modern Visual Effects CSS
 * Latest design trends and responsive techniques
 */

/* ===== CSS CUSTOM PROPERTIES (CSS Variables) ===== */
:root {
    /* Primary Colors */
    --primary: #ef0000;
    --primary-dark: #c1272d;
    --primary-light: #ff3333;
    --primary-alpha: rgba(239, 0, 0, 0.1);
    
    /* Neutral Colors */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Modern Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sunset: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    
    /* 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);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(239, 0, 0, 0.3);
    
    /* Modern Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: 10px;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    
    /* Border Radius */
    --radius-sm: 0.125rem;   /* 2px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-2xl: 1rem;      /* 16px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: 'Inter', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Poppins', 'Inter', sans-serif;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== MODERN GLASSMORPHISM COMPONENTS ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ===== MODERN NEUMORPHISM ===== */
.neomorphism {
    background: #f0f0f0;
    border-radius: var(--radius-2xl);
    box-shadow: 
        20px 20px 60px #d1d1d1,
        -20px -20px 60px #ffffff;
    transition: all var(--transition-smooth);
}

.neomorphism:hover {
    box-shadow: 
        15px 15px 40px #d1d1d1,
        -15px -15px 40px #ffffff;
    transform: translateY(-2px);
}

.neomorphism-inset {
    background: #f0f0f0;
    border-radius: var(--radius-2xl);
    box-shadow: 
        inset 8px 8px 16px #d1d1d1,
        inset -8px -8px 16px #ffffff;
}

/* ===== MODERN HOVER EFFECTS ===== */
.hover-lift {
    transition: all var(--transition-smooth);
    will-change: transform;
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.hover-glow {
    position: relative;
    transition: all var(--transition-smooth);
}

.hover-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    filter: blur(8px);
    transition: opacity var(--transition-smooth);
}

.hover-glow:hover::before {
    opacity: 0.7;
}

/* ===== MODERN BUTTONS ===== */
.btn-modern {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-weight: 600;
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition-bounce);
    overflow: hidden;
    isolation: isolate;
}

.btn-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    transition: transform var(--transition-smooth);
    z-index: -1;
}

.btn-modern:hover::before {
    transform: scale(1.05);
}

.btn-modern:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(239, 0, 0, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-ghost::before {
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
}

.btn-ghost:hover {
    color: var(--white);
}

.btn-ghost:hover::before {
    transform: scaleX(1);
}

/* ===== MODERN CARDS ===== */
.card-modern {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
    overflow: hidden;
    position: relative;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transition: left var(--transition-smooth);
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-modern:hover::before {
    left: 0;
}

/* ===== LOADING ANIMATIONS ===== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 2s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pulse-modern {
    animation: pulse-modern 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-modern {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== MODERN SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== PARALLAX SCROLL EFFECTS ===== */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    will-change: transform;
}

/* ===== MODERN GRID LAYOUTS ===== */
.grid-modern {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
    grid-auto-rows: masonry; /* Future CSS feature */
}

/* Fallback for masonry */
@supports not (grid-auto-rows: masonry) {
    .grid-masonry {
        columns: 3;
        column-gap: var(--space-lg);
    }
    
    .grid-masonry > * {
        break-inside: avoid;
        margin-bottom: var(--space-lg);
    }
}

/* ===== MODERN ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInScale {
    animation: fadeInScale 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-bounceIn {
    animation: bounceIn 0.8s ease-out;
}

/* ===== MODERN RESPONSIVE UTILITIES ===== */

/* Container Queries (when supported) */
@container (min-width: 400px) {
    .container-responsive {
        padding: var(--space-lg);
    }
}

@container (min-width: 600px) {
    .container-responsive {
        padding: var(--space-xl);
    }
}

/* Modern Media Queries */
@media (min-width: 640px) {
    .grid-modern {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (min-width: 768px) {
    .grid-modern {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid-modern {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (min-width: 1280px) {
    .grid-modern {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card-modern {
        border: 2px solid var(--gray-800);
    }
    
    .btn-modern {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1f2937;
        --black: #f9fafb;
        --gray-50: #374151;
        --gray-100: #4b5563;
        --gray-200: #6b7280;
        --gray-300: #9ca3af;
        --gray-400: #d1d5db;
        --gray-500: #e5e7eb;
        --gray-600: #f3f4f6;
        --gray-700: #f9fafb;
        --gray-800: #ffffff;
        --gray-900: #ffffff;
    }
    
    .glass-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Print Styles */
@media print {
    .hover-lift,
    .hover-glow,
    .btn-modern {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .glass,
    .glass-card {
        background: var(--white) !important;
        backdrop-filter: none !important;
    }
}