/* Apple iPhone Style KLPD Event System */
:root {
    /* iOS Color Palette */
    --ios-blue: #007AFF;
    --ios-blue-light: #5AC8FA;
    --ios-blue-dark: #0051D0;
    --ios-green: #34C759;
    --ios-orange: #FF9500;
    --ios-red: #FF3B30;
    --ios-purple: #AF52DE;
    --ios-pink: #FF2D92;
    --ios-yellow: #FFCC00;
    --ios-indigo: #5856D6;
    
    /* Calendar Purple Theme */
    --calendar-purple: #667eea;
    --calendar-purple-dark: #764ba2;
    
    /* iOS Grays */
    --ios-gray: #8E8E93;
    --ios-gray-2: #AEAEB2;
    --ios-gray-3: #C7C7CC;
    --ios-gray-4: #D1D1D6;
    --ios-gray-5: #E5E5EA;
    --ios-gray-6: #F2F2F7;
    
    /* Dark Mode Colors */
    --ios-bg-primary: #000000;
    --ios-bg-secondary: #1C1C1E;
    --ios-bg-tertiary: #2C2C2E;
    --ios-bg-grouped: #000000;
    --ios-bg-grouped-secondary: #1C1C1E;
    --ios-bg-elevated: #1C1C1E;
    
    /* Text Colors */
    --ios-text-primary: #FFFFFF;
    --ios-text-secondary: #8E8E93;
    --ios-text-tertiary: #48484A;
    --ios-text-quaternary: #3A3A3C;
    
    /* iOS Specific */
    --ios-border-radius: 12px;
    --ios-border-radius-small: 8px;
    --ios-border-radius-large: 16px;
    --ios-border-radius-xl: 20px;
    --ios-spacing-xs: 4px;
    --ios-spacing-sm: 8px;
    --ios-spacing-md: 16px;
    --ios-spacing-lg: 24px;
    --ios-spacing-xl: 32px;
    
    /* iOS Shadows */
    --ios-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.12);
    --ios-shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --ios-shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.25);
    
    /* iOS Blur Effects */
    --ios-blur-bg: rgba(28, 28, 30, 0.85);
    --ios-blur-border: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif !important;
    background: var(--ios-bg-primary);
    color: var(--ios-text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* iOS-style backdrop blur */
.ios-blur {
    background: var(--ios-blur-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--ios-blur-border);
}

/* Events Section */
.events-container {
    max-width: 428px; /* iPhone 14 Pro Max width */
    margin: 0 auto;
    padding: var(--ios-spacing-lg) var(--ios-spacing-md);
    background: var(--ios-bg-primary);
}

.events-header {
    text-align: center;
    margin-bottom: var(--ios-spacing-xl);
    padding-top: var(--ios-spacing-lg);
}

.events-header h1 {
    font-size: 34px;
    font-weight: 700;
    color: var(--ios-text-primary);
    margin-bottom: var(--ios-spacing-sm);
    letter-spacing: -0.5px;
}

.events-header p {
    font-size: 17px;
    color: var(--ios-text-secondary);
    font-weight: 400;
}

/* ========================================
   CALENDAR BUTTON & MODAL STYLING
   ======================================== */

/* Calendar Button Container */
.calendar-button-container {
    max-width: 428px;
    margin: 0 auto;
    padding: 0 var(--ios-spacing-md);
    margin-bottom: var(--ios-spacing-lg);
}

/* Calendar Button */
.calendar-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--calendar-purple) 0%, var(--calendar-purple-dark) 100%);
    border: none;
    border-radius: 28px;
    padding: 16px 24px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    font-family: 'Open Sans', sans-serif !important;
}

.calendar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.calendar-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.calendar-icon {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Calendar Modal */
.calendar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 20px;
}

.calendar-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: calendarModalFadeIn 0.3s ease;
}

@keyframes calendarModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.calendar-content {
    background: var(--ios-bg-secondary);
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: calendarModalSlideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes calendarModalSlideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ios-text-primary);
    margin: 0;
    font-family: 'Open Sans', sans-serif !important;
}

.calendar-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--ios-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ios-text-primary);
}

/* Month Navigation */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 8px;
}

.month-nav-btn {
    background: var(--ios-bg-tertiary);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--ios-blue);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-nav-btn:hover {
    background: rgba(0, 122, 255, 0.1);
}

