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

:root {
    --primary-color: #1e3a8a;
    --primary-dark: #1e40af;
    --secondary-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --accent-color: #2563eb;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: #ffffff;
    font-size: 16px;
    margin: 0;
    padding: 0;
}

body.homepage {
    overflow-x: hidden;
}

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

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header.homepage-hidden {
    display: none;
}

header nav {
    padding: 1.2rem 0;
}

header nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.5px;
}

header h1 a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s;
}

header h1 a:hover {
    opacity: 0.9;
}

header ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

header ul li a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 2px solid transparent;
}

header ul li a:hover {
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
}

/* Main Content */
main {
    min-height: calc(100vh - 250px);
    padding: 3rem 0;
    background-color: #ffffff;
}

body.homepage main {
    min-height: 100vh;
    padding: 0;
}

body.homepage header {
    display: none;
}

/* Homepage Layout with Sidebar */
.homepage-layout {
    display: flex;
    gap: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    align-items: stretch;
    min-height: 100vh;
    height: 100vh;
    position: relative;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: rgba(30, 58, 138, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    width: 50px;
    height: 50px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Styles */
.sidebar {
    flex: 0 0 280px;
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.95) 0%, rgba(30, 64, 175, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 2px 0 12px rgba(0,0,0,0.2);
    position: relative;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
    border-right: 3px solid rgba(59, 130, 246, 0.5);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.sidebar-nav h2 {
    font-size: 1.3rem;
    color: #ffffff;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav ul li {
    margin-bottom: 0.5rem;
}

.sidebar-nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.sidebar-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-left-color: var(--secondary-color);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
}

/* Homepage Main Content */
.homepage-main {
    flex: 1;
    min-width: 0;
    width: 100%;
    position: relative;
}

/* Photo Slideshow */
.photo-slideshow {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.photo-slideshow .slide {
    overflow: hidden;
}

.photo-slideshow .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.photo-slideshow .slide.active {
    opacity: 1;
}

.photo-slideshow .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Conference Info Box */
.conference-info-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 3rem 4rem;
    border-radius: 12px;
    text-align: center;
    z-index: 50;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.conference-info-box h1 {
    color: #fff;
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    letter-spacing: -1px;
}

.conference-info-box h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 1.5rem 0;
    line-height: 1.4;
}

.conference-info-box p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    font-weight: 300;
}

.conference-info-box .conference-structure {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.conference-info-box .conference-structure p {
    font-size: 1rem;
    margin: 0.3rem 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Collaborator Banner */
.collaborator-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    padding: 1.5rem 2rem;
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.banner-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo-item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 200px;
    height: 80px;
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(20%);
    opacity: 0.9;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.logo-item img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

article {
    max-width: 1000px;
    margin: 0 auto;
}

article h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

article h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--primary-dark);
    font-weight: 600;
}

article h3 {
    font-size: 1.5rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--primary-dark);
    font-weight: 600;
}

article h4 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    color: var(--text-color);
    font-weight: 600;
}

article p {
    margin-bottom: 1.2rem;
    color: var(--text-color);
    line-height: 1.8;
}

article ul, article ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

article li {
    margin-bottom: 0.6rem;
    color: var(--text-color);
}

article a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

article a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

article strong {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 4rem 2rem;
    text-align: center;
    margin: -3rem -20px 3rem -20px;
    border-radius: 0 0 8px 8px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fff;
    border: none;
    padding: 0;
}

.hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 800px;
    margin: 0 auto;
}

