/* Reset to original CSS with proper mobile menu */
/* Cool Dropdown Menu Styles */

.header-text h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Noto Serif', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.header-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
    font-family: 'Noto Serif', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Also add to other text elements that should use Noto Serif */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0077b6;
    margin-bottom: 0.5rem;
    text-align: center;
    font-family: 'Noto Serif', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropbtn {
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropbtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 5px;
    z-index: 1001;
    animation: dropdownFade 0.3s ease;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #0077b6;
    color: white;
}

.language-dropdown {
    min-width: 150px;
}

.language-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    height: 50px;
    width: 50px;
    object-fit: contain;
}

.header-text h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.header-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Fixed Layout Styles CORRIGIDO */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden; /* Apenas esconder horizontal */
    height: 100vh; /* Importante para mobile */
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(135deg, #0077b6 0%, #03045e 100%);
    color: white;
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* SCROLLABLE CONTENT CORRIGIDO */
.scrollable-content {
    position: fixed;
    top: 70px;
    bottom: 50px;
    left: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #f8f9fa;
    -webkit-overflow-scrolling: touch; /* Suave scroll no iOS */
}

.content-wrapper {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.7) 0%, rgba(3, 4, 94, 0.7) 100%);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    color: white;
    padding: 0.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.footer-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-header {
    position: relative;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/header5.png') center/cover no-repeat;
    opacity: 0.7;
    z-index: 1;
    pointer-events: none;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.6) 0%, rgba(3, 4, 94, 0.6) 100%);
}

.header-content {
    position: relative;
    z-index: 2;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    padding: 30px 0;
}

.div1 {
    width: 100%;
    margin: 20px;
    padding-top: 20px;
}

/* ==================== */
/* MOBILE RESPONSIVENESS - CORRIGIDO */
/* ==================== */

/* Mobile menu toggle (hamburger icon) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Mobile Navigation */
@media screen and (max-width: 1024px) {
    /* CORREÇÃO CRÍTICA PARA SCROLL MOBILE */
    .scrollable-content {
        -webkit-overflow-scrolling: touch !important;
        overflow-y: auto !important;
        touch-action: pan-y !important;
        height: calc(100vh - 120px) !important;
    }
    
    body {
        touch-action: pan-y;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* CRITICAL: Hide desktop navigation */
    .main-nav {
        display: none !important;
    }
    
    .language-desktop {
        display: none !important;
    }
    
    /* Show mobile elements */
    .header-content {
        position: relative;
        min-height: 70px;
    }
    
    .logo-section {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1002;
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background: white;
        border-radius: 5px;
        transition: all 0.3s ease;
    }
    
    /* Language Selector Mobile */
    .language-selector-mobile {
        display: flex !important;
        align-items: center;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
    }
    
    .language-selector-mobile .nav-link {
        padding: 0.5rem;
        width: auto;
        background: none;
        border: none;
    }
    
    /* Mobile language dropdown */
    .language-dropdown-mobile {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: white;
        min-width: 150px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        border-radius: 5px;
        z-index: 1001;
    }
    
    .language-dropdown-mobile.show {
        display: block;
    }
    
    .language-dropdown-mobile a {
        color: #333;
        padding: 12px 16px;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: background-color 0.3s ease;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .language-dropdown-mobile a:last-child {
        border-bottom: none;
    }
    
    .language-dropdown-mobile a:hover {
        background-color: #0077b6;
        color: white;
    }
    
    /* Mobile navigation menu */
    .mobile-nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, #0077b6 0%, #03045e 100%);
        z-index: 1001;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .mobile-nav.active {
        display: block;
    }
    
    .mobile-nav .nav-menu {
        flex-direction: column;
        padding: 0;
        margin: 0;
        gap: 0;
    }
    
    .mobile-nav .nav-item {
        width: 100%;
        text-align: left;
    }
    
    .mobile-nav .nav-link,
    .mobile-nav .dropbtn {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Highlight active dropdown category */
    .mobile-nav .dropbtn.active-dropdown {
        background-color: rgba(255, 255, 255, 0.3) !important;
        border-left: 4px solid white;
        font-weight: 600;
    }
    
    .mobile-nav .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        display: none;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 0;
    }
    
    .mobile-nav .dropdown-content.show {
        display: block;
    }
    
    .mobile-nav .dropdown-content a {
        color: white;
        padding: 0.8rem 2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.2);
    }
    
    .mobile-nav .dropdown-content a:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Ajustes de conteúdo para mobile */
    .content-wrapper {
        padding: 15px;
    }
    
    /* Two-column grid for mobile */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 1rem 0;
        padding: 15px 0;
    }
    
    .site-logo {
        height: 40px;
        width: 40px;
    }
    
    .header-text h1 {
        font-size: 1.2rem;
    }
    
    .header-text p {
        font-size: 0.8rem;
    }
}

@supports (-webkit-touch-callout: none) {
    .scrollable-content {
        height: -webkit-fill-available !important;
    }
}

/* Desktop - Hide mobile elements */
@media screen and (min-width: 1025px) {
    .language-selector-mobile,
    .menu-toggle,
    .mobile-nav {
        display: none !important;
    }
    
    .main-nav {
        display: flex !important;
    }
    
    .language-desktop {
        display: block !important;
    }
    
    /* Highlight desktop dropdown categories */
    .dropbtn.active-dropdown {
        background-color: rgba(255, 255, 255, 0.3) !important;
        border-bottom: 2px solid white;
    }
}

/* Para orientação horizontal em mobile */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    .fixed-header {
        height: 60px;
        padding: 0.3rem 0;
    }
    
    .scrollable-content {
        top: 60px;
        bottom: 40px;
    }
    
    .fixed-footer {
        height: 40px;
        padding: 0.3rem 0;
    }
    
    .mobile-nav {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
    
    .header-text h1 {
        font-size: 1.2rem;
    }
    
    .header-text p {
        font-size: 0.8rem;
    }
    
    .site-logo {
        height: 35px;
        width: 35px;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    .language-selector-mobile {
        right: 5px;
    }
    
    .menu-toggle {
        right: 55px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .content-wrapper {
        padding: 10px;
    }
}

/* GARANTIR que o scroll funciona em todos os dispositivos */
@media screen and (max-width: 1024px) {
    .scrollable-content {
        -webkit-overflow-scrolling: touch !important;
        overflow-y: auto !important;
    }
    
    /* Forçar o height correto no iOS */
    @supports (-webkit-touch-callout: none) {
        .scrollable-content {
            height: calc(100vh - 120px) !important;
        }
    }
}