/* Variables globales */
:root {
    --header-height: 60px;
    --primary-color: #333;
    --background-color: #fff;
    --border-color: #edf2f7;
}

/* Mobile First Approach */
@media (max-width: 768px) {
    /* Container */
    .container {
        width: 100%;
        padding: 0 1rem;
        margin: 0 auto;
    }

    /* Header */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: var(--background-color);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        height: var(--header-height);
    }

    .nav-menu {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--header-height);
        padding: 0 1rem;
    }

    /* Logo */
    .logo {
        text-decoration: none;
        color: var(--primary-color);
    }

    .logo-text {
        font-size: 1.5rem;
        font-weight: bold;
    }

    /* Menu Items Desktop */
    .menu-items {
        display: none;
    }

    /* Social Links in Header */
    .social-links {
        display: flex;
        gap: 1.25rem;
    }

    .social-link {
        color: var(--primary-color);
        font-size: 1.2rem;
    }

    /* Mobile Menu Button */
    .mobile-menu-button {
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-button i {
        font-size: 1.5rem;
        transition: transform 0.3s ease;
    }

    /* Mobile Menu */
    .mobile-menu {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--background-color);
        z-index: 999;
        overflow-y: auto;
    }

    .mobile-menu.active {
        display: block;
    }

    .mobile-menu .container {
        padding: 1rem;
    }

    .mobile-link {
        display: block;
        padding: 1rem;
        color: var(--primary-color);
        text-decoration: none;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.1rem;
    }

    .mobile-social-links {
        display: flex;
        justify-content: center;
        gap: 2rem;
        padding: 2rem 0;
        margin-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    /* Main Content */
    main {
        margin-top: var(--header-height);
    }

    /* Hero Section */
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    /* Research Grid */
    .research-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }

    /* Cards */
    .research-card,
    .publication-card,
    .teaching-card {
        padding: 1.25rem;
        margin: 1rem 0;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }

    .footer-section {
        margin-bottom: 2rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 900px;
        margin: 0 auto;
        padding: 0 2rem;
    }

    .research-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

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

/* Desktop */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 2rem;
    }

    .mobile-menu,
    .mobile-menu-button {
        display: none;
    }

    .menu-items {
        display: flex;
        gap: 2rem;
    }

    .nav-link {
        color: var(--primary-color);
        text-decoration: none;
    }

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

    .research-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a202c;
        --primary-color: #f7fafc;
        --border-color: #2d3748;
    }

    body {
        background-color: var(--background-color);
        color: var(--primary-color);
    }

    .site-header {
        background: rgba(26, 32, 44, 0.9);
        backdrop-filter: blur(10px);
    }

    .mobile-menu {
        background: var(--background-color);
    }

    .mobile-link {
        color: var(--primary-color);
        border-bottom-color: var(--border-color);
    }

    .mobile-social-links {
        border-top-color: var(--border-color);
    }

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

    .research-card,
    .publication-card,
    .teaching-card {
        background: #2d3748;
        border: 1px solid var(--border-color);
    }
}

/* Transitions & Animations */
.mobile-menu {
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.active {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}