/* CSS styles will go here */

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

html, body {
    height: 100%;
}
/* Define some theme colors (inspired by mockup) */
:root {
    --primary-color: #a12a31; /* Deep Red */
    --background-color: #ffffff; /* White */
    --text-color: #333333;
    --header-height: 80px;
    --text-light: #fff;
}

body {
    font-family: 'Lato', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Apply Lato */
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    /* display: flex;
    flex-direction: column; */
}

/* Utility Classes */
.hidden {
    display: none !important; /* Using important helps ensure override */
}

h1, h2, h3, h4 {
    margin-bottom: 0.8em;
    color: var(--primary-color);
    font-weight: 600;
}

h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

header {
    background-color: var(--background-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky; /* Make header sticky */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999; /* Ensure header stays on top */
    height: var(--header-height);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

.logo img {
    height: 50px; /* Adjust as needed */
    vertical-align: middle; /* Align logo better */
}

.nav-links {
    display: flex;
    align-items: center; /* Vertically align items in desktop view */
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* --- CTA Button Styles --- */
/* Increase specificity to override .nav-links a color */
.nav-links .cta-button {
    background-color: var(--primary-color);
    color: white; /* Explicitly set text color to white */
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    margin-left: 30px; /* Apply margin directly to the button again */
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block; /* Ensures padding is applied correctly */
    white-space: nowrap; /* Prevent text wrapping */
}

/* Increase specificity for hover state too */
.nav-links .cta-button:hover {
    background-color: #812128; /* Slightly darker red on hover */
    color: white; /* Keep text white on hover */
    transform: scale(1.05);
}

/* Burger Menu for Mobile */
.burger {
    display: none; /* Hidden on desktop */
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Burger Animation (X) */
.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

main {
    /* Add padding to avoid content overlapping sticky header */
    padding-top: var(--header-height);
}

section {
    padding: 60px 20px;
    max-width: 1200px; /* Constrain content width */
    margin: 0 auto; /* Center sections */
}

/* Homepage Preview Section Styles */
#previews {
    padding: 60px 20px;
    background-color: #f9f9f9; /* Light background for contrast */
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.preview-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.preview-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.preview-img {
    width: 100%;
    max-width: 180px; /* Control image size */
    height: 120px;    /* Fixed height */
    object-fit: cover; /* Cover the area */
    border-radius: 5px;
    margin-bottom: 15px;
}

.preview-item p {
    color: #555;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.preview-link {
    display: inline-block;
    color: #c89e64;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.preview-link:hover {
    color: var(--primary-color);
}

/* Hero Section Styles */
#hero {
    position: relative; /* Needed for absolute positioning of children */
    height: 70vh; /* Adjust height as needed */
    display: flex;      /* Use flexbox to center content */
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center */
    text-align: center;
    color: var(--text-light); /* White text for contrast */
    overflow: hidden; /* Ensure overlay doesn't bleed out */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Behind content */
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the entire area */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay */
}

.hero-content-container {
    position: relative; /* Sit on top of background/overlay */
    z-index: 2;
    max-width: 900px; /* Limit content width */
    padding: 20px;
}

.hero-title {
    font-size: 3.5rem; /* Adjust size as needed */
    color: #fff; /* White title */
    margin-bottom: 15px;
    font-weight: 600;
    /* text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); */ /* Optional shadow */
}

.hero-date,
.hero-location {
    font-size: 2rem;
    color: #eee; /* Lighter grey for date/location */
    margin-top: 8px;
    /* text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); */ /* Optional shadow */
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-date,
    .hero-location {
        font-size: 18px;
    }
}

/* Participating Universities Logos Section */
#participating-universities {
    padding: 50px 20px; /* Vertical padding */
}

/* Ensure heading inside is centered */
#participating-universities .section-title,
#participating-universities h2 {
    text-align: center; 
    margin-bottom: 40px;
    color: var(--text-color); /* Change color to default text black */
    font-size: 1.8rem; /* Make title smaller */
}

.logo-grid {
    display: flex;
    flex-wrap: wrap; /* Allow logos to wrap on smaller screens */
    justify-content: center; /* Center logos horizontally */
    align-items: center; /* Align logos vertically */
    gap: 40px 50px; /* Row gap and Column gap */
}

.uni-logo {
    max-height: 70px; /* Adjust max height as needed */
    max-width: 150px; /* Prevent logos from becoming too wide */
    object-fit: contain; /* Maintain aspect ratio */
}

/* Speakers Section Styles */

.speakers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.speaker-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

.speaker-card img {
    width: 120px;
    height: 120px;
    aspect-ratio: 1 / 1; /* Force square aspect ratio */
    display: block; /* Ensure block-level behavior */
    margin-left: auto; /* Center the image if container is wider */
    margin-right: auto; /* Center the image if container is wider */
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover; /* Ensure images cover the area */
    border: 3px solid #c89e64;
}

.speaker-card h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.speaker-card p {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.speaker-card .short-bio {
    font-size: 0.9rem;
    color: #666;
}

/* Schedule Section Placeholder */
#schedule {
    background-color: #f9f9f9;
}

.schedule-view {
    /* Grid/Table styles go here */
    margin-top: 40px;
    border: 1px solid #ddd;
    padding: 20px;
    overflow-x: auto; /* Allow horizontal scrolling on small screens if needed */
}

.schedule-day {
    margin-bottom: 40px; /* Space between days */
}

.schedule-day h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c89e64;
    display: inline-block; /* Keep border only as wide as text */
}

