/* Updated Event Cards CSS with Countdown Timer - COMPLETE */

.events-section {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Event Cards */
.event-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
    border: 1px solid rgba(255,255,255,0.1);
}

.event-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* Image Container */
.event-image {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #722F37 0%, #B83C3C 100%);
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.event-card:hover .event-image img {
    transform: scale(1.05);
}

/* Image Overlay */
.event-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    padding: 1rem;
    color: white;
    z-index: 3;
}

.event-image-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 2px 2px 4px rgba(114, 47, 55, 0.8);
    -webkit-text-stroke: 1px rgba(114, 47, 55, 0.3);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-image-location {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    text-shadow: 1px 1px 2px rgba(114, 47, 55, 0.6);
    -webkit-text-stroke: 0.5px rgba(114, 47, 55, 0.2);
}

.event-image-location i {
    color: #D4AF37;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-size: 0.7rem;
}

/* Date Badge */
.event-date-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 4;
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.4);
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Content Section */
.event-content {
    padding: 1.2rem;
    background: white;
}

/* ========================================
   COUNTDOWN TIMER STYLES
   ======================================== */

.countdown-timer {
    background: linear-gradient(135deg, #722F37 0%, #8B1E1E 100%);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(114, 47, 55, 0.4);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.countdown-label {
    text-align: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.countdown-label i {
    margin-right: 0.3rem;
    color: #D4AF37;
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 38px;
    flex-shrink: 0;
}

.countdown-value {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    min-width: 35px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    line-height: 1;
    display: inline-block;
}

.countdown-value.countdown-flip {
    animation: flipNumber 0.3s ease;
}

@keyframes flipNumber {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

.countdown-text {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.2rem;
    font-weight: 600;
    text-transform: lowercase;
    line-height: 1;
}

.countdown-separator {
    color: white;
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
    padding: 0 0.1rem;
    align-self: center;
    opacity: 0.7;
    line-height: 1;
    margin-top: -15px;
}

/* Pulsing animation for seconds */
.countdown-value.seconds {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
        transform: scale(1.05);
    }
}

/* Urgent countdown (less than 24 hours) */
.countdown-timer.urgent {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    animation: urgentPulse 2s infinite;
}

@keyframes urgentPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.countdown-timer.urgent .countdown-value {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Registration Section */
.event-registration {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.registration-status {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    min-width: fit-content;
}

/* Registration Status Colors */
.registration-status.open {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.registration-status.closed {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.registration-status.finished {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #383d41;
    border: 1px solid #d6d8db;
}

.registration-status.full {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: 1px solid #c82333;
}

.register-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #B83C3C 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #B83C3C 0%, #D4AF37 100%);
}

.register-btn.disabled,
.register-btn:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.register-btn.disabled:hover,
.register-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3) !important;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
}

/* Image Fallback */
.image-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
}

.image-fallback i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #D4AF37;
}

.image-fallback span {
    font-size: 0.9rem;
    font-weight: 600;
}

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

/* No events state */
.no-events {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.no-events i {
    font-size: 4rem;
    color: #D4AF37;
    margin-bottom: 1rem;
    display: block;
}

.no-events h3 {
    color: #722F37;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-events p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.no-events .btn {
    background: linear-gradient(135deg, #D4AF37 0%, #B83C3C 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.no-events .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.loading i {
    font-size: 3rem;
    color: #D4AF37;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #722F37;
}

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

@media (max-width: 1400px) {
    .events-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }
    
    .countdown-value {
        font-size: 1.1rem;
        min-width: 35px;
        padding: 0.3rem 0.5rem;
    }
    
    .countdown-unit {
        min-width: 40px;
    }
}

@media (max-width: 1024px) {
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .events-section {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .events-section {
        padding: 0 1rem;
        margin: 2rem auto;
    }
    
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .event-image {
        height: 160px;
    }
    
    .event-content {
        padding: 1rem;
    }
    
    .countdown-display {
        gap: 0.2rem;
    }
    
    .countdown-value {
        font-size: 1rem;
        min-width: 32px;
        padding: 0.3rem 0.4rem;
    }
    
    .countdown-text {
        font-size: 0.6rem;
    }
    
    .countdown-unit {
        min-width: 35px;
    }
    
    .countdown-separator {
        font-size: 1rem;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .event-image {
        height: 180px;
    }
    
    .event-registration {
        flex-direction: column;
        align-items: stretch;
    }
    
    .registration-status {
        width: 100%;
        justify-content: center;
    }
    
    .register-btn {
        width: 100%;
        justify-content: center;
    }
    
    .countdown-timer {
        padding: 0.75rem;
    }
    
    .countdown-label {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .countdown-value {
        font-size: 0.9rem;
        min-width: 28px;
        padding: 0.25rem 0.35rem;
    }
    
    .countdown-text {
        font-size: 0.55rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .registration-status.open {
        border: 2px solid #28a745;
    }
    
    .registration-status.closed {
        border: 2px solid #dc3545;
    }
    
    .registration-status.finished {
        border: 2px solid #383d41;
    }
    
    .registration-status.full {
        border: 2px solid #dc3545;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .event-card,
    .register-btn,
    .countdown-value {
        animation: none;
        transition: none;
    }
    
    .event-card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .register-btn {
        display: none;
    }
    
    .countdown-timer {
        display: none;
    }
}