/* ================================
   ROOT VARIABLES
   ================================ */

:root {
    --text: #e8e8e8;
    --muted: #a0a0a0;
    --light: #777;
    --border: #444;
    --bg: #1a1a1a;
    --accent: #d4646f;
    --card-bg: #252525;
    --card-hover: #2a2a2a;
    --card-gradient: linear-gradient(135deg, #252525 0%, #2a2f35 100%);
    --controls-bg: #252525;
}

/* ================================
   BASE STYLES
   ================================ */

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

body {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
    font-size: 11pt;
    line-height: 1.6;
    color: var(--text);
    background-color: #111;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
}

/* Background image with opacity */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: -1;
}

/* Content wrapper - FULLY OPAQUE dark background */
.page-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    min-height: 100vh;
    background-color: #1a1a1a;
    position: relative;
}

@media (min-width: 900px) {
    .page-wrapper {
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    }
}

/* ================================
   LANGUAGE TOGGLE
   ================================ */

.lang-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 9pt;
}

.lang-toggle a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

.lang-toggle a:hover {
    color: var(--text);
}

.lang-toggle a.active {
    color: var(--text);
    font-weight: 600;
}

/* ================================
   HEADER
   ================================ */

header {
    text-align: center;
    margin-bottom: 2rem;
}

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

/* ================================
   PHOTO
   ================================ */