.schedule-grid {
    display: grid;
    /* Adjust columns based on the day with the most tracks (Day 1 has 4 tracks + time) */
    grid-template-columns: 1fr 2fr 2fr 2fr 2fr; /* Time | Track 1 | Track 2 | Track 3 | Track 4 */
    gap: 10px;
    margin-top: 20px;
}

.schedule-grid > div { /* Style all direct children */
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #eee;
    font-size: 0.9rem;
}

.time-slot {
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center; /* Center time vertically */
    justify-content: center; /* Center time horizontally */
    text-align: center;
}

.session h4, .session h5 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.session .speaker {
    font-style: italic;
    color: #555;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.session .room {
    font-weight: 500;
    color: #777;
    font-size: 0.85rem;
}

/* Handle column spans */
.session.span-2 {
    grid-column: span 2;
}
.session.span-3 {
    grid-column: span 3;
}
.session.span-4 {
    grid-column: span 4;
}

.session.break {
    background-color: #c89e64 !important;
    color: #fff;
    text-align: center;
}

.session.break h4 {
    color: #fff;
    font-weight: bold;
}

.header { /* General header styles */
    background-color: #3c3c3b !important;
    color: #fff;
    padding: 10px;
    border-right: 1px solid #ddd;
}

/* June 6 Specific Grid Layout */ 
#schedule-jun6 .schedule-grid {
    grid-template-columns: 1fr 3fr 3fr; /* Time | Track 1 | Track 2 */
} 

/* Workshops Page Styles */
#workshops-list .section-subtitle {
    text-align: center;
    max-width: 800px;
    margin: -20px auto 40px auto;
    color: #666;
    font-size: 1.1rem;
}