.current-month {
    font-size: 18px;
    font-weight: 600;
    color: var(--ios-text-primary);
    text-align: center;
    min-width: 140px;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 20px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--ios-text-secondary);
    padding: 8px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text-primary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 36px;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.other-month {
    color: var(--ios-text-tertiary);
}

.calendar-day.today {
    background: var(--ios-blue);
    color: white;
    font-weight: 600;
}

.calendar-day.has-event {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.6) 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.calendar-day.has-event:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.7) 100%);
    transform: scale(1.05);
}

.calendar-day.selected {
    background: var(--ios-blue);
    color: white;
    transform: scale(1.1);
}

/* Event indicator dot */
.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

/* Events List */
.events-list {
    max-height: 200px;
    overflow-y: auto;
}

.events-list-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--ios-text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.event-item {
    background: var(--ios-bg-tertiary);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.event-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.event-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--calendar-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.event-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-text-primary);
    margin-bottom: 4px;
}

.event-details {
    font-size: 12px;
    color: var(--ios-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-status {
    background: var(--ios-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-status.confirmed {
    background: var(--calendar-purple);
}

.event-status.closed {
    background: var(--ios-red);
}

.no-events {
    text-align: center;
    color: var(--ios-text-secondary);
    font-style: italic;
    padding: 20px;
}

/* Mobile Responsive for Calendar */
@media (max-width: 428px) {
    .calendar-content {
        margin: 10px;
        padding: 20px;
        max-width: calc(100vw - 20px);
        max-height: 90vh;
    }
    
    .calendar-btn {
        padding: 14px 20px;
        border-radius: 24px;
        min-height: 48px;
        font-size: 15px;
    }
    
    .calendar-icon {
        width: 20px;
        height: 20px;
        font-size: 13px;
    }
    
    .calendar-title {
        font-size: 18px;
    }
    
    .current-month {
        font-size: 16px;
        min-width: 120px;
    }
    
    .calendar-day {
        min-height: 32px;
        font-size: 13px;
    }
    
    .month-nav-btn {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ========================================
   EXISTING STYLES CONTINUE...
   ======================================== */

/* Carousel Styles */
.carousel-container {
    position: relative;
}

/* MOBILE SWIPE OPTIMIZATIONS */
.events-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--ios-border-radius-large);
    /* Prevent text selection during swipe */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Smooth touch scrolling */
    -webkit-overflow-scrolling: touch;
    /* Cursor states */
    cursor: grab;
}

.events-carousel:active {
    cursor: grabbing;
}

.carousel-track {
    display: flex;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* iOS spring animation */
    /* Improve transform performance */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Hardware acceleration */
    will-change: transform;
}

/* Visual feedback during swipe */
.carousel-container.swiping .carousel-track {
    transition: none; /* Disable transition during active swipe */
}

.carousel-slide {
    flex: 0 0 100%;
    padding: 0 var(--ios-spacing-xs);
    /* Touch optimization */
    touch-action: pan-y pinch-zoom;
}

/* UPDATED: Event Card - No Longer Clickable */
.event-card {
    background: var(--ios-bg-secondary);
    border-radius: var(--ios-border-radius-large);
    padding: var(--ios-spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease-out;
    cursor: default !important; /* Remove pointer cursor */
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Remove tap highlights */
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* UPDATED: Remove hover/active effects from event cards */
.event-card:hover {
    background: var(--ios-bg-secondary) !important; /* Keep same background */
    border-color: rgba(255, 255, 255, 0.08) !important; /* Keep same border */
    transform: none !important; /* Remove transform effects */
}

.event-card:active {
    transform: none !important; /* Remove scale effect */
    transition: none !important;
}

/* UPDATED: Keep confirmed event styling but remove interactivity */
.event-card[data-status="confirmed"] {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
    border: 1px solid rgba(52, 199, 89, 0.3);
    cursor: default !important; /* Remove pointer cursor */
}

.event-card[data-status="confirmed"]:hover {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%) !important; /* Keep same background */
    border-color: rgba(52, 199, 89, 0.3) !important; /* Keep same border */
    transform: none !important; /* Remove transform effects */
}

.event-card[data-status="confirmed"]:active {
    transform: none !important; /* Remove scale effect */
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--ios-spacing-lg);
}

.event-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--ios-text-primary);
    margin-bottom: var(--ios-spacing-xs);
    letter-spacing: -0.3px;
}

.status-badge {
    background: var(--ios-blue);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.1px;
}

.status-badge.closed {
    background: var(--ios-red);
}

/* Enhanced status badge for confirmed events */
.status-badge.confirmed {
    background: var(--ios-green);
    color: white;
    font-weight: 600;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: var(--ios-spacing-md);
}

.info-row {
    display: flex;
    align-items: center;
    gap: var(--ios-spacing-md);
    padding: var(--ios-spacing-sm) 0;
}

.info-icon {
    width: 32px;
    height: 32px;
    background: var(--ios-bg-tertiary);
    border-radius: var(--ios-border-radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Different icon styling for confirmed events */
.event-card[data-status="confirmed"] .info-icon {
    background: rgba(52, 199, 89, 0.2);
    border-color: rgba(52, 199, 89, 0.3);
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-value {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-text-primary);
    line-height: 1.3;
}

/* Ensure interactive elements still work */
.info-value.location-link {
    color: var(--ios-blue);
    cursor: pointer !important;
    transition: color 0.2s ease;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.info-value.location-link:hover {
    color: var(--ios-blue-light);
}

/* ENHANCED PAYMENT FIELD STYLING */
.payment-info {
    font-weight: 600;
    color: var(--ios-text-primary);
}

/* Different styling based on payment amount */
.payment-info:not(:empty) {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.1) 0%, rgba(255, 204, 0, 0.05) 100%);
    padding: 6px 12px;
    border-radius: var(--ios-border-radius-small);
    border: 1px solid rgba(255, 204, 0, 0.3);
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

/* Free events styling */
.payment-info[data-free="true"],
.payment-info[data-value="free"],
.payment-info[data-value="no payment"],
.payment-info[data-value="0"] {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
    color: var(--ios-green);
    border-color: rgba(52, 199, 89, 0.3);
}

/* RM Paid events styling */
.payment-info[data-value*="rm"] {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.15) 0%, rgba(255, 204, 0, 0.08) 100%);
    color: var(--ios-yellow);
    border-color: rgba(255, 204, 0, 0.4);
    font-weight: 700;
}

/* TBA/Unknown payment styling */
.payment-info[data-value="tba"] {
    background: linear-gradient(135deg, rgba(142, 142, 147, 0.1) 0%, rgba(142, 142, 147, 0.05) 100%);
    color: var(--ios-gray);
    border-color: rgba(142, 142, 147, 0.3);
}

/* Enhanced payment icon for confirmed events */
.event-card[data-status="confirmed"] .info-row:has(.payment-info) .info-icon {
    background: rgba(255, 204, 0, 0.2);
    border-color: rgba(255, 204, 0, 0.3);
}

/* iOS-style highlighted section for confirmed players */
.event-card[data-status="confirmed"] .info-row:has(.info-label:contains("Confirmed players")) {
    background: rgba(52, 199, 89, 0.08);
    border-radius: var(--ios-border-radius);
    padding: var(--ios-spacing-md);
    margin: var(--ios-spacing-sm) 0;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

/* Location Map Frame */
.location-map-frame {
    margin-top: var(--ios-spacing-md);
    margin-left: 48px; /* Align with info content */
    background: var(--ios-bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ios-border-radius);
    overflow: hidden;
    animation: slideDown 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 280px;
    }
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--ios-spacing-md);
    background: var(--ios-bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.map-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-text-primary);
    margin: 0;
}

.map-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--ios-text-secondary);
    cursor: pointer !important;
    padding: var(--ios-spacing-xs);
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.map-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ios-text-primary);
}

