/* ===== Global Styles ===== */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    color: #333;
}

body {
    width: 100%;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Keep footer at bottom */
main {
    flex: 1;
}

/* ===== Homepage Styles ===== */
body.homepage {
    margin: 0;
    padding: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
                url("../images/body.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #fff;
}

/* Center homepage content */
body.homepage main {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

body.homepage h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Homepage specific content, exclude footer */
body.homepage main p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

body.homepage a.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 0.3rem;
    transition: background 0.3s;
}

body.homepage a.btn:hover {
    background-color: #c0392b;
}

/* ===== Header ===== */
.site-header {
    width: 100%;
    background: url('../images/wallpaper/nav.avif') no-repeat center center;
    background-size: cover;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    padding: 20px 0;
    display: flex;
    justify-content: center;
    position: relative;
}

.header-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 35px;
    width: auto;
}

.header-container .logo {
    height: 35px;
    width: auto;
    max-height: 60px;
}

.site-title {
    font-size: 2rem;
    font-weight: bold;
    color: #222;
    margin: 0;
}

/* ===== Gallery Page Header Buttons ===== */
.header-buttons {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
}

.header-buttons .btn-header {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 0.3rem;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background 0.3s, transform 0.2s;
}

.header-buttons .btn-header:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* ===== Navigation ===== */
nav {
    background: url("../images/wallpaper/nav.avif") no-repeat center center;
    background-size: cover;
    color: white;
    padding: 7px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav li {
    display: inline-block;
    margin: 0 10px;
}

nav a {
    font-size: 1.25rem;
    color: brown;
    text-decoration: none;
    font-weight: bold;
}

/* Navigation logo styling */
.nav-logo {
    height: 24px;
    width: auto;
    vertical-align: middle;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.nav-logo:hover {
    opacity: 1;
}

/* Logo with tooltip */
.logo-nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.logo-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.logo-link:hover .logo-tooltip {
    opacity: 1;
    visibility: visible;
}

.logo-link {
    cursor: pointer;
}

/* Simple text link */
.text-link-simple {
    display: block;
    color: #666;
    padding: 4px 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.text-link-simple:hover {
    color: #000;
    border-bottom: 2px solid #000;
}

/* ===== Footer ===== */
footer {
    margin-top: auto;
    background: url("../images/wallpaper/footer.avif") no-repeat center center;
    background-size: cover;
    color: green;
    padding: 0;
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.4);
}

.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    padding: 1px 0;
    text-align: center;
    font-size: 0.875rem;
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: green;
}

/* ===== General Constraints ===== */
.container, section, div {
    max-width: 100%;
    box-sizing: border-box;
}

/* Specific page fixes */
body.about-page,
body.projects-page,
body.services-page {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

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

/* Tablet and Mobile */
@media (max-width: 768px) {
    /* Header adjustments */
    .site-header {
        padding: 10px 0;
    }

    .header-container {
        flex-direction: row;
        gap: 10px;
        justify-content: center;
        align-items: center;
    }

    .logo {
        height: 25px;
        max-height: 30px;
    }

    .site-title {
        font-size: 1.3rem;
        line-height: 1.2;
    }

    /* Header buttons for gallery page */
    .header-buttons {
        position: static;
        transform: none;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        margin-top: 10px;
    }

    /* Navigation adjustments */
    nav {
        padding: 5px;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 5px;
    }

    nav li {
        margin: 0 5px;
    }

    nav a {
        font-size: 0.9rem;
        padding: 5px 8px;
    }

    /* Homepage adjustments */
    body.homepage h2 {
        font-size: 1.8rem;
    }

    body.homepage main p {
        font-size: 1rem;
        max-width: 90%;
    }

    /* Footer adjustments - CLEAN AND SIMPLE */
    footer {
        padding: 8px 0;
    }

    .site-footer {
        min-height: 40px;
        padding: 8px 0;
        font-size: 0.75rem;
    }

    .site-footer p {
        font-size: 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.1rem;
    }

    nav a {
        font-size: 0.8rem;
        padding: 4px 6px;
    }

    body.homepage h2 {
        font-size: 1.5rem;
    }

    body.homepage main p {
        font-size: 0.9rem;
    }

    .site-footer {
        font-size: 0.7rem;
        padding: 6px 0;
    }

    .site-footer p {
        font-size: 0.7rem;
    }
}

/* Desktop adjustments for header buttons */
@media (min-width: 769px) {
    .header-buttons {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: row;
    }
}

/* Ensure no horizontal overflow */
* {
    max-width: 100%;
    box-sizing: border-box;
}
