/*================================================================
    TABLE OF CONTENTS
    1.  COLOR THEME VARIABLES (:root)
    2.  GLOBAL STYLES (html, body, *)
    3.  MAIN LAYOUT (container, sidebar, main-content)
    4.  SIDEBAR COMPONENTS (profile, nav, contacts, theme-switcher)
    5.  MAIN CONTENT COMPONENTS (sections, typography, lists)
    6.  SPECIFIC COMPONENTS (publication cards, resource grid)
    7.  RESPONSIVE DESIGN (media query for mobile)
=================================================================*/

/* 1. DEFINE YOUR COLOR THEME HERE */
:root {
    /* Oceanic Teal Theme */
    --bg-gradient-start: #0f2027;
    --bg-gradient-end: #203a43;
    --card-background: rgba(10, 20, 25, 0.5);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f0f0;
    --text-secondary: #a0c0c0;
    --accent-gradient-start: #13f1fc;
    --accent-gradient-end: #04747c;
    --hover-color: #13f1fc;
}

html.light-mode {
    /* Light Mode Theme */
    --bg-gradient-start: rgb(255, 255, 255);
    --bg-gradient-end: #ffcfcf;
    --card-background: rgb(240, 231, 231);
    --card-border: rgba(0, 0, 0, 0.1);
    --text-primary: #000000;
    --text-secondary: #000000;
    --accent-gradient-start: #800000;
    --accent-gradient-end: #ee0000;
    --hover-color: #cf0080;
}


/* 2. GLOBAL STYLES */
/* Add this for smooth, animated scrolling */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Fira Sans", sans-serif;
    background-color: var(--bg-gradient-start);
    background-image: radial-gradient(circle, var(--bg-gradient-end), var(--bg-gradient-start));
    color: var(--text-primary);
    overflow: hidden; /* Desktop will have scroll within cards */
    transition: background-color 0.3s ease;
}


/* 3. MAIN LAYOUT */
.website-container {
    display: flex;
}

.sidebar {
    width: 240px;
    height: calc(100vh - 2rem);
    position: fixed;
    top: 1rem;
    left: 1rem;
    padding: 2rem;
    
    background: var(--card-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto; /* Allows sidebar to scroll if content is too tall */
}

.main-content {
    flex-grow: 1;
    margin-left: calc(240px + 2rem);
    margin-top: 1rem;
    margin-right: 1rem;
    height: calc(100vh - 2rem);
    overflow-y: auto;

    background: var(--card-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 15px;

    padding: 3rem 4rem;
}


/* 4. SIDEBAR COMPONENTS */
.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem auto;
    border: 2px solid var(--card-border);
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-family: "Michroma", sans-serif;
    text-align: center;
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
}

.navigation ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

.navigation ul li {
    margin-bottom: 1rem;
}

.navigation ul li a {
    text-decoration: none;
    font-family: "Michroma", sans-serif;
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navigation ul li a:hover,
.navigation ul li a.active {
    color: var(--text-primary);
}

.contact-icons {
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.contact-icons a {
    color: var(--text-secondary);
    font-size: 1.8rem;
    transition: color 0.3s ease;
}

.contact-icons a:hover {
    color: var(--hover-color);
}

.theme-switcher {
    margin-top: 1.5rem; /* Space above contact icons */
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: center;
}

.theme-switcher button {
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Michroma", sans-serif;
    transition: all 0.3s ease;
}

.theme-switcher button:hover {
    background: var(--card-border);
    color: var(--text-primary);
}


/* 5. MAIN CONTENT COMPONENTS */
/* Update this rule to reduce spacing */
main.main-content section {
    /* The min-height property is removed for a compact layout */
    margin-bottom: 0; /* Removed the large gap between sections */
    padding-top: 3rem; /* Keeps a consistent space above each section's title */
}

.main-content h1 {
    color: var(--text-primary);
    background-image: linear-gradient(45deg, var(--accent-gradient-start), var(--accent-gradient-end));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    border-bottom: none; /* Remove any old borders */
}

.main-content h2 {
    color: var(--text-primary);
    border-bottom: 2px solid var(--card-border);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.main-content p,
.main-content li {
    line-height: 1.7;
    color: var(--text-secondary);
}

.main-content ul {
    list-style: none;
    padding-left: 0;
}

.main-content li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.75rem;
}

.main-content li::before {
    content: '■';
    position: absolute;
    left: 0;
    color: var(--accent-gradient-start);
}


/* 6. SPECIFIC COMPONENTS */
.publication-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.publication-card:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.1);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 3rem;
}

.grid-item {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.1);
}

.grid-item img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.grid-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
}
.cta-button {
    display: inline-block;
    background-image: linear-gradient(45deg, var(--accent-gradient-start), var(--accent-gradient-end));
    color: #fff; /* Use pure white for max contrast on a button */
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-family: "Michroma", sans-serif;
    margin-top: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 7. RESPONSIVE DESIGN */
@media (max-width: 991.98px) {
    body {
        overflow: auto;
    }

    .website-container {
        flex-direction: column;
        align-items: center;
    }

    .sidebar {
        position: relative;
        width: 95%;
        height: auto;
        margin: 1rem 0;
    }

    .main-content {
        width: 95%;
        height: auto;
        margin: 0 0 1rem 0;
    }
}


/* 1. Add transitions to all elements that change color */
.sidebar,
.main-content,
.profile-name,
.navigation ul li a,
.contact-icons a,
.theme-switcher button,
.main-content h1,
.main-content h2,
.main-content p,
.main-content li,
.cta-button {
    transition: color 0.5s ease, background-color 0.5s ease, border-color 0.5s ease;
}

/* 2. Prepare the body to hold the transition layer */
body {
    position: relative;
    z-index: 1;
}

/* 3. Create the hidden background layer for the animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1; /* Place it behind all content */

    /* Set its background to the light theme gradient */
    background-color: var(--bg-gradient-start);
    background-image: radial-gradient(circle, var(--bg-gradient-end), var(--bg-gradient-start));

    /* Start with it hidden off to the left */
    transform: translateX(-100%);
    
    /* Define the animation properties */
    transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1); /* A smooth easing effect */
}

/* 4. When light mode is active, slide the layer into view */
html.light-mode::before {
    transform: translateX(0);
}