.photo-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.photo-frame {
    width: 350px;
    height: 350px;
    overflow: hidden;
    border: 3px solid var(--border);
    border-radius: 4px;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-frame.small {
    width: 250px;
    height: 250px;
}

/* ================================
   GENERAL LINKS
   ================================ */

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

a:hover {
    text-decoration: underline;
}

/* ================================
   INTRO
   ================================ */

.intro {
    text-align: left;
}

.intro p {
    margin-bottom: 1rem;
}

/* ================================
   CAROUSEL
   ================================ */

.upcoming-section {
    margin: 2rem 0;
}

.upcoming-section h3 {
    font-size: 10pt;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    text-align: center;
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-viewport {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-card {
    min-width: 100%;
    padding: 1.5rem;
    background: var(--card-gradient);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.carousel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.card-date {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 8pt;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 11pt;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.card-venue {
    font-size: 9.5pt;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.card-location {
    font-size: 9pt;
    color: var(--light);
}

/* Carousel buttons */
.carousel-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 50%;
    font-size: 18px;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carousel-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Carousel dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.dot:hover {
    background: var(--muted);
}

.dot.active {
    background: var(--accent);
    transform: scale(1.2);
}

/* ================================
   CONTACT SECTION
   ================================ */

.contact-section {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--controls-bg);
    border-radius: 8px;
    text-align: center;
}

.contact-section p {
    font-size: 10pt;
    color: var(--muted);
    margin: 0;
}

/* ================================
   FOOTER
   ================================ */

footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    font-size: 9pt;
    color: var(--light);
    margin-top: 0.75rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

.social-icons a {
    color: var(--muted);
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icons a:hover {
    color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}

.social-icons svg {
    width: 22px;
    height: 22px;
}

/* ================================
   NAVIGATION
   ================================ */

nav {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

nav a {
    color: var(--muted);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 10pt;
}

nav a:hover {
    color: var(--text);
}

nav a.nav-active {
    color: var(--text);
    font-weight: 600;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 10pt;
}

.back-link:hover {
    color: var(--accent);
}

/* ================================
   SECTIONS
   ================================ */

section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Research areas */
.research-area {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.research-area .area-label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.research-area p {
    font-size: 10.5pt;
    color: var(--muted);
}

/* Video container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0 0.5rem 0;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.video-caption {
    font-size: 9pt;
    color: var(--muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* Legend */
.legend {
    font-size: 9pt;
    color: var(--muted);
    margin-bottom: 1rem;
}

/* ================================
   RESEARCH INTEREST TAGS
   ================================ */

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 8pt;
    font-weight: 500;
    margin-left: 6px;
    vertical-align: middle;
}

.tag-1 {
    background-color: #1a3a4a;
    color: #7ab8e0;
    border: 1px solid #2a5a7a;
}

.tag-2 {
    background-color: #4a3a1a;
    color: #e0b87a;
    border-color: #7a5a2a;
}

.tag-3 {
    background-color: #3a1a4a;
    color: #c07ae0;
    border-color: #5a2a7a;
}

.tag-L {
    background-color: #1a4a1a;
    color: #7ae07a;
    border-color: #2a7a2a;
}

.tag-C {
    background-color: #1a4a4a;
    color: #7ae0d0;
    border-color: #2a7a70;
}

/* ================================
   TALKS CONTROLS
   ================================ */

.talks-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--controls-bg);
    border-radius: 8px;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 9.5pt;
    color: var(--muted);
    font-weight: 500;
}

.control-group select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 9.5pt;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 9pt;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--card-hover);
}

.filter-btn.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.filter-btn.tag-1-btn.active {
    background: #1a5f8a;
    border-color: #1a5f8a;
    color: white;
}

.filter-btn.tag-2-btn.active {
    background: #8a5a1a;
    border-color: #8a5a1a;
    color: white;
}

.filter-btn.tag-3-btn.active {
    background: #5a1a8a;
    border-color: #5a1a8a;
    color: white;
}

.filter-btn.tag-L-btn.active {
    background: #1a8a1a;
    border-color: #1a8a1a;
    color: white;
}

.filter-btn.tag-C-btn.active {
    background: #1a7a7a;
    border-color: #1a7a7a;
    color: white;
}

/* ================================
   TALKS SECTIONS
   ================================ */

.talks-section-header {
    display: flex;
    align-items: center;
    margin: 2rem 0 1rem 0;
    gap: 1rem;
}

.talks-section-header h4 {
    margin: 0;
    font-size: 11pt;
    color: var(--text);
}

.talks-section-header .line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.talks-section-header .count {
    font-size: 9pt;
    color: var(--muted);
    background: var(--controls-bg);
    padding: 2px 10px;
    border-radius: 10px;
}

/* ================================
   TALKS LIST
   ================================ */

.talks-list {
    list-style: none;
    padding: 0;
}

.talks-list li {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--card-bg);
    border-radius: 6px;
    border-left: 3px solid var(--border);
    transition: all 0.2s ease;
}

.talks-list li:hover {
    background: var(--card-hover);
    transform: translateX(2px);
}

.talks-list li.interest-1 { border-left-color: #7ab8e0; }
.talks-list li.interest-2 { border-left-color: #e0b87a; }
.talks-list li.interest-3 { border-left-color: #c07ae0; }
.talks-list li.interest-L { border-left-color: #7ae07a; }
.talks-list li.interest-C { border-left-color: #7ae0d0; }

/* Gradient borders for multiple tags */
.talks-list li.interest-1.interest-2 {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #7ab8e0 50%, #e0b87a 50%) 1;
}

.talks-list li.interest-1.interest-3 {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #7ab8e0 50%, #c07ae0 50%) 1;
}

.talks-list li.interest-2.interest-3 {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #e0b87a 50%, #c07ae0 50%) 1;
}

.talks-list li.interest-1.interest-C {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #7ab8e0 50%, #7ae0d0 50%) 1;
}

.talks-list li.interest-1.interest-L {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #7ab8e0 50%, #7ae07a 50%) 1;
}

.talks-list li.interest-3.interest-L {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #c07ae0 50%, #7ae07a 50%) 1;
}

.talks-list li.interest-L.interest-C {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #7ae07a 50%, #7ae0d0 50%) 1;
}

.talks-list li.interest-2.interest-C {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #e0b87a 50%, #7ae0d0 50%) 1;
}

.talks-list .title {
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.talks-list .title a {
    color: var(--text);
    text-decoration: none;
}

.talks-list .title a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.talks-list .tags-container {
    display: inline;
}

.talks-list .venue {
    display: block;
    font-size: 9.5pt;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.talks-list .venue a {
    color: var(--muted);
    text-decoration: none;
}

.talks-list .venue a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.talks-list .coauthor {
    display: block;
    font-size: 9pt;
    color: var(--muted);
    font-style: italic;
}

.talks-list .note {
    display: block;
    font-size: 9pt;
    color: var(--accent);
    font-weight: 500;
}

.talks-list .date {
    display: block;
    font-size: 9pt;
    color: var(--light);
    margin-top: 0.5rem;
}

/* Upcoming talks styling */
.upcoming-talks li {
    background: var(--card-gradient);
}

.upcoming-talks li:hover {
    background: var(--card-hover);
}

/* Legend container */
.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--controls-bg);
    border-radius: 6px;
    font-size: 9pt;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.color-1 { background: #7ab8e0; }
.legend-color.color-2 { background: #e0b87a; }
.legend-color.color-3 { background: #c07ae0; }
.legend-color.color-L { background: #7ae07a; }
.legend-color.color-C { background: #7ae0d0; }

/* Hidden state */
.talks-list li.hidden {
    display: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-style: italic;
    display: none;
}

.empty-state.visible {
    display: block;
}

/* ================================
   VARIA PAGE
   ================================ */

#varia h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

#varia p {
    margin-bottom: 1rem;
}

ul.varia-list {
    margin: 0.5rem 0 1.5rem 1.25rem;
    font-size: 10.5pt;
}

ul.varia-list li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

/* Affiliations */
.affiliations {
    font-size: 10pt;
    color: var(--muted);
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 600px) {
    .page-wrapper {
        padding: 2rem 1rem;
    }
    
    .photo-frame {
        width: 150px;
        height: 150px;
    }
    
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .carousel-card {
        padding: 1.25rem 1rem;
    }
    
    .card-title {
        font-size: 10.5pt;
    }
    
    .talks-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-buttons {
        width: 100%;
    }
    
    .legend-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .social-icons {
        gap: 1rem;
    }
    
    nav a {
        margin: 0 0.5rem;
    }
}
