/* ===== CSS Variables ===== */
:root {
    --primary-color: #D34E4E;
    --secondary-color: #F9E7B2;
    --accent-color: #DDC57A;
    --tertiary-color: #CE7E5A;
    --text-dark: #2c2c2c;
    --text-light: #666;
    --bg-light: #fafafa;
    --white: #ffffff;
    --border-light: #e8e8e8;
}

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

html {
    scroll-behavior: smooth;
}

/* ===== Skip Link for Accessibility ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* ===== Focus States for Accessibility ===== */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.lang-btn {
    background-color: var(--white);
    color: var(--text-dark);
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn:hover {
    background-color: var(--bg-light);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.nav-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-img {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.3rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

/* ===== Hero Section / Header ===== */
.hero-section {
    margin-top: 70px;
    padding: 60px 0 0 0;
}

.hero-header {
    text-align: center;
    padding: 40px 30px;
    background-color: var(--white);
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-light);
    font-weight: 400;
}

/* ===== Slider ===== */
.slider-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

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

.slide.active {
    opacity: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    background-color: var(--bg-light);
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 3;
}

.slider-btn {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background-color: var(--white);
    transform: scale(1.1);
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.dot.active {
    background-color: var(--white);
    transform: scale(1.3);
}

.dot:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* ===== Section Styles ===== */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.subsection-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    margin-top: 30px;
    font-weight: 600;
}

.subsection-title:first-of-type {
    margin-top: 0;
}

/* ===== About Me Section ===== */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-light);
    text-align: justify;
}

.research-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 1rem 0;
}

.research-list li {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.research-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* ===== CV Section ===== */
.cv-container {
    max-width: 900px;
    margin: 0 auto;
}

.cv-item {
    margin-bottom: 20px;
}

.cv-item:last-child {
    margin-bottom: 0;
}

.cv-subtitle {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.cv-subsection {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 10px;
    margin-bottom: 6px;
    font-weight: 600;
}

.cv-list {
    list-style: none;
    padding-left: 0;
}

.cv-list li {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 3px;
    padding-left: 10px;
    position: relative;
}

.cv-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.cv-label {
    font-weight: 600;
    color: var(--text-dark);
}

/* ===== Publications Section ===== */
.publications-list {
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 15px;
}

.publication-item:last-child {
    border-bottom: none;
}

.publication-item > *:not(.publication-pdf) {
    display: inline;
}

.publication-content {
    flex: 1;
}

.publication-year {
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 8px;
}

.publication-separator {
    color: var(--text-light);
    margin: 0 8px;
}

.publication-title {
    font-weight: 500;
    color: var(--text-dark);
    margin-right: 8px;
}

.publication-journal {
    color: var(--text-light);
    font-style: italic;
    display: inline;
    padding-left: 0;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.publication-pdf {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 2px 8px;
    border: 1px solid var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}

.publication-pdf:hover {
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
}

.all-publications-container {
    max-width: 900px;
    margin: 30px auto 0 auto;
    text-align: center;
}

.all-publications-btn {
    display: inline-block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .publication-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .publication-pdf {
        align-self: flex-start;
    }
}

/* ===== Teaching Section ===== */
.teaching-list {
    max-width: 1200px;
    margin: 0 auto;
}

.teaching-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
}

.teaching-column {
    display: flex;
    flex-direction: column;
}

.teaching-category {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 600;
}

.course-item {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

.course-item:last-child {
    border-bottom: none;
}

/* ===== Supervision Section ===== */
.supervision-container {
    max-width: 900px;
    margin: 0 auto;
}

.supervision-item,
.work-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

.supervision-item:last-child,
.work-item:last-child {
    border-bottom: none;
}

/* ===== Contact Section ===== */
.contact-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 78, 78, 0.1);
}

.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.submit-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 14px 30px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    background-color: var(--tertiary-color);
    transform: translateY(-2px);
}

.contact-info {
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-info h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.contact-info p {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.contact-info strong {
    color: var(--text-dark);
    font-weight: 600;
}

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

.contact-info a:hover {
    color: var(--tertiary-color);
    text-decoration: underline;
}

/* ===== Map Container ===== */
.map-container-small {
    margin-top: 15px;
    width: 100%;
    max-width: 300px;
    position: relative;
    padding-bottom: 100%; /* 1:1 aspect ratio for square */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.map-container-small iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== Scroll to Top Button ===== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--tertiary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== Footer ===== */
.footer {
    background-color: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-logo-img {
    height: 30px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .teaching-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .map-container-small {
        max-width: 100%;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-logo-img {
        height: 28px;
    }

    .nav-logo {
        font-size: 0.95rem;
    }

    .language-toggle {
        margin-right: 10px;
    }

    .lang-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section {
        padding: 60px 0;
    }

    .slider-container {
        height: 500px;
    }

    .publication-item {
        font-size: 0.9rem;
        padding: 10px 0;
    }

    .publication-year {
        display: block;
        margin-bottom: 3px;
    }

    .publication-separator {
        display: none;
    }

    .publication-title {
        display: block;
        margin-bottom: 5px;
    }

    .container {
        padding: 0 20px;
    }

    .teaching-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .map-container-small {
        max-width: 100%;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .nav-logo-img {
        height: 24px;
    }

    .nav-logo {
        font-size: 0.85rem;
    }

    .language-toggle {
        margin-right: 5px;
    }

    .lang-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .footer-logo-img {
        height: 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

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

    .section-title {
        font-size: 1.6rem;
    }

    .subsection-title {
        font-size: 1.3rem;
    }

    .slider-container {
        height: 400px;
    }

    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }

    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 1.1rem;
    }

    .teaching-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .map-container-small {
        max-width: 100%;
        margin-top: 20px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .hamburger,
    .language-toggle,
    .slider-controls,
    .slider-dots,
    .scroll-top,
    .contact-form {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }

    .publication-item {
        page-break-inside: avoid;
    }
}