.map-content {
    padding: var(--ios-spacing-md);
    text-align: center;
}

.map-loading {
    padding: var(--ios-spacing-lg);
    color: var(--ios-text-secondary);
    font-weight: 500;
    font-size: 15px;
}

.map-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--ios-border-radius-small);
    margin-bottom: var(--ios-spacing-md);
}

.map-iframe {
    width: 100%;
    height: 140px;
    border: none;
    border-radius: var(--ios-border-radius-small);
    margin-bottom: var(--ios-spacing-md);
}

.map-actions {
    margin-top: var(--ios-spacing-md);
}

.open-maps-btn {
    background: var(--ios-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer !important;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.open-maps-btn:hover {
    background: var(--ios-blue-dark);
    transform: scale(1.02);
}

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

.open-maps-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* iOS-style Carousel Controls */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ios-spacing-lg);
    margin: 0 auto var(--ios-spacing-lg);
    max-width: 428px;
    padding: 0 var(--ios-spacing-md);
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--ios-blur-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--ios-text-primary);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ios-blur-border);
    /* Touch-friendly sizing */
    min-width: 44px;
    min-height: 44px;
}

.carousel-btn:hover:not(:disabled) {
    background: rgba(44, 44, 46, 0.9);
    transform: scale(1.05);
}

