/* ===== MODERN EVENTS PAGE REDESIGN ===== */

/* Hero Section */
.events-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.events-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/background.webp') center/cover;
    opacity: 0.1;
    z-index: 1;
}

.events-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    min-height: 150px;
    width: 100%;
    max-width: 300px;
}

.hero-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #fff;
}

.next-event-info {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

/* Filter Section */
.events-filter-section {
    background: #f8f9fa;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
}

.filter-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-bar input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
}



/* Main Events Content */
.events-main {
    padding: 3rem 0;
    background: transparent;
}

.events-status-banner {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.status-content h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.status-content p {
    color: #6c757d;
    line-height: 1.6;
    max-width: 600px;
}

.status-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.events-container {
    max-width: 1200px;
    margin: 0 auto;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.events-header h2 {
    font-size: 2rem;
    color: white;
    font-weight: 600;
}

.events-count-display {
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

/* Events Tabs */
.events-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 1;
    justify-content: center;
    min-height: 48px;
}

.tab-btn:hover {
    background-color: #f8f9fa;
    color: #333;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: #3498db;
    border-radius: 2px;
}

.tab-icon {
    font-size: 1.1rem;
}

/* Enhanced Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}



/* Loading Placeholder */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

/* No Results Message */
.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 1rem 0;
}

.no-results-message p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #495057;
}

.no-results-message .btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.no-results-message .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* CTA Section */
.events-cta-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn-primary {
    background: #3498db;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-buttons .btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.cta-buttons .btn-secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-buttons .btn-secondary:hover {
    background: white;
    color: #2c3e50;
    transform: translateY(-2px);
}

/* Modern Event Cards */
.event-card.modern-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.event-card.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #3498db;
}

/* Card Header */
.event-card-header {
    display: flex;
    padding: 1.25rem;
    gap: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.event-poster-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.cancelled {
    background: #dc3545;
    color: white;
}

.status-badge.past {
    background: #6c757d;
    color: white;
}

.event-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.event-date-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-date-time .date {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.event-date-time .time {
    font-size: 0.85rem;
    color: #6c757d;
}

.event-date-time.urgent .date {
    color: #e74c3c;
}

.event-date-time.urgent .time {
    color: #c0392b;
}

.event-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #27ae60;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
    align-self: flex-start;
}

/* Card Body */
.event-card-body {
    padding: 0 1.25rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    flex: 1;
}

.event-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: auto;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 0.4rem 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
}

.stat-item.urgent {
    background: #fff5f5;
    color: #e74c3c;
}

.stat-item.registration-deadline {
    background: #fff3cd;
    color: #856404;
}

.stat-icon {
    font-size: 0.85rem;
}

.stat-text {
    font-weight: 500;
}

/* Card Footer */
.event-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.register-btn {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
}

.register-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.register-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.register-btn.registered {
    background: #27ae60;
}

.register-btn.registered:hover {
    background: #229954;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .events-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .events-status-banner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .search-bar {
        max-width: none;
        width: 100%;
    }
    
    .events-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .events-tabs {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .tab-btn {
        justify-content: center;
        padding: 1rem 1.5rem;
        min-height: 56px;
        font-size: 1.1rem;
        border-width: 2px;
    }
    
    .tab-btn.active::after {
        display: none;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .status-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn-primary,
    .cta-buttons .btn-secondary {
        width: 200px;
    }
    
    /* Modern Card Mobile Adjustments */
    .event-card.modern-card {
        max-width: none;
    }
    
    .event-card-header {
        padding: 1rem;
    }
    
    .event-poster-thumb {
        width: 70px;
        height: 70px;
    }
    
    .event-title {
        font-size: 1.2rem;
    }
    
    .event-stats {
        gap: 0.5rem;
    }
    
    .stat-item {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .event-card-footer {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .events-hero {
        padding: 2rem 0 3rem;
    }
    
    .events-hero-content {
        padding: 0 1rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .events-status-banner {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .status-content h2 {
        font-size: 1.5rem;
    }
    
    /* Small Mobile Tab Adjustments */
    .events-tabs {
        padding: 0.75rem;
        gap: 0.5rem;
        margin: 0.75rem 0;
    }
    
    .tab-btn {
        padding: 0.875rem 1rem;
        min-height: 52px;
        font-size: 1rem;
        gap: 0.375rem;
    }
    
    .tab-icon {
        font-size: 1rem;
    }
    
    /* Small Mobile Card Adjustments */
    .event-card-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .event-poster-thumb {
        width: 60px;
        height: 60px;
    }
    
    .event-date-time .date {
        font-size: 0.9rem;
    }
    
    .event-date-time .time {
        font-size: 0.75rem;
    }
    
    .event-price {
        font-size: 0.9rem;
        padding: 3px 6px;
    }
    
    .event-card-body {
        padding: 0 0.75rem 0.75rem;
    }
    
    .event-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .event-description {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
}

/* ===== EXISTING STYLES (Preserved for backwards compatibility) ===== */

/* Styles for events.html, defining the full-detail event cards */

#events-grid.product-grid {
    display: grid;
    /* Use a fixed width for the cards, but allow them to wrap */
    grid-template-columns: repeat(auto-fit, 400px);
    justify-content: center;
    gap: 2rem;
}

.event-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 550px; /* Adjusted height */
    width: 300px;  /* Adjusted width */
    margin: 0 auto; /* Center in grid column if needed */
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.event-card-poster-container {
    height: 55%;
    overflow: hidden;
    position: relative;
}

.event-card:hover .event-poster-overlay {
    opacity: 1;
}

.event-poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    color: #fff;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay-event-name {
    font-size: 1.75rem;
    font-weight: bold;
}

.event-card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.event-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    height: 45%;
}

.event-card-content h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: #333;
}

.event-card-details {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.event-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Push to the bottom */
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.event-card-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #888;
}

/* Shared button style for register */
.register-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.register-btn:hover:not(:disabled) {
    background-color: #0056b3;
}

.register-btn:disabled {
    background-color: #5a5a5a;
    cursor: not-allowed;
}

/* Styles for events.html can be added here if needed */

/* Define a more condensed grid for the poster-only cards */
#events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Override the default event-card style from main.css for the events page */
.event-card-page {
    height: auto; /* Remove the fixed height from main.css */
    display: block; /* Override flex behavior */
    aspect-ratio: 2 / 3; /* Give the poster a nice portrait aspect ratio */
    max-width: 400px; /* Constrain the max width */
}

/* Ensure the poster container fills the entire card area */
.event-card-page .event-card-poster-container {
    height: 100%;
}

/* Explicitly hide the content section in case it's ever added back by mistake */
.event-card-page .event-card-content {
    display: none;
}

/* EMPTY STATE MESSAGE STYLING */
#events-grid > p {
    grid-column: 1 / -1;           /* Span full width of the grid */
    text-align: center;            /* Center the text */
    font-size: 1.4rem;             /* Increase font size for better readability */
    color: #555;                   /* Subtle grey color */
    margin: 3rem 0;                /* Add vertical spacing */
}

/* When the grid is empty (no cards), make the container flex so the message centers nicely */
#events-grid:has(> p):not(:has(.event-card)) {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    padding: 4rem 1rem;
}

/* Event Details Layout */
.event-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.event-detail-poster {
    width: 100%;
    max-width: 350px;
    border-radius: 8px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .event-detail-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .event-detail-poster {
        flex: 0 0 350px;
    }
}

.event-detail-text {
    flex: 1;
    color: #fff;
}

.event-detail-text p {
    color: #fff;
}

.event-detail-text strong {
    color: #fff;
}

#event-name {
    color: #fff !important;
}

