:root {
    --bg-color: #f4efe6; /* Elegant cream background */
    --header-bg: #ffffff; /* White for cards */
    --text-primary: #334155;
    --text-secondary: #64748b;
    --accent-color: #0f172a;
    --link-color: #475569;
    --link-hover: #0f172a;
    --border-color: #e8e1d5; /* Softer border color for cream theme */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
}

.page-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    /* No backdrop-filter here — it would create a stacking context
       that traps the dropdown behind main content.
       Use ::before pseudo-element instead. */
    background-color: transparent;
    padding: 1.5rem 2rem;
    border-bottom: none;
    width: 100%;
    overflow: visible;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: rgba(244, 239, 230, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

nav {
    position: relative;
    z-index: 1001;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

nav a:hover, nav a.active {
    color: var(--link-hover);
    font-weight: 700;
}

.search-icon {
    margin-left: 0.5rem;
    font-size: 1.1rem;
}

main {
    flex: 1;
    background-color: var(--bg-color);
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: opacity 0.3s ease-in-out;
}

/* Home Page Layout */
.home-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.home-container {
    display: flex;
    align-items: center;
    gap: 4rem;
    width: 100%;
}

.home-image {
    flex: 0 0 350px;
    background-color: #f0ebe1; /* Beige background for the image like in screenshot */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
}

.home-image img {
    width: 100%;
    height: auto;
    display: block;
}

.home-content {
    flex: 1;
}

.home-content h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 1rem;
}

.home-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.home-content a {
    color: var(--text-primary);
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #64748b;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.social-links a:hover {
    background-color: #475569;
    transform: translateY(-2px);
}

/* Recent Activities Carousel */
.recent-activities {
    margin-top: 5rem;
    width: 100%;
}

.recent-activities h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 30px;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 1rem 0;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    width: 100%;
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.carousel-card {
    flex: 0 0 300px;
    scroll-snap-align: start;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.carousel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.carousel-card h3 {
    margin-top: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.carousel-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.carousel-btn {
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: absolute;
    z-index: 10;
    color: var(--text-primary);
    transition: all 0.2s;
}

.carousel-btn:hover {
    background: var(--bg-color);
    transform: scale(1.05);
}

.prev-btn { left: 0; }
.next-btn { right: 0; }

/* About Page Layout */
.about-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.about-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
    margin-top: 0;
}

.about-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 4rem;
}

.about-image {
    flex: 0 0 320px;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.about-text {
    flex: 1;
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.about-text a {
    color: var(--text-primary);
    text-decoration: underline;
}

/* CV Page Layout */
.cv-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.cv-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    margin-top: 0;
}

.cv-intro {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
}

.cv-layout {
    display: flex;
    gap: 4rem;
}

.cv-sidebar {
    flex: 0 0 220px;
}

.cv-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: sticky;
    top: 2rem;
}

.cv-sidebar li {
    margin-bottom: 1.25rem;
}

.cv-sidebar a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.05rem;
    transition: color 0.2s;
}

.cv-sidebar a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.cv-main {
    flex: 1;
}

.cv-section {
    margin-bottom: 3.5rem;
}

.cv-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.cv-item {
    margin-bottom: 2rem;
}

.cv-item h3 {
    font-size: 1.15rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.cv-item .cv-meta {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.cv-item p {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.cv-header-info {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    margin-bottom: 3.5rem;
    font-size: 1.05rem;
}

.cv-header-info strong {
    color: var(--text-primary);
}

.cv-header-info span {
    color: var(--text-secondary);
}

footer {
    background-color: transparent; /* No separated white background */
    padding: 1.5rem 2rem;
    border-top: none; /* Removed the line */
    width: 100%;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.footer-icon {
    color: var(--text-secondary);
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
}

/* Responsive Styles for Mobile and Tablets */
@media (max-width: 900px) {
    .home-container {
        gap: 2rem;
    }
    
    .home-image {
        flex: 0 0 250px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    nav {
        width: 100%;
        position: relative;
        z-index: 1100;
    }
    
    nav ul {
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .home-container, .about-content-wrapper, .cv-layout {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        text-align: center;
    }
    
    .home-image, .about-image, .cv-sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .home-content h1 {
        font-size: 1.8rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .cv-sidebar ul {
        position: static;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .cv-sidebar li {
        margin-bottom: 0;
    }
    
    .cv-header-info {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }
    
    .cv-section h2 {
        text-align: center;
    }

    .carousel-wrapper {
        padding: 0 40px;
    }

    .carousel-btn {
        display: flex; /* Keep buttons visible on mobile */
        width: 36px;
        height: 36px;
    }
    
    .carousel-track {
        padding: 0.5rem 0;
    }

    .carousel-card {
        flex: 0 0 calc(100% - 0px);
    }
    
    main {
        padding: 2rem 1rem;
    }
}

/* --- New UI Enhancements (Animations, Download Button, Carousel Dots) --- */

/* Page Transition Animation */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(15px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Download CV Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background-color: var(--text-primary);
    color: var(--bg-color);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    background-color: #1a252f;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

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

/* Language Switcher Button */
.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    gap: 6px;
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.lang-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .lang-btn {
        margin-left: 0;
        margin-top: 0;
    }

    .lang-dropdown {
        position: relative;
    }

    .lang-dropdown .dropdown-menu {
        /* On mobile, center the dropdown relative to the nav */
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* Page Loader Overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(0, 0, 0, 0.05);
    border-top-color: var(--text-secondary);
    border-radius: 50%;
    animation: spin 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Language Dropdown Styles */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.lang-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background-color: var(--bg-color);
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 9999;
    list-style: none;
    padding: 0.5rem 0;
    border: 1px solid rgba(0,0,0,0.08);
}

/* Desktop: hover to open */
@media (hover: hover) {
    .lang-dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* JS-controlled toggle (mobile + keyboard) */
.lang-dropdown.open .dropdown-menu {
    display: block;
}

.lang-dropdown .dropdown-menu li {
    display: block;
    margin: 0;
}

.lang-dropdown .dropdown-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.lang-dropdown .dropdown-menu li a:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary-color);
}