.carousel-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.carousel-indicators {
    display: flex;
    gap: var(--ios-spacing-sm);
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(142, 142, 147, 0.6);
    cursor: pointer;
    transition: all 0.25s ease;
}

.indicator.active {
    background: var(--ios-blue);
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(142, 142, 147, 0.8);
}

/* Event Actions */
.event-actions {
    margin-top: var(--ios-spacing-lg);
    padding-top: var(--ios-spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.select-event-btn {
    background: var(--ios-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer !important;
    transition: all 0.2s ease;
    min-width: 140px;
    letter-spacing: -0.2px;
    /* Touch-friendly sizing */
    min-height: 44px;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.select-event-btn:hover {
    background: var(--ios-blue-dark);
    transform: scale(1.02);
}

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

/* ========================================
   APPLICATIONS RECEIVED - SHOW ALL NAMES
   ======================================== */

/* UPDATED: Applications List - Allow Multiple Rows */
.applicants-list {
    display: flex;
    flex-wrap: wrap !important; /* Force wrapping to multiple lines */
    gap: var(--ios-spacing-xs);
    margin-top: var(--ios-spacing-xs);
    min-height: auto !important; /* Remove fixed height constraints */
    max-height: none !important; /* Remove height limits */
    overflow: visible !important; /* Show all content */
    line-height: 1.4; /* Better line spacing when wrapped */
}

/* UPDATED: Individual Application Badges - Better Mobile Sizing */
.applicant-badge {
    background: rgba(255, 149, 0, 0.15);
    color: var(--ios-orange);
    padding: 6px 12px !important; /* Increased padding for better touch targets */
    border-radius: 16px !important; /* More rounded for iOS feel */
    font-size: 13px !important; /* Slightly larger font */
    font-weight: 600;
    border: 1px solid rgba(255, 149, 0, 0.3);
    display: inline-block;
    white-space: nowrap;
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease-out;
    position: relative;
    z-index: 1;
}

.applicant-badge:hover {
    background: rgba(255, 149, 0, 0.25);
    transform: translateY(-1px);
}

/* HIDE the "+X more" functionality */
.applicant-more {
    display: none !important; /* Hide the "more" button completely */
}

/* Enhanced applicant badges for confirmed events */
.event-card[data-status="confirmed"] .applicant-badge {
    background: rgba(52, 199, 89, 0.15);
    color: var(--ios-green);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.event-card[data-status="confirmed"] .applicant-badge:hover {
    background: rgba(52, 199, 89, 0.25);
}

/* Updated no applications state styling */
.no-applications {
    color: var(--ios-text-secondary);
    font-style: italic;
    font-size: 14px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--ios-border-radius-small);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: inline-block;
}

/* ========================================
   APPLICATION SECTION & USER VERIFICATION
   ======================================== */

/* Application Section */
.application-container {
    max-width: 428px;
    margin: 0 auto;
    padding: var(--ios-spacing-xl) var(--ios-spacing-md);
}

.application-header {
    text-align: center;
    margin-bottom: var(--ios-spacing-xl);
}

.app-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--ios-border-radius-large);
    margin-bottom: var(--ios-spacing-md);
    object-fit: contain;
    box-shadow: var(--ios-shadow-medium);
}

.application-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--ios-text-primary);
    margin-bottom: var(--ios-spacing-sm);
    letter-spacing: -0.4px;
}

.application-header p {
    color: var(--ios-text-secondary);
    font-size: 17px;
}

