/* Events Page Styles */
/* Extends master-styles.css */

/* Hero Section */
.page-hero {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.page-hero-half {
    height: 300px;
}

.page-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.page-hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(44, 90, 160, 0.8), rgba(26, 58, 107, 0.9));
    z-index: 2;
}

.page-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 800px;
}

.page-hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-hero-content p {
    font-size: 1.25rem;
    margin: 0;
    opacity: 0.95;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.filter-container h2 {
    color: #2c5aa0;
    margin-bottom: 1.5rem;
    text-align: center;
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 500;
}

.filter-btn:hover {
    background: #f0f7ff;
    border-color: #2c5aa0;
    color: #2c5aa0;
}

.filter-btn.active {
    background: #2c5aa0;
    color: white;
    border-color: #2c5aa0;
}

/* Events Section */
.events-section {
    padding: 3rem 0;
}

.events-section.alternate-bg {
    background: #f8f9fa;
}

.section-header {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.section-header > div {
    text-align: center;
}

.section-header h2 {
    color: #2c5aa0;
    margin: 0 0 0.5rem 0;
}

.section-header p {
    color: #666;
    margin: 0;
}

/* Events Subsection */
.events-subsection {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subsection-title {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    width: 100%;
    text-align: center;
}

.past-subsection .subsection-title {
    color: #666;
}

/* Events Grid - 3 columns on desktop with centering */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
}

/* Ensure exactly 3 columns on larger screens with centering */
@media (min-width: 1200px) {
    .events-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 360px));
        justify-content: center;
        max-width: 1140px; /* (360px * 3) + (2rem * 2) gaps */
        margin-left: auto;
        margin-right: auto;
    }
}

/* For medium screens, ensure 2 columns centered */
@media (min-width: 768px) and (max-width: 1199px) {
    .events-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 360px));
        justify-content: center;
        max-width: 752px; /* (360px * 2) + (2rem * 1) gap */
        margin-left: auto;
        margin-right: auto;
    }
}

/* Event Card */
.event-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.event-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.event-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-card h3 {
    color: #333;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.event-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.event-detail-item span:first-child {
    font-size: 1.1rem;
}

.event-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Event Buttons */
.event-buttons {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.event-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.5rem 1rem 0.75rem 1.25rem;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    border-bottom-left-radius: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0 15px;
    backdrop-filter: blur(8px);
}

/* Category-specific colors */
.event-card[data-category="Meeting"] .category-badge,
.event-card[data-category="meeting"] .category-badge {
    background: rgba(44, 90, 160, 0.9);
}

.event-card[data-category="Social"] .category-badge,
.event-card[data-category="social"] .category-badge {
    background: rgba(255, 107, 53, 0.9);
}

.event-card[data-category="Special"] .category-badge,
.event-card[data-category="special"] .category-badge {
    background: rgba(147, 51, 234, 0.9);
}

/* Announcement Count Badge */
.announcement-count-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b35;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    z-index: 2;
}

.announcement-count-badge.has-urgent {
    background: #f44336;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 2px 12px rgba(244, 67, 54, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
    }
}

/* Past Event Styling */
.past-event-card {
    opacity: 0.8;
}

.past-event-card .event-card-content {
    background: #f8f9fa;
}

.past-event-card h3 {
    color: #666;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

/* Info Section */
.info-section {
    background: #f8f9fa;
    padding: 3rem 0;
    border-top: 1px solid #e0e0e0;
}

.info-box {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.info-box h3 {
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.info-box p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.info-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.info-item strong {
    color: #2c5aa0;
    display: block;
    margin-bottom: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 968px) {
    .events-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
        gap: 1.5rem;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .page-hero-content h1 {
        font-size: 2rem;
    }
    
    .page-hero-content p {
        font-size: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .event-details {
        font-size: 0.85rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .announcement-count-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .page-hero-half {
        height: 250px;
    }
    
    .event-card h3 {
        font-size: 1.25rem;
    }
    
    .event-buttons {
        flex-direction: column;
    }
    
    .event-buttons .btn {
        width: 100%;
    }
    
    .subsection-title {
        font-size: 1.25rem;
    }
}