/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Vollkorn:wght@400;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styling */
.header {
    height: 80px;
    background: linear-gradient(to right, white, #a3b87b);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.header .logo {
    height: 60px;
    max-width: 100%;
    object-fit: contain;
}

/* Language switcher button */
.lang-btn {
    background-color: #859e55;
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-family: 'Vollkorn', serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-left: 20px;
}

.lang-btn:hover {
    background-color: #5d7037;
    transform: scale(1.05);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 90px;
    left: 10px;
    z-index: 1001;
    background: rgba(163, 184, 123, 0.9);
    border: none;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.mobile-menu-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

/* Container for main layout */
.container {
    display: flex;
    flex: 1;
    position: relative;
}

/* Main menu styling */
.main_menu {
    width: 250px;
    background-color: #f8f8f8;
    border-right: 2px solid #a3b87b;
    padding: 20px 0;
    transition: transform 0.3s ease;
}

.main_menu ul {
    list-style: none;
}

.main_menu li {
    margin-bottom: 15px;
    padding: 0 10px;
}

.menu-btn {
    position: relative;
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    border-radius: 5px;
    transition: transform 0.2s ease;
}

.menu-btn:hover {
    transform: scale(1.05);
}

.menu-btn img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    display: block;
}

.menu-btn span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: 'Vollkorn', serif;
    font-weight: 600;
    font-size: min(2vw, 18px);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    text-align: center;
    width: 90%;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Main content area */
.contentpage {
    flex: 1;
    padding: 30px;
    padding-top: 30px; /* Extra space to prevent menu button overlap */
    padding-bottom: 80px; /* Extra space to prevent bottom line overlap */
    margin-left: 10px;
    background-color: white;
    min-height: calc(100vh - 80px - 60px); /* Account for header and footer */
    font-family: 'Playfair Display', serif;
}

.contentpage h2 {
    color: #a3b87b;
    margin-bottom: 20px;
    font-size: 2rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.contentpage p {
    font-size: 1.1rem;
    color: #666;
    font-family: 'Playfair Display', serif;
}

/* Table styles */
.table-container {
    margin-top: 30px;
    overflow-x: auto;
}

.conferences-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Playfair Display', serif;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.conferences-table th,
.conferences-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.conferences-table th {
    background-color: #a3b87b;
    color: white;
    font-weight: 600;
    font-family: 'Vollkorn', serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conferences-table tr:hover {
    background-color: #f8f9f5;
}

.conferences-table td:first-child {
    font-weight: 600;
    color: #a3b87b;
    width: 80px;
}

.conferences-table td:nth-child(2) {
    width: 35%;
    line-height: 1.4;
}

.conferences-table td:nth-child(3) {
    width: 15%;
}

.conferences-table td:last-child {
    width: 30%;
}

.conferences-table a {
    display: inline-flex;
    align-items: center;
    color: #a3b87b;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.conferences-table a:hover {
    color: #859e55;
    text-decoration: underline;
}

.conferences-table a img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    opacity: 0.7;
}

.conferences-table a:hover img {
    opacity: 1;
}

/* Submenu styles */
.submenu {
    list-style: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.active {
    max-height: 1000px;
}

.submenu li {
    margin-bottom: 8px;
    padding: 0;
}

.submenu-btn {
    position: relative;
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    border-radius: 5px;
    transition: transform 0.2s ease;
    height: 40px;
}

.submenu-btn:hover {
    transform: scale(1.03);
}

.submenu-btn img {
    width: 100%;
    height: 40px;
    object-fit: cover;
    display: block;
}

.submenu-btn span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: 'Vollkorn', serif;
    font-weight: 600;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    text-align: center;
}

.expandable::after {
    content: " ▼";
    font-size: 12px;
    transition: transform 0.3s ease;
}

.expandable.active::after {
    transform: rotate(180deg);
}

/* Fixed bottom line */
.bottomline {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to right, white, #a3b87b);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    font-size: 14px;
    font-family: 'Vollkorn', serif;
    font-weight: 400;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.bottomline p {
    margin: 0;
    line-height: 1.4;
    text-align: left;
}

/* Video thumbnails styling */
.video-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.video-thumbnail {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.video-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.video-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-button::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid #333;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

.video-thumbnail:hover .play-button {
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Programme section styling */
.programme-section {
    margin: 15px 0;
}

.calendar-icon {
    filter: grayscale(1) brightness(0) invert(1);
}

/* Media section styling */
.media-section h4 {
    color: #859e55;
    font-family: 'Vollkorn', serif;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 15px;
}

.photo-album {
    margin: 15px 0;
}

.album-link {
    display: inline-flex;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(45deg, #a3b87b, #859e55);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-family: 'Vollkorn', serif;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.album-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    color: white;
}

.album-icon {
    font-size: 24px;
    margin-right: 12px;
}

/* Programme table styles */
.programme-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: 'Playfair Display', serif;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.programme-table th {
    background: linear-gradient(45deg, #a3b87b, #859e55);
    color: white;
    padding: 15px;
    text-align: left;
    font-family: 'Vollkorn', serif;
    font-weight: 600;
}

.programme-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.programme-table tr:last-child td {
    border-bottom: none;
}

.programme-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.time-column {
    width: 120px;
    text-align: right;
    font-weight: 600;
    color: #67754c;
    font-size: 16px;
    white-space: nowrap;
}

.content-column {
    text-align: left;
    line-height: 1.5;
}

.section-header {
    background: #f5f7f2 !important;
    font-weight: 700;
    color: #859e55;
    font-size: 18px;
    padding: 15px !important;
}

.section-header .time-column {
    color: #859e55;
}

.break-row {
    background: #ffe6cc !important;
    font-style: italic;
    color: #b8860b;
}

.break-row .time-column {
    color: #b8860b;
}

.plenary-row {
    background: #e6f3ff !important;
    font-weight: 600;
}

.plenary-row .time-column {
    color: #4a90e2;
}

.day-header {
    background: #67754c !important;
    color: white !important;
    font-size: 22px;
    font-family: 'Vollkorn', serif;
    font-weight: 700;
    text-align: center;
}

.author {
    font-weight: 600;
    color: #333;
}

.title {
    font-style: italic;
    margin-top: 5px;
    color: #555;
}

.affiliation {
    font-size: 14px;
    color: #777;
}

.title a {
    color: #67754c;
    text-decoration: none;
    transition: color 0.3s ease;
}

.title a:visited {
    color: #968c63;
}

.title a:hover {
    color: #859e55;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .header .logo {
        height: 50px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .main_menu {
        position: fixed;
        top: 80px;
        left: 0;
        height: calc(100vh - 80px - 60px);
        transform: translateX(-100%);
        z-index: 999;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        overflow-y: auto;
    }
    
    .main_menu.active {
        transform: translateX(0);
    }
    
    .contentpage {
        width: 100%;
        margin-left: 0;
        padding: 20px 15px;
        padding-top: 50px; /* Extra space to prevent menu button overlap */
        padding-bottom: 80px; /* Extra space for bottom line */
    }
    
    .menu-btn span {
        font-size: min(3vw, 16px);
    }
    
    .video-thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .time-column {
        width: 80px;
        font-size: 14px;
    }
    
    .programme-table td {
        padding: 10px 8px;
    }
    
    .section-header {
        font-size: 16px;
    }
}

/* Parallel sections styling */
.parallel-sections-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    align-items: flex-start;
}

.parallel-section {
    flex: 1;
    min-width: 0; /* Allow flexbox to shrink */
}

.parallel-section .programme-table {
    margin: 0;
}

.parallel-sections-header {
    background: #e8f1d8 !important;
    color: #67754c !important;
    font-weight: 700;
    font-size: 20px;
    text-align: center;
    padding: 20px !important;
}

@media (max-width: 1024px) {
    .parallel-sections-container {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .header .logo {
        height: 40px;
    }
    
    .main_menu {
        width: 200px;
    }
    
    .contentpage {
        padding: 15px 10px;
        padding-top: 80px; /* Extra space to prevent menu button overlap */
    }

    .contentpage h2 {
        font-size: 1.5rem;
    }
    
    .conferences-table th,
    .conferences-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .conferences-table td:first-child {
        width: 60px;
    }
    
    .video-thumbnails {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .play-button {
        width: 50px;
        height: 50px;
    }
    
    .play-button::before {
        border-left: 16px solid #333;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        margin-left: 3px;
    }
    
    .bottomline {
        font-size: 12px;
        padding: 10px;
    }

    .parallel-sections-container {
        gap: 15px;
    }
}

/* Photo Gallery Styles */
.media-section {
    margin: 30px 0;
    padding: 0;
}

.media-section h2 {
    font-family: 'Playfair Display', serif;
    color: #7a5a3d;
    margin-bottom: 20px;
    text-align: left;
    border-bottom: 2px solid #a3b87b;
    padding-bottom: 10px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.photo-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.photo-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-thumbnail {
    opacity: 0.9;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #a3b87b;
}

/* Navigation arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    z-index: 2001;
}

.modal-nav:hover {
    background-color: rgba(0,0,0,0.8);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Mobile adjustments for photo gallery */
@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .photo-thumbnail {
        height: 150px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }
    
    .modal-nav {
        font-size: 20px;
        padding: 12px 16px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
}