.workshops-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.workshop-card {
    background-color: #fff;
    border: 1px solid #e0e0e0; /* Subtle border */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Lighter shadow */
    overflow: hidden; /* Ensure image corners conform to border-radius */
    display: flex; /* Use flexbox for better control */
    flex-direction: column; /* Stack image and content vertically */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.workshop-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.workshop-card-image {
    width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
}

.workshop-card-content {
    padding: 20px;
    flex-grow: 1; /* Allow content to fill remaining space */
}

.workshop-card-title {
    font-size: 1.3rem; /* Slightly smaller title */
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.workshop-card-instructor {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
}

.workshop-card-tags {
    margin-top: auto; /* Push tags to the bottom if card heights vary */
    padding-top: 10px; /* Add some space above tags */
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Space between tags */
}

.workshop-card-tags .tag {
    background-color: #f0f0f0; /* Light grey background */
    padding: 4px 10px;
    border-radius: 12px; /* Pill shape */
    font-size: 0.75rem;
    font-weight: 500;
    color: #444;
    white-space: nowrap; /* Prevent tags from breaking line */
}

/* Posters Page Styles */
#posters-gallery .section-subtitle {
    text-align: center;
    max-width: 800px;
    margin: -20px auto 40px auto;
    color: #666;
    font-size: 1.1rem;
}

.filter-controls {
    text-align: center;
    margin-bottom: 40px;
}

.filter-button {
    padding: 8px 18px;
    margin: 0 5px 10px 5px; /* Add bottom margin for wrapping */
    cursor: pointer;
    border: 1px solid #c89e64;
    background-color: #fff;
    color: #c89e64;
    border-radius: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 500;
}

.filter-button:hover,
.filter-button.active {
    background-color: #c89e64;
    color: #fff;
}

.posters-container {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 column */
    gap: 30px;
    padding: 0 20px; /* Add padding to the container, not the grid itself */
    max-width: 1200px; /* Optional: Constrain max width on large screens */
    margin: 0 auto; /* Center the container */
}

/* Tablet Breakpoint */
@media (min-width: 600px) {
    .posters-container {
        grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
    }
}

/* Desktop Breakpoint */
@media (min-width: 900px) {
    .posters-container {
        grid-template-columns: repeat(3, 1fr); /* Desktop: 3 columns */
    }
}

.poster-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poster-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.poster-card-image {
    width: 100%;
    height: 180px; 
    object-fit: cover;
    display: block;
}

.poster-card-content {
    padding: 15px; /* Slightly less padding than workshops */
    flex-grow: 1;
    display: flex; /* Use flex to push button down */
    flex-direction: column;
}

.poster-card-title {
    font-size: 1.15rem; /* Adjust size as needed */
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.poster-card-author {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
}

.poster-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px; /* Space before button */
}

.poster-card-tags .tag {
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
}

.poster-card .view-poster-button {
    margin-top: auto; /* Push button to the bottom */
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Align button left */
}

.poster-card .view-poster-button:hover {
    background-color: #812128; /* Darker gold */
}

/* Poster Modal Styles */
.poster-modal-content {
    /* Specific styles if different from speaker modal */
    width: 70%; /* Wider for poster image */
    max-width: 900px;
}

#poster-modal-img {
    width: 100%;
    max-width: 700px; /* Limit image width */
    height: auto;
    display: block;
    margin: 20px auto; /* Center image */
    border: 1px solid #ddd;
}

#poster-modal-authors {
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
}

#poster-modal-abstract {
    text-align: justify;
}

footer {
    margin-top: auto; /* Esta es la clave - empuja el footer hacia abajo */
    background-color: #3c3c3b;
    color: #f1f1f1;
    text-align: center;
    padding: 30px 20px;
    /* Elimina el margin-top existente */
    margin-top: auto;
}

.footer-logos {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-wrap: wrap; /* Allow logos to wrap on smaller screens */
    justify-content: center;
    align-items: center;
    gap: 15px; /* Spacing between items */
}

.footer-logos p {
    margin: 0 10px; /* Space around text */
    font-size: 0.9rem;
    font-weight: bold;
    color: #ddd; /* Slightly lighter text */
}

.footer-logos img {
    height: 40px; /* Adjust logo height as needed */
    max-width: 100px; /* Prevent logos from becoming too wide */
    object-fit: contain; /* Maintain aspect ratio */
    margin: 5px; /* Add a little space around each logo */
}

/* Responsive Footer Logos (Optional - Adjust if needed) */
@media screen and (max-width: 480px) {
    .footer-logos {
        gap: 10px;
    }
    .footer-logos img {
        height: 30px;
    }
}

/* Modal Styles (Initially Hidden) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 30px;
    border: 1px solid #888;
    width: 60%; /* Could be more or less, depending on screen size */
    max-width: 700px;
    position: relative;
    border-radius: 8px;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Placeholder for speaker modal content styles */
#modal-img {
    max-width: 150px;
    height: 150px; /* Fixed height */
    object-fit: cover; /* Ensure image covers */
    border-radius: 50%;
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
    border: 4px solid #c89e64;
}

