/* Calendar Page Styles */

/* Main Container */
.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 48px 24px;
    font-size: 1.1rem;
    color: #666;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 16px 24px;
    margin: 24px 0;
    color: #c33;
    text-align: center;
}

/* Filter Section */
.filter-section {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 200px;
}

.filter-select:focus {
    outline: none;
    border-color: #111;
}

.filter-select:hover {
    border-color: #999;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

/* Event Card */
.event-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.event-card:active {
    transform: translateY(-2px);
}

/* Event Image */
.event-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    background: #f5f5f5;
}

.event-image-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

/* Event Name Section */
.event-name-section {
    padding: 8px 9px;
    background: #111;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    text-align: center;
    min-height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Event Details Section - with dynamic gradient */
.event-details-section {
    padding: 9px 11px;
    background: linear-gradient(to bottom, #000000, var(--event-color, #667eea) 90%);
    color: white;
    font-size: 0.65rem;
    line-height: 1.5;
}

.event-detail-row {
    display: flex;
    margin-bottom: 6px;
}

.event-detail-row:last-child {
    margin-bottom: 0;
}

.event-detail-label {
    font-weight: 600;
    min-width: 60px;
}

.event-detail-value {
    font-style: italic;
    flex: 1;
}

/* Group Headers */
.events-group-header {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 10px 4px;
    border-bottom: 2px solid #ddd;
}

.events-group-upcoming {
    color: #2e7d32;
    border-color: #2e7d32;
}

.events-group-past {
    color: #888;
    border-color: #ccc;
    margin-top: 16px;
}

.past-event-card {
    opacity: 0.55;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Back Button Container */
.back-button-container {
    margin-top: 32px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .calendar-container {
        padding: 16px 12px;
    }

    .events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .event-image-placeholder {
        height: 150px;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .events-grid {
        grid-template-columns: 1fr;
    }

    .event-image-placeholder {
        height: 180px;
    }
}

/* Accessibility */
.event-card:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

/* Animation for card loading */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card {
    animation: fadeIn 0.3s ease-out;
}
