/* main.css - Enhanced Core Styles for Juegos de la Unidad - Celaya 2025 */

:root {
    --primary-red: #d32f2f;
    --primary-gold: #ffd700;
    --dark-red: #b71c1c;
    --light-red: #ffebee;
    --white: #ffffff;
    --black: #000000;
    --gray-light: #f5f5f5;
    --gray-medium: #999999;
    --gray-dark: #333333;
    --green: #4caf50;
    --blue: #2196f3;
    
    /* Enhanced Shadow System */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.12);
    --shadow-focus: 0 0 0 4px rgba(211, 47, 47, 0.1);
    
    /* Modern Gradients */
    --gradient-primary: linear-gradient(145deg, #d32f2f 0%, #b71c1c 100%);
    --gradient-gold: linear-gradient(145deg, #ffd700 0%, #ffc107 100%);
    --gradient-surface: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    --gradient-background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    
    /* Smooth Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius System */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 25px;
    --radius-full: 50px;
    
    /* Spacing System */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--gray-dark);
    overflow-x: hidden;
    font-feature-settings: 'liga', 'kern';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Background Video */
#bgVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.7) contrast(1.1);
}

#bgVideo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.5) 100%);
    z-index: -1;
}

/* Enhanced Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition-normal);
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-hover);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    height: 80px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-section .logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(211, 47, 47, 0.2));
    transition: var(--transition-normal);
}

.logo-section .logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(211, 47, 47, 0.3));
}

.main-nav .nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
}

.nav-link {
    text-decoration: none;
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-normal);
    padding: var(--space-sm) 0;
    border-bottom: 2px solid transparent;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: var(--transition-normal);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--dark-red);
    transform: translateY(-1px);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    width: 30px;
    height: 30px;
    justify-content: center;
    gap: 4px;
    transition: var(--transition-normal);
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: var(--transition-normal);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-7px);
}

/* Enhanced Main Content */
.main-content {
    padding-top: 80px;
    min-height: 100vh;
    position: relative;
}

/* Enhanced Sections */
.landing-section,
.form-section {
    display: none;
    min-height: calc(100vh - 80px);
    padding: var(--space-2xl) var(--space-lg);
    position: relative;
}

.landing-section.active,
.form-section.active {
    display: flex;
    animation: fadeInUp 0.6s var(--transition-normal) both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Landing Section */
.landing-section {
    align-items: center;
    justify-content: center;
    text-align: center;
    background: 
        radial-gradient(circle at 30% 20%, rgba(211, 47, 47, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        rgba(0, 0, 0, 0.4);
    position: relative;
}

.landing-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(211, 47, 47, 0.05) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 215, 0, 0.05) 50%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    color: var(--white);
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 900;
    margin-bottom: var(--space-lg);
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    line-height: 1.1;
    color: #ffffff;
    animation: none; /* Remove the glow animation */
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3)); }
    100% { filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.5)); }
}

.hero-subtitle {
    font-size: clamp(2rem, 6vw, 2.8rem);
    font-weight: 800;
    color: #ffd700;
    margin-bottom: var(--space-lg);
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    margin-bottom: var(--space-2xl);
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.action-buttons {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-2xl);
}

/* Enhanced Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at center, rgba(211, 47, 47, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    color: var(--white);
}

.loading-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--white);
    border-right: 4px solid var(--primary-gold);
    border-radius: 50%;
    animation: modernSpin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-bottom: var(--space-lg);
    filter: drop-shadow(0 0 20px rgba(211, 47, 47, 0.3));
}

@keyframes modernSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.loading-overlay p {
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

/* Enhanced Message System */
.error-message,
.success-message {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin: var(--space-md) 0;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
    animation: slideInDown 0.4s var(--transition-normal);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: linear-gradient(145deg, rgba(244, 67, 54, 0.95) 0%, rgba(211, 47, 47, 0.95) 100%);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
}

.success-message {
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.95) 0%, rgba(56, 142, 60, 0.95) 100%);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Enhanced Form Sections */
.form-section {
    background: var(--gradient-background);
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(211, 47, 47, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.form-container {
    width: 100%;
    max-width: 1100px;
    background: var(--gradient-surface);
    border-radius: var(--radius-xl);
    box-shadow: 
        var(--shadow-hover),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-gold);
}

.form-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.form-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: headerShimmer 3s linear infinite;
}

@keyframes headerShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.form-header h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Enhanced Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    transition: var(--transition-normal);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-gold);
}

