/* ============================================
   ENHANCED MODERN EVENTS SECTION - 2025 EDITION
   ============================================ */

/* Modern Compact Section Base */
.events-section {
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
    padding: 60px 0 40px 0;
    position: relative;
    overflow: hidden; /* Prevent mobile overflow */
}

.events-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* Consistent container padding */
}

.events-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 75%, rgba(59, 130, 246, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 75% 25%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
    pointer-events: none;
}
}

/* Compact Modern Section Header */
.section-header {
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
    text-align: center;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.25);
    transition: transform 0.2s ease;
}

.section-badge:hover {
    transform: translateY(-1px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1rem;
    color: #64748b;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
    font-weight: 400;
}

/* Compact Modern Featured Event Card */
.featured-event-container {
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
}

.featured-event-card {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.featured-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

/* Enhanced Image Container */
.event-image-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.event-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1.1) contrast(1.05) saturate(1.1);
}

.featured-event-card:hover .event-hero-image {
    transform: scale(1.1) rotate(1deg);
}

.event-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 
        0 8px 25px rgba(239, 68, 68, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 2;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 
            0 8px 25px rgba(239, 68, 68, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 12px 35px rgba(239, 68, 68, 0.6),
            0 0 0 1px rgba(255, 255, 255, 0.3);
    }
}

/* Compact Event Content */
.event-content {
    padding: 32px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.event-date,
.event-location {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    background: rgba(59, 130, 246, 0.1);
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.event-date:hover,
.event-location:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(4px);
}

.event-date i,
.event-location i {
    font-size: 1.125rem;
    color: #3b82f6;
}

.event-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.event-description {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Compact Modern Countdown Section */
.countdown-section {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.08);
}

.countdown-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.countdown-item {
    text-align: center;
    background: white;
    padding: 16px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.countdown-item:hover {
    transform: translateY(-2px);
}

.countdown-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.countdown-unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compact Modern Action Buttons */
.event-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    border: none;
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
    color: white;
    text-decoration: none;
}

.btn-secondary-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #374151;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-secondary-modern:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    color: #3b82f6;
    text-decoration: none;
}

/* Compact Other Events Section */
.other-events-section {
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
}

.other-events-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.other-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.mini-event-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.mini-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mini-event-card:hover::before {
    transform: scaleY(1);
}

.mini-event-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.4);
}

.mini-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 16px;
    border-radius: 16px;
    margin-right: 20px;
    min-width: 80px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.mini-event-date .day {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.mini-event-date .month {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-event-content {
    flex: 1;
}

.mini-event-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.3;
}

.mini-event-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.mini-event-link {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #3b82f6;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.mini-event-link:hover {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    transform: rotate(45deg) scale(1.1);
}

/* Optimized CTA Section with Fixed Spacing */
.section-cta {
    text-align: center;
    padding: 40px 24px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin: 0; /* Remove extra margins */
    position: relative;
}

.section-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 20px 20px 0 0;
}

.cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.cta-text {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-outline-modern {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    color: #3b82f6;
    padding: 16px 32px;
    border: 2px solid #3b82f6;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-outline-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn-outline-modern:hover::before {
    left: 0;
}

.btn-outline-modern:hover {
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.3);
}

/* Enhanced No Events State */
.no-events-container {
    text-align: center;
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 32px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.no-events-icon {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 24px;
}

.no-events-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 16px;
}

.no-events-text {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile-First Responsive Design - iPhone 12 Pro Optimized */
@media (max-width: 1024px) {
    .section-title {
        font-size: 2.25rem;
    }
    
    .featured-event-card {
        grid-template-columns: 1fr;
        border-radius: 16px;
    }
    
    .event-content {
        padding: 24px;
    }
    
    .countdown-timer {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .countdown-item {
        padding: 14px 10px;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .events-section {
        padding: 40px 0 32px 0;
        overflow-x: hidden; /* Prevent horizontal overflow */
    }
    
    .events-section .container {
        padding: 0 16px; /* Tighter mobile padding */
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .section-header {
        margin-bottom: 32px;
        padding: 0 8px;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
        padding: 0;
        max-width: 100%;
    }
    
    .featured-event-container {
        margin-bottom: 28px;
    }
    
    .featured-event-card {
        margin: 0 -4px; /* Slight negative margin for breathing room */
        border-radius: 16px;
    }
    
    .event-content {
        padding: 20px;
    }
    
    .event-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
        line-height: 1.2;
    }
    
    .event-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
        line-height: 1.4;
    }
    
    .countdown-section {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .countdown-timer {
        gap: 6px;
    }
    
    .countdown-item {
        padding: 12px 6px;
    }
    
    .countdown-value {
        font-size: 1.4rem;
    }
    
    .event-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary-modern,
    .btn-secondary-modern {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
    
    .other-events-section {
        margin-bottom: 28px;
    }
    
    .other-events-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mini-event-card {
        padding: 14px;
        margin: 0 2px; /* Prevent edge overflow */
    }
    
    .section-cta {
        padding: 24px 16px;
        margin: 0 -4px 0 -4px; /* Align with card margins */
    }
}

/* iPhone 12 Pro and similar devices (390px) */
@media (max-width: 414px) {
    .events-section .container {
        padding: 0 12px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-badge {
        padding: 6px 14px;
        font-size: 0.7rem;
    }
    
    .featured-event-card {
        margin: 0 -2px;
    }
    
    .event-content {
        padding: 16px;
    }
    
    .countdown-timer {
        gap: 4px;
    }
    
    .countdown-item {
        padding: 10px 4px;
    }
    
    .countdown-value {
        font-size: 1.25rem;
    }
    
    .countdown-unit {
        font-size: 0.65rem;
    }
    
    .event-meta {
        gap: 8px;
    }
    
    .event-date,
    .event-location {
        font-size: 0.8rem;
        padding: 8px 12px;
        word-break: break-word; /* Prevent text overflow */
    }
    
    .mini-event-card {
        padding: 12px;
        margin: 0;
    }
    
    .mini-event-date {
        min-width: 50px;
        padding: 8px;
    }
    
    .mini-event-date .day {
        font-size: 1.1rem;
    }
    
    .mini-event-date .month {
        font-size: 0.7rem;
    }
    
    .section-cta {
        padding: 20px 12px;
        margin: 0;
    }
    
    .cta-title {
        font-size: 1.4rem;
    }
    
    .cta-text {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .events-section .container {
        padding: 0 10px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .countdown-timer {
        gap: 3px;
    }
    
    .countdown-item {
        padding: 8px 2px;
    }
    
    .countdown-value {
        font-size: 1.1rem;
    }
}

/* Accessibility and Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .events-section::before {
        animation: none;
    }
    
    .section-badge::before {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .featured-event-card {
        border: 2px solid #000;
    }
    
    .section-badge {
        border: 2px solid #fff;
    }
    
    .countdown-item {
        border: 1px solid #000;
    }
}