#modal-name {
    font-size: 1.8rem;
    color: var(--primary-color);
}

#modal-title {
    font-style: italic;
    color: #555;
    margin-bottom: 15px;
}

#modal-bio, #modal-abstract {
    clear: left; /* Ensure text flows below image */
    padding-top: 10px;
    text-align: justify;
}

#modal-bio {
    margin-bottom: 20px;
}

.modal-content h4 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Responsive Design Adjustments */
@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden; /* Prevent horizontal scroll on mobile */
    }

    .nav-links {
        position: fixed; /* Restore fixed position relative to viewport */
        right: 0px;
        height: 100vh; /* Cover full height */
        top: 0; /* Align to top */
        background-color: var(--background-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 60%; /* Adjust width as needed */
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -2px 0px 5px rgba(0,0,0,0.1);
        padding-top: calc(var(--header-height) + 40px); /* Adjust padding to clear header */
        z-index: 998; /* Ensure it's below burger but above content */
    }

    .nav-links li {
        opacity: 0;
        margin-left: 0; /* Reset margin for vertical layout */
        margin-bottom: 25px; /* Space out links vertically */
        width: 100%; /* Make li take full width */
        text-align: center; /* Center the link text */
    }

    /* Adjust CTA button styles for mobile menu */
    .nav-links .cta-button {
        margin: 0; /* Remove horizontal margin */
        padding: 10px 25px; /* Slightly larger padding for easier tap */
        display: inline-block; /* Keep as inline-block */
        width: auto; /* Allow button to size to content */
        /* Opacity will be handled by the li animation */
    }

    .nav-active {
        transform: translateX(0%);
    }

    /* Animation for nav links (applies to all li, including CTA's li) */
    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0px);
        }
    }

    .burger {
        display: block; /* Show burger on mobile */
        cursor: pointer; /* Ensure pointer */
        z-index: 999; /* Ensure burger is clickable above nav */
        position: relative; /* Helps with z-index */
    }

    #hero h1 {
        font-size: 2.5rem;
    }

    #hero p {
        font-size: 1.5rem;
    }

    section {
        padding: 40px 15px;
    }

    h2 {
        font-size: 1.8rem;
    }

    .speakers-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    .modal-content {
        width: 85%; /* Adjust width for smaller screens */
        margin: 15% auto; /* Adjust margin for smaller screens */
        padding: 20px;
    }

    #modal-img {
        float: none; /* Stack image on mobile */
        display: block;
        margin: 0 auto 15px auto; /* Center image */
        width: 100px; /* Adjust size for modal */
        height: 100px;
    }

    #modal-bio, #modal-abstract {
        clear: none; /* Not needed when image isn't floating */
        text-align: left; /* Align text left on mobile */
    }
}

/* Responsive Schedule Grid */
@media screen and (max-width: 992px) {
    .schedule-grid {
        /* Reduce track column width slightly */
        grid-template-columns: 1fr 1.5fr 1.5fr 1.5fr 1.5fr;
    }
    #schedule-jun6 .schedule-grid {
        grid-template-columns: 1fr 2fr 2fr;
    }
}

@media screen and (max-width: 768px) {
    .schedule-grid {
        /* Stack grid items on smaller screens */
        grid-template-columns: 1fr; /* Single column */
        gap: 5px;
    }

    #schedule-jun6 .schedule-grid {
        grid-template-columns: 1fr; /* Single column */
    }

    .time-slot {
        grid-column: 1 / -1; /* Make time slot span full width */
        text-align: left;
        justify-content: flex-start;
        padding: 10px 15px;
        background-color: #e9e9e9 !important; /* Darker background for time slot */
    }

    .session {
        grid-column: 1 / -1 !important; /* Make sessions span full width, override spans */
    }

    .header {
        display: none; /* Hide track headers on mobile */
    }
}

/* Responsive Poster Grid */
@media screen and (max-width: 576px) {
    .posters-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }

    .poster-thumbnail {
        height: 220px;
    }

    .poster-modal-content {
        width: 90%;
    }
}

/* Remove left margin from the specific li containing the CTA button */
.nav-links li.cta-list-item {
    margin-left: 0; 
}