.application-form {
    background: var(--ios-bg-secondary);
    border-radius: var(--ios-border-radius-large);
    padding: var(--ios-spacing-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-group {
    margin-bottom: var(--ios-spacing-lg);
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-text-primary);
    margin-bottom: var(--ios-spacing-sm);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--ios-border-radius);
    font-size: 16px;
    font-weight: 400;
    color: var(--ios-text-primary);
    background: var(--ios-bg-tertiary);
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ios-blue);
    background: var(--ios-bg-secondary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* USER VERIFICATION FORM STATES */
.form-group input:disabled {
    background: var(--ios-bg-tertiary) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    color: var(--ios-text-tertiary) !important;
    border-color: var(--ios-gray-4) !important;
    -webkit-text-fill-color: var(--ios-text-tertiary);
    -webkit-opacity: 0.6;
}

.form-group input:read-only {
    background: rgba(52, 199, 89, 0.1) !important;
    border: 1px solid rgba(52, 199, 89, 0.3) !important;
    color: var(--ios-text-primary) !important;
    cursor: default !important;
    -webkit-text-fill-color: var(--ios-text-primary);
    -webkit-opacity: 1;
}

.form-group input:read-only:focus {
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1) !important;
    border-color: rgba(52, 199, 89, 0.3) !important;
}

/* Additional visual feedback for verification states */
.form-group.verified input {
    border-color: var(--ios-green) !important;
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1) !important;
}

.form-group.error input {
    border-color: var(--ios-red) !important;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1) !important;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%) rotate(45deg);
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--ios-text-secondary);
    border-bottom: 2px solid var(--ios-text-secondary);
    pointer-events: none;
}

/* USER VERIFICATION MESSAGES */
.user-message {
    display: none;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: var(--ios-border-radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

.user-message.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--ios-green);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.user-message.error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--ios-red);
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.user-message.info {
    background: rgba(0, 122, 255, 0.1);
    color: var(--ios-blue);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.user-message + .form-group {
    margin-top: var(--ios-spacing-lg);
}

/* PLAYER INFO CARD */
.player-info {
    margin: var(--ios-spacing-lg) 0;
    animation: fadeInUp 0.4s ease-out;
}

.player-card {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: var(--ios-border-radius);
    padding: var(--ios-spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--ios-spacing-md);
}

.player-photo {
    width: 60px;
    height: 60px;
    border-radius: var(--ios-border-radius);
    object-fit: cover;
    border: 2px solid rgba(52, 199, 89, 0.5);
}

.player-details h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ios-text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.player-details p {
    color: var(--ios-green);
    font-size: 14px;
    font-weight: 500;
}

/* SUBMIT BUTTON STATES */
.submit-btn {
    width: 100%;
    background: var(--ios-blue);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: var(--ios-border-radius);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ios-spacing-sm);
    letter-spacing: -0.2px;
}

.submit-btn:hover {
    background: var(--ios-blue-dark);
    transform: scale(1.02);
}

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

.submit-btn:disabled {
    background: var(--ios-bg-tertiary) !important;
    color: var(--ios-text-tertiary) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    border: 1px solid var(--ios-gray-4) !important;
    transform: none !important;
}

.submit-btn:not(:disabled) {
    background: var(--ios-blue) !important;
    color: white !important;
    cursor: pointer !important;
    opacity: 1 !important;
    border: 1px solid var(--ios-blue) !important;
}

.submit-btn:not(:disabled):hover {
    background: var(--ios-blue-dark) !important;
    transform: translateY(-1px);
}

.submit-btn:not(:disabled):active {
    background: #004499 !important;
    transform: translateY(0);
}

.submit-btn:focus-visible {
    outline: 2px solid var(--ios-blue);
    outline-offset: 2px;
}

/* Loading State for Submit Button */
.submit-btn.loading {
    position: relative;
    color: transparent !important;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ANIMATIONS */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: var(--ios-spacing-xl) var(--ios-spacing-lg);
    color: var(--ios-text-primary);
}

.spinner,
.btn-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(142, 142, 147, 0.3);
    border-top: 2px solid var(--ios-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--ios-spacing-md);
}

.btn-spinner {
    width: 20px;
    height: 20px;
    margin: 0;
}

/* Form Messages */
.form-message {
    margin: var(--ios-spacing-md) 0;
    padding: var(--ios-spacing-md);
    border-radius: var(--ios-border-radius);
    font-weight: 500;
    font-size: 15px;
}

.form-message.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--ios-green);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.form-message.error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--ios-red);
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.form-message.warning {
    background: rgba(255, 149, 0, 0.1);
    color: var(--ios-orange);
    border: 1px solid rgba(255, 149, 0, 0.3);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* iOS-style Responsive Design */
@media (max-width: 428px) {
    .events-container,
    .application-container {
        padding: var(--ios-spacing-lg) var(--ios-spacing-md);
    }
    
    .events-header h1 {
        font-size: 28px;
    }
    
    .event-card {
        padding: var(--ios-spacing-lg);
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .application-form {
        padding: var(--ios-spacing-lg);
    }

    .map-image,
    .map-iframe {
        height: 120px;
    }

    .location-map-frame {
        margin-left: 0;
        margin-top: var(--ios-spacing-sm);
    }

    /* Touch-friendly button sizing for mobile */
    .select-event-btn {
        min-height: 48px;
        padding: 12px 24px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Larger touch targets for indicators */
    .indicator {
        min-width: 44px;
        min-height: 44px;
        margin: 0 4px;
        width: 12px;
        height: 12px;
    }

    /* Responsive payment field adjustments */
    .payment-info {
        font-size: 14px;
        padding: 4px 8px;
        min-width: 50px;
    }

    /* Mobile Specific Adjustments for Applications */
    .applicants-list {
        gap: 6px; /* Slightly smaller gap on mobile */
    }
    
    .applicant-badge {
        padding: 5px 10px !important;
        font-size: 12px !important;
        border-radius: 14px !important;
    }
    
    .no-applications {
        font-size: 13px;
        padding: 6px 10px;
    }

    /* User Verification Mobile */
    .user-message {
        padding: 10px 12px;
        font-size: 13px;
        margin: 6px 0;
    }
    
    .player-card {
        padding: var(--ios-spacing-md);
        margin: 10px 0;
    }
    
    .player-photo {
        width: 50px;
        height: 50px;
        border-radius: var(--ios-border-radius-small);
    }
    
    .player-details h3 {
        font-size: 16px;
    }
    
    .player-details p {
        font-size: 13px;
    }

    /* Ensure proper input sizing on iOS to prevent zoom */
    .form-group input {
        font-size: 16px !important; /* Prevent zoom on iOS */
        transform: scale(1); /* Prevent iOS zoom bugs */
    }
}

@media (max-width: 375px) {
    .events-header h1 {
        font-size: 24px;
    }
    
    .event-card {
        padding: var(--ios-spacing-md);
    }
    
    .application-form {
        padding: var(--ios-spacing-md);
    }
    
    .carousel-controls {
        gap: var(--ios-spacing-md);
        margin-top: var(--ios-spacing-lg);
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .select-event-btn {
        padding: 10px 20px;
        font-size: 15px;
        min-width: 120px;
    }
    
    .applicants-list {
        gap: 4px;
    }
    
    .applicant-badge {
        padding: 4px 8px !important;
        font-size: 11px !important;
        border-radius: 12px !important;
    }
    
    .no-applications {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .applicant-badge {
        font-size: 10px !important;
        padding: 3px 6px !important;
        border-radius: 10px !important;
    }
    
    .applicants-list {
        gap: 3px;
    }
}

/* Improve button accessibility on mobile */
@media (hover: none) and (pointer: coarse) {
    .carousel-btn:hover {
        background: var(--ios-blur-bg); /* Remove hover states on touch devices */
        transform: none;
    }
    
    .select-event-btn:hover {
        transform: none; /* Remove hover animations on touch devices */
    }
    
    .submit-btn:hover {
        transform: none;
    }

    .open-maps-btn:hover {
        transform: none;
    }

    /* Better touch targets on mobile for applications */
    .applicant-badge {
        min-height: 32px; /* Ensure minimum touch target size */
        display: inline-flex;
        align-items: center;
    }
}

/* ========================================
   DARK MODE & ACCESSIBILITY
   ======================================== */

/* iOS-style Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        --ios-bg-primary: #000000;
        --ios-bg-secondary: #1C1C1E;
        --ios-bg-tertiary: #2C2C2E;
    }

    /* Dark Mode Specific Styling for Applications */
    .applicant-badge {
        background: rgba(255, 149, 0, 0.2);
        border-color: rgba(255, 149, 0, 0.4);
        color: #FFB366;
    }
    
    .applicant-badge:hover {
        background: rgba(255, 149, 0, 0.3);
    }
    
    .event-card[data-status="confirmed"] .applicant-badge {
        background: rgba(52, 199, 89, 0.2);
        border-color: rgba(52, 199, 89, 0.4);
        color: #64D88A;
    }
    
    .event-card[data-status="confirmed"] .applicant-badge:hover {
        background: rgba(52, 199, 89, 0.3);
    }

    /* User Verification Dark Mode */
    .user-message.success {
        background: rgba(52, 199, 89, 0.15);
        border-color: rgba(52, 199, 89, 0.4);
    }
    
    .user-message.error {
        background: rgba(255, 59, 48, 0.15);
        border-color: rgba(255, 59, 48, 0.4);
    }
    
    .user-message.info {
        background: rgba(0, 122, 255, 0.15);
        border-color: rgba(0, 122, 255, 0.4);
    }
    
    .player-card {
        background: rgba(52, 199, 89, 0.15);
        border-color: rgba(52, 199, 89, 0.4);
    }
}

/* iOS-style Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .carousel-track {
        transition: none;
    }
}

/* Better focus states for keyboard users */
.carousel-btn:focus,
.select-event-btn:focus,
.indicator:focus,
.form-group input:focus,
.form-group select:focus,
.submit-btn:focus {
    outline: 2px solid var(--ios-blue);
    outline-offset: 2px;
}

/* iOS-style Focus States for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--ios-blue);
    outline-offset: 2px;
}

/* iOS-style Safe Area Support */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .events-container,
    .application-container {
        padding-top: max(var(--ios-spacing-lg), env(safe-area-inset-top));
        padding-bottom: max(var(--ios-spacing-lg), env(safe-area-inset-bottom));
    }
}

/* iOS-style Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(142, 142, 147, 0.3);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 142, 147, 0.5);
}

/* iOS-style Selection */
::selection {
    background: rgba(0, 122, 255, 0.3);
    color: var(--ios-text-primary);
}

/* iOS-style Tap Highlights */
* {
    -webkit-tap-highlight-color: rgba(0, 122, 255, 0.2);
}

/* Ensure proper spacing when many names are present */
.applicants-list:has(.applicant-badge:nth-child(n+6)) {
    gap: 5px; /* Slightly smaller gap when many badges */
}

@media (max-width: 428px) {
    .applicants-list:has(.applicant-badge:nth-child(n+6)) {
        gap: 4px; /* Even smaller gap on mobile with many names */
    }
}

/* Event Card Centering Fix */
.event-card,
.event-card * {
  text-align: center !important;
}

/* Make event-card relative for absolute positioning */
.event-card {
  position: relative !important;
}

/* ========================================
   OPEN SANS FONT OVERRIDE & IMPORTANT NOTICE
   ======================================== */

/* Override font family to Open Sans */
* {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif !important;
}

/* Important Notice Button */
.important-notice-container {
    max-width: 428px;
    margin: 0 auto;
    padding: 0 var(--ios-spacing-md);
    margin-bottom: var(--ios-spacing-xl);
}

.important-notice-btn {
    width: 100%;
    background: linear-gradient(135deg, #1A8BFF 0%, #6DD3FF 100%) !important;
    border: none;
    border-radius: 28px;
    padding: 16px 24px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    font-family: 'Open Sans', sans-serif !important;
}

.important-notice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%) !important;
}

.important-notice-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.notice-icon {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Mobile responsive for Important Notice */
@media (max-width: 428px) {
    .important-notice-container {
        padding: 0 var(--ios-spacing-md);
        margin-bottom: var(--ios-spacing-lg);
    }

    .important-notice-btn {
        padding: 14px 20px;
        border-radius: 24px;
        min-height: 48px;
        font-size: 15px;
    }
    
    .notice-icon {
        width: 20px;
        height: 20px;
        font-size: 13px;
    }
}

/* Fix status badge positioning - add at the very end */
.event-card span.status-badge {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    text-align: center !important;
    margin: 0 !important;
    z-index: 999 !important;
}