/* Intro Section */
.intro {
    background: linear-gradient(to bottom, var(--bg-light) 0%, #ffffff 100%);
    padding: 2.5rem;
    border-radius: 8px;
    margin-bottom: 2.5rem;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.intro h2 {
    margin-top: 0;
    color: var(--primary-dark);
}

/* Highlights Section */
.highlights {
    margin: 2.5rem 0;
}

.highlights ul {
    list-style-type: none;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.highlights li {
    padding: 1rem 1.5rem;
    background-color: var(--bg-light);
    border-radius: 6px;
    border-left: 3px solid var(--secondary-color);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.highlights li:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.highlights li:before {
    content: "✓";
    position: absolute;
    left: 0.5rem;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Quick Links Grid */
.quick-links {
    margin-top: 3.5rem;
}

.quick-links h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.link-card {
    background: linear-gradient(to bottom, #ffffff 0%, var(--bg-light) 100%);
    padding: 2rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: block;
}

.link-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-color: var(--secondary-color);
}

.link-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.link-card p {
    color: var(--text-light);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Info Boxes */
.info-box {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--secondary-color);
}

.info-box h3 {
    margin-top: 0;
    color: var(--primary-dark);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

table th {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

table tr:hover {
    background-color: var(--bg-light);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #e5e7eb;
    padding: 2.5rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer .container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .homepage-layout {
        flex-direction: column;
        gap: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        flex: 1;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85%;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .homepage-main {
        width: 100%;
        margin-left: 0;
    }

    .photo-slideshow {
        width: 100%;
    }

    .photo-slideshow {
        height: 100vh;
        min-height: 100vh;
    }

    .conference-info-box {
        padding: 2.5rem 3rem;
        max-width: 85%;
    }

    .conference-info-box h1 {
        font-size: 3rem;
    }

    .conference-info-box h2 {
        font-size: 1.3rem;
    }

    .conference-info-box p {
        font-size: 1.2rem;
    }

    .conference-info-box .conference-structure p {
        font-size: 1rem;
    }

    .collaborator-banner {
        padding: 1rem 1.5rem;
    }

    .banner-content {
        gap: 3rem;
        padding: 0 1rem;
    }

    .logo-item {
        max-width: 150px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    header nav .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header ul {
        justify-content: center;
        gap: 1rem;
        font-size: 0.9rem;
    }

    .homepage-layout {
        padding: 0;
        position: relative;
    }

    .photo-slideshow {
        height: 100vh;
        min-height: 100vh;
    }

    .conference-info-box {
        padding: 1.5rem 1.5rem;
        max-width: 95%;
        margin: 0 auto;
    }

    .conference-info-box h1 {
        font-size: 2rem;
        line-height: 1.1;
    }

    .conference-info-box h2 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .conference-info-box p {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    .conference-info-box .conference-structure {
        margin-top: 1rem;
        padding-top: 0.8rem;
    }

    .conference-info-box .conference-structure p {
        font-size: 0.85rem;
        margin: 0.25rem 0;
    }

    .collaborator-banner {
        padding: 1rem 0.5rem;
    }

    .banner-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .logo-item {
        max-width: 150px;
        height: 50px;
    }

    .sidebar-nav h2 {
        font-size: 1.1rem;
    }

    .sidebar-nav ul li a {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        touch-action: manipulation;
    }

    .sidebar-nav ul li {
        min-height: 44px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    article h1 {
        font-size: 2rem;
    }

    article h2 {
        font-size: 1.6rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .highlights ul {
        grid-template-columns: 1fr;
    }

    main {
        padding: 2rem 0;
    }

    .intro {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    article h1 {
        font-size: 1.75rem;
    }

    .conference-info-box {
        padding: 1.2rem 1rem;
        max-width: 98%;
    }

    .conference-info-box h1 {
        font-size: 1.75rem;
    }

    .conference-info-box h2 {
        font-size: 0.9rem;
    }

    .conference-info-box p {
        font-size: 0.85rem;
    }

    .conference-info-box .conference-structure p {
        font-size: 0.75rem;
    }

    .collaborator-banner {
        padding: 0.8rem 0.5rem;
    }

    .banner-content {
        gap: 1rem;
    }

    .logo-item {
        max-width: 120px;
        height: 40px;
    }

    /* Improve image loading on mobile */
    .photo-slideshow img {
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

    /* Better spacing for conference info on very small screens */
    .conference-info-box {
        line-height: 1.4;
    }

    .sidebar {
        width: 260px;
        padding: 1rem;
    }

    /* Overlay when sidebar is open */
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .sidebar-nav h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .sidebar-nav ul li a {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        touch-action: manipulation;
    }

    /* Improve touch targets on mobile */
    .sidebar-nav ul li {
        min-height: 44px;
    }

    /* Prevent text selection on mobile menu toggle */
    .mobile-menu-toggle,
    .mobile-menu-toggle span {
        user-select: none;
        -webkit-user-select: none;
    }

    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        top: 10px;
        left: 10px;
    }
}
