/* Reset and Basic Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3A4965;
    --accent-color: #f9d893;
    --text-light: #ffffff;
    --text-dark: #333333;
    --section-spacing: 80px;
    --card-border-radius: 15px;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5em;
    font-weight: 700;
    line-height: 1.2;
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 80px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    color: var(--text-light);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
}

nav ul li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    left: 0;
    bottom: -5px;
    transition: width 0.3s;
}

nav ul li a:hover {
    color: var(--accent-color);
}

nav ul li a:hover:after {
    width: 100%;
}

/* Events Hero Section Styles */
#events-hero {
    background: linear-gradient(rgba(58, 73, 101, 0.8), rgba(58, 73, 101, 0.8)), url('/images/News_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-light);
    padding: 150px 0 100px;
    text-align: center;
    margin-top: 100px;
}

#events-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#events-hero p {
    font-size: 1.3rem;
    margin-bottom: 0;
    color: var(--text-light);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Section Styles */
section {
    padding: var(--section-spacing) 0;
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
}

section h2:after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background: var(--accent-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Section Background Colors */
#upcoming-events {
    background-color: #ffffff;
}

#event-results {
    background-color: #f8f8f8;
}

/* Event Cards Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Event Card Styles */
.event-card {
    background: #ffffff;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.event-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

/* Date Badge */
.event-date-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    min-width: 60px;
}

.event-date-badge.completed {
    background: #28a745;
}

.event-date-badge .month {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.event-date-badge .day {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.event-date-badge .year {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Card Content */
.event-card-content {
    padding: 25px;
}

.event-card-content h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.event-summary {
    margin-bottom: 20px;
}

.event-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #666;
}

.event-info-item .icon {
    margin-right: 8px;
    font-size: 1rem;
    width: 20px;
}

/* CTA Button */
.cta-button {
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-button:hover {
    background: #f0c674;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 216, 147, 0.4);
}

.cta-button.secondary {
    background: var(--primary-color);
    color: var(--text-light);
}

.cta-button.secondary:hover {
    background: #2e3a4f;
    box-shadow: 0 4px 12px rgba(58, 73, 101, 0.4);
}

/* Modal Basic Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close {
    color: #666;
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

/* Event Detail Modal (for Upcoming Events) */
.event-detail-content {
    max-width: 800px;
}

#event-detail-body {
    padding: 40px;
}

/* Event Result Modal (for Past Events) */
.event-result-content {
    max-width: 1000px;
}

.result-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 500px;
}

.result-gallery {
    background: #f8f8f8;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Remove padding when showing video */
.result-gallery:has(.video-gallery) {
    padding: 0;
    background: #000;
}

/* Fallback for browsers that don't support :has() */
.result-gallery .video-gallery {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

/* Override gallery placeholder for non-video events */
.result-gallery .gallery-placeholder {
    background: #e9ecef;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-info {
    padding: 40px;
    overflow-y: auto;
}

/* Footer Styles */
footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-light);
    font-size: 0.95rem;
    transition: color 0.3s ease;
    opacity: 0.8;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
    opacity: 1;
}

/* Contact Information Styles */
.footer-contact .contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.contact-icon {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-value {
    font-size: 0.95rem;
    color: var(--text-light);
    opacity: 0.9;
    line-height: 1.4;
}

.contact-link {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.contact-link:hover {
    color: var(--accent-color);
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
    }
    
    /* Mobile header container adjustment */
    header .container {
        padding: 0 10px 0 0;
    }
    
    /* Mobile logo position adjustment */
    .logo {
        margin-left: -10px;
    }
    
    #events-hero {
        padding: 120px 0 60px;
    }
    
    #events-hero h1 {
        font-size: 2.5rem;
    }
    
    #events-hero p {
        font-size: 1.1rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .event-card-content {
        padding: 20px;
    }
    
    .event-card-content h3 {
        font-size: 1.3rem;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 20px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-section ul li a {
        font-size: 0.9rem;
    }
    
    .footer-contact .contact-details {
        gap: 15px;
    }
    
    .contact-item {
        gap: 10px;
    }
    
    .contact-icon {
        font-size: 1rem;
    }
    
    .contact-label {
        font-size: 0.8rem;
    }
    
    .contact-value {
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .result-modal-body {
        grid-template-columns: 1fr;
    }
    
    .result-gallery,
    .result-info {
        padding: 0;
    }
    
    .result-info {
        padding: 25px;
    }
    
    /* Video gallery remains fullscreen on mobile */
    .result-gallery:has(.video-gallery) {
        padding: 0;
        background: #000;
    }
    
    .result-gallery .video-gallery {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        margin: 0;
    }
    
    /* Gallery placeholder for non-video events on mobile */
    .result-gallery .gallery-placeholder {
        background: #e9ecef;
        border-radius: 10px;
        padding: 25px;
        text-align: center;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .placeholder-content h3 {
        color: var(--primary-color);
        margin-bottom: 15px;
    }
    
    .placeholder-content p {
        color: #666;
        margin-bottom: 20px;
    }
    
    .gallery-icon {
        font-size: 3rem;
        color: var(--accent-color);
    }
    
    #event-detail-body {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .event-card-content {
        padding: 15px;
    }
    
    .event-card-content h3 {
        font-size: 1.2rem;
    }
    
    .event-date-badge {
        min-width: 50px;
        padding: 8px;
    }
    
    .event-date-badge .day {
        font-size: 1.2rem;
    }
    
    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Video Gallery Styles */
.video-gallery {
    padding: 0;
    margin: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.video-gallery h3 {
    color: var(--primary-color);
    margin: 0;
    padding: 10px;
    font-size: 1.2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
}

.video-title {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
    padding: 8px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
}

/* Photo Gallery Styles */
.photo-gallery {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.photo-gallery h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 10px 0;
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f0f0f0;
    aspect-ratio: 3/4;
    width: 100%;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.photo-item:hover img {
    filter: brightness(1.1);
}

/* Video item styles */
.video-item {
    position: relative;
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-item:hover .play-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.play-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.video-item:hover .play-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 90vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

.lightbox-video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 3001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 3001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 3001;
}

.lightbox-counter {
    font-weight: 600;
}

/* Responsive adjustments for photo gallery */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .photo-gallery {
        padding: 15px;
    }
    
    .photo-gallery h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .play-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .lightbox-nav {
        font-size: 20px;
        padding: 12px 16px;
    }
    
    .lightbox-close {
        font-size: 28px;
        width: 40px;
        height: 40px;
        top: 15px;
        right: 15px;
    }
    
    .lightbox-caption {
        font-size: 12px;
        padding: 8px 15px;
        bottom: 15px;
    }
    
    .lightbox-media-container {
        max-height: 80vh;
    }
    
    .lightbox-video {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .photo-gallery {
        padding: 10px;
    }
    
    .play-icon {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }
    
    .lightbox-nav {
        font-size: 18px;
        padding: 10px 14px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-media-container {
        max-height: 70vh;
    }
    
    .lightbox-video {
        max-height: 70vh;
    }
}