/* Enhanced Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-10 { margin-bottom: var(--space-sm); }
.mb-20 { margin-bottom: var(--space-lg); }
.mt-20 { margin-top: var(--space-lg); }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 600; }

.color-red { color: var(--primary-red); }
.color-gold { color: var(--primary-gold); }
.color-green { color: var(--green); }

.hidden { display: none; }
.visible { display: block; }

/* Glass Effect Utilities */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --space-xs: 0.25rem;
        --space-sm: 0.75rem;
        --space-md: 1rem;
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 2.5rem;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        box-shadow: var(--shadow-hover);
        padding: var(--space-lg);
        gap: var(--space-md);
        border-top: 1px solid rgba(211, 47, 47, 0.1);
    }
    
    .header-container {
        padding: 0 var(--space-md);
        height: 70px;
    }
    
    .main-content {
        padding-top: 70px;
    }
    
    .landing-section,
    .form-section {
        padding: var(--space-lg) var(--space-md);
    }
    
    .form-container {
        margin: var(--space-sm);
        border-radius: var(--radius-lg);
    }
    
    .form-header {
        padding: var(--space-lg);
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 var(--space-sm);
    }
    
    .logo-section .logo {
        height: 50px;
    }
    
    .landing-section,
    .form-section {
        padding: var(--space-md) var(--space-sm);
    }
    
    .form-header {
        padding: var(--space-md);
    }
    
    .action-buttons {
        gap: var(--space-lg);
    }
}

/* 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;
    }
}

.landing-section {
    align-items: flex-start; /* Changed from center to flex-start */
    justify-content: flex-start; /* Changed from center to flex-start */
    text-align: center;
    background: 
        radial-gradient(circle at 30% 20%, rgba(211, 47, 47, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        rgba(0, 0, 0, 0.4);
    position: relative;
    padding-top: 10vh; /* Add top padding instead of centering */
    padding-bottom: 5vh; /* Ensure bottom spacing */
    min-height: 100vh; /* Use full viewport height */
    overflow-y: auto; /* Allow scrolling if content is too tall */
}

.hero-content {
    max-width: 900px;
    color: var(--white);
    position: relative;
    z-index: 2;
    margin: 0 auto; /* Center horizontally */
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem); /* Reduced max size */
    font-weight: 900;
    margin-bottom: 1rem; /* Reduced margin */
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    line-height: 1.1;
    color: #ffffff;
}

.hero-subtitle {
    font-size: clamp(1.5rem, 4vw, 2.2rem); /* Reduced max size */
    font-weight: 800;
    color: #ffd700;
    margin-bottom: 1rem; /* Reduced margin */
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem); /* Reduced max size */
    margin-bottom: 2rem; /* Reduced margin */
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.action-buttons {
    display: flex;
    gap: 1.5rem; /* Reduced gap */
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem; /* Reduced margin */
}

/* Ensure buttons are properly sized for smaller screens */
.action-btn {
    padding: 16px 32px; /* Slightly reduced padding */
    font-size: 1rem; /* Standardized size */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .landing-section {
        padding-top: 8vh;
        padding-bottom: 4vh;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: clamp(1.3rem, 6vw, 1.8rem);
        margin-bottom: 0.75rem;
    }
    
    .hero-description {
        font-size: clamp(0.95rem, 3vw, 1.1rem);
        margin-bottom: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .action-btn {
        width: 100%;
        max-width: 320px;
        padding: 14px 28px;
    }
}

@media (max-width: 480px) {
    .landing-section {
        padding-top: 6vh;
        padding-bottom: 3vh;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 9vw, 2.2rem);
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: clamp(1.2rem, 7vw, 1.6rem);
        margin-bottom: 0.5rem;
    }
    
    .hero-description {
        font-size: clamp(0.9rem, 3.5vw, 1rem);
        margin-bottom: 1rem;
    }
    
    .action-buttons {
        gap: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .action-btn {
        max-width: 280px;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* Landscape orientation fixes for mobile */
@media (orientation: landscape) and (max-height: 600px) {
    .landing-section {
        padding-top: 2vh;
        padding-bottom: 2vh;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin-bottom: 0.25rem;
    }
    
    .hero-subtitle {
        font-size: clamp(1.1rem, 4vw, 1.4rem);
        margin-bottom: 0.25rem;
    }
    
    .hero-description {
        font-size: clamp(0.85rem, 2.5vw, 0.95rem);
        margin-bottom: 0.75rem;
    }
    
    .action-buttons {
        gap: 0.5rem;
        margin-top: 0.5rem;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 150px;
        max-width: 200px;
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}