/* Modern Events Styling - Spond-inspired */

/* === Event Cards Grid (Standard View) === */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.event-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.event-card-image {
    position: relative;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f0f4f8;
}

.event-card-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 8px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.event-card-date-badge .day {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    color: #1a1a1a;
}

.event-card-date-badge .month {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    margin-top: 2px;
}

.event-card-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    backdrop-filter: blur(8px);
}

.event-card-content {
    padding: 16px;
}

.event-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.event-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.event-card-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.event-card-meta-item i {
    width: 16px;
    color: #2c8e3e;
}

.event-card-stats {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.event-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.event-stat-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.event-stat-icon.attending { background: #e8f5e9; color: #2e7d32; }
.event-stat-icon.declined { background: #ffebee; color: #c62828; }
.event-stat-icon.pending { background: #fff3e0; color: #ef6c00; }

/* === Compact List View === */
.events-list-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* === Compact List View (new row variant with sidebars) === */
.events-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.events-compact .event-row {
    display: grid;
    grid-template-columns: 4px 90px 1fr auto 4px;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    align-items: center;
}

.events-compact .event-row:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateX(2px); }

.events-compact .event-row.urgent-event {
    position: relative;
    isolation: isolate;
}

.events-compact .event-row.urgent-event::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 16px;
    padding: 4px;
    background: linear-gradient(
        45deg,
        #ff0000,
        #ff7f00,
        #ffff00,
        #00ff00,
        #0000ff,
        #8b00ff,
        #ff0000
    );
    background-size: 300% 300%;
    animation: kaleidoscope 3s linear infinite;
    z-index: -1;
    opacity: 0.9;
}

.events-compact .event-row.urgent-event::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 12px;
    z-index: -1;
}


.events-compact .strip { border-radius: 4px; height: 100%; }

.events-compact .thumb {
    position: relative;
    height: 90px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f0f4f8;
}

.events-compact .thumb .d1 { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #444; margin: 0; }
.events-compact .thumb .d2 { font-size: 26px; font-weight: 800; line-height: 1; color: #1a1a1a; margin: 2px 0 0 0; }
.events-compact .thumb .d3 { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #666; margin: 2px 0 0 0; }

.events-compact .meta { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; min-width: 0; }
.events-compact .meta .title { font-size: 16px; font-weight: 700; color: #1a1a1a; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.events-compact .meta .when { font-size: 13px; color: #666; }
.events-compact .meta .counts { display: flex; gap: 8px; font-size: 12px; }
.events-compact .meta .counts .badge { background: rgba(0,0,0,0.04); border-radius: 10px; padding: 2px 8px; font-weight: 600; color:#555; }

.events-compact .respond { display:flex; align-items:center; justify-content:center; padding: 8px; }
.events-compact .respond .pulse { width: 16px; height: 16px; border-radius: 50%; background: #ffc107; box-shadow: 0 0 0 rgba(255, 193, 7, 0.7); animation: pulse 2s infinite; }

@media (max-width: 768px) {
    .events-compact .event-row { grid-template-columns: 4px 80px 1fr auto 4px; }
    .events-compact .thumb { height: 80px; }
}

/* === Mini compact variant for sidebars === */
.event-row-mini {
    display: grid;
    grid-template-columns: 3px 50px 1fr;
    gap: 8px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    align-items: center;
    padding: 6px 0;
}

.event-row-mini:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.1); transform: translateX(1px); }

.strip-mini { border-radius: 3px; height: 100%; min-height: 40px; }

.thumb-mini {
    position: relative;
    width: 50px;
    height: 50px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f4f8;
}

.thumb-mini .day-mini { font-size: 18px; font-weight: 800; line-height: 1; color: #1a1a1a; margin: 0; }

.meta-mini { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-mini .title-mini { font-size: 12px; font-weight: 700; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-mini .when-mini { font-size: 10px; color: #666; }


.event-list-item {
    display: grid;
    grid-template-columns: 4px 90px 1fr auto;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    cursor: pointer;
}

.event-list-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.event-list-strip {
    border-radius: 4px 0 0 4px;
}

.event-list-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.event-list-date .weekday {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 2px;
}

.event-list-date .day {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #1a1a1a;
}

.event-list-date .month {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    margin-top: 2px;
}

.event-list-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 0;
    min-width: 0;
}

.event-list-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-list-time {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-list-stats {
    display: flex;
    gap: 10px;
    font-size: 12px;
}

.event-list-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.04);
}

.event-list-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.event-pending-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffc107;
    box-shadow: 0 0 0 rgba(255, 193, 7, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

/* === Event Detail Hero === */
.event-hero {
    position: relative;
    height: 360px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.event-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
}

.event-hero-type {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    backdrop-filter: blur(8px);
    margin-bottom: 12px;
    align-self: flex-start;
}

.event-hero-title {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.event-hero-date {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === RSVP Section === */
.event-rsvp-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.rsvp-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.rsvp-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.rsvp-btn:hover {
    border-color: #2c8e3e;
    background: #f4f9f5;
}

.rsvp-btn.active {
    border-color: #2c8e3e;
    background: #2c8e3e;
    color: #fff;
}

.rsvp-btn.declined.active {
    border-color: #d32f2f;
    background: #d32f2f;
}

.rsvp-btn i {
    font-size: 24px;
    margin-bottom: 8px;
}

/* === Attendance Stats === */
.attendance-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.attendance-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}

.attendance-stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.attendance-stat-icon.attending { background: #e8f5e9; color: #2e7d32; }
.attendance-stat-icon.declined { background: #ffebee; color: #c62828; }
.attendance-stat-icon.pending { background: #fff3e0; color: #ef6c00; }
.attendance-stat-icon.transport { background: #e3f2fd; color: #1976d2; }

.attendance-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}

.attendance-stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    font-weight: 600;
}

/* === Event Info Grid === */
.event-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.event-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.event-info-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-info-card h3 i {
    color: #2c8e3e;
}

.event-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.event-info-item:last-child {
    margin-bottom: 0;
}

.event-info-item i {
    width: 20px;
    color: #2c8e3e;
    margin-top: 2px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .event-hero {
        height: 280px;
    }
    
    .event-hero-title {
        font-size: 28px;
    }
    
    .event-list-item {
        grid-template-columns: 4px 70px 1fr auto;
    }
}

/* === Type Colors === */
.type-football_match { background: rgba(33, 150, 243, 0.9); }
.type-football_practice { background: rgba(76, 175, 80, 0.9); }
.type-futsal_match { background: rgba(255, 152, 0, 0.9); }
.type-futsal_practice { background: rgba(156, 39, 176, 0.9); }
.type-social { background: rgba(233, 30, 99, 0.9); }
.type-tournament { background: rgba(244, 67, 54, 0.9); }
.type-special { background: rgba(103, 58, 183, 0.9); }
.type-fitness_conditioning { background: rgba(0, 150, 136, 0.9); }
.type-availability_request { background: rgba(96, 125, 139, 0.9); }

.strip-football_match { background: #2196F3; }
.strip-football_practice { background: #4CAF50; }
.strip-futsal_match { background: #FF9800; }
.strip-futsal_practice { background: #9C27B0; }
.strip-social { background: #E91E63; }
.strip-tournament { background: #F44336; }
.strip-special { background: #673AB7; }
.strip-fitness_conditioning { background: #009688; }
.strip-availability_request { background: #607D8B; }

/* === Urgent Events (< 24 hours) === */
.urgent-event {
    position: relative;
    isolation: isolate;
}

.urgent-event::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 20px;
    padding: 4px;
    background: linear-gradient(
        45deg,
        #ff0000,
        #ff7f00,
        #ffff00,
        #00ff00,
        #0000ff,
        #8b00ff,
        #ff0000
    );
    background-size: 300% 300%;
    animation: kaleidoscope 3s linear infinite;
    z-index: -1;
    opacity: 0.9;
}

.urgent-event::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 16px;
    z-index: -1;
}

@keyframes kaleidoscope {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === Countdown Timer === */
.event-countdown-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    background: #ffffff;
    color: #ff4757;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    box-shadow: 0 0 0 1px rgba(255, 71, 87, 0.3),
                0 0 8px rgba(255, 71, 87, 0.3),
                0 0 12px rgba(255, 71, 87, 0.15);
    animation: glow-pulse 2s ease-in-out infinite;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    letter-spacing: 0.3px;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(255, 71, 87, 0.3),
                    0 0 8px rgba(255, 71, 87, 0.3),
                    0 0 12px rgba(255, 71, 87, 0.15);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(255, 71, 87, 0.5),
                    0 0 10px rgba(255, 71, 87, 0.4),
                    0 0 16px rgba(255, 71, 87, 0.25);
    }
}

.event-countdown-timer i {
    font-size: 11px;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

.countdown-text {
    font-family: 'Courier New', 'Consolas', monospace;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* === Events Legend === */
.events-legend {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.05) 0%, rgba(39, 174, 96, 0.05) 100%);
    border: 2px solid rgba(46, 204, 113, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.events-legend h6 {
    font-size: 14px;
    font-weight: 700;
    color: #2c8e3e;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.legend-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.legend-icon.attending {
    background: #e8f5e9;
    color: #2e7d32;
}

.legend-icon.declined {
    background: #ffebee;
    color: #c62828;
}

.legend-icon.pending {
    background: #fff3e0;
    color: #ef6c00;
}

.legend-icon.transport {
    background: #e3f2fd;
    color: #1976d2;
}

.urgent-indicator-legend {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kaleidoscope-border-demo {
    width: 36px;
    height: 28px;
    border-radius: 8px;
    position: relative;
    isolation: isolate;
}

.kaleidoscope-border-demo::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 8px;
    padding: 2px;
    background: linear-gradient(
        45deg,
        #ff0000,
        #ff7f00,
        #ffff00,
        #00ff00,
        #0000ff,
        #8b00ff,
        #ff0000
    );
    background-size: 300% 300%;
    animation: kaleidoscope 3s linear infinite;
    z-index: -1;
}

.kaleidoscope-border-demo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 6px;
    z-index: -1;
}

@media (max-width: 768px) {
    .legend-items {
        gap: 12px;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    .legend-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}
