/* 
Propósito do ficheiro: Estilização visual (CSS) principal do site da SAM Engenharia.
Funções presentes: Define esquema de cores corporativas, tipografia, layout responsivo, animações, interatividade de menus e cards. 
Modificações recentes: Adição do estilo para o botão flutuante do Instagram, posicionado acima do botão do WhatsApp.
*/

html {
    scroll-behavior: smooth;
}

body {
    background: rgb(2, 0, 138);
    color: #ffffff;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    position: relative;
}

/* --- Estilização do Texto Flutuante de Fundo --- */
.floating-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1; 
    pointer-events: none; 
}

.floating-text {
    position: absolute;
    color: rgba(255, 255, 255, 0.03); 
    font-size: 4rem;
    font-weight: 800;
    white-space: nowrap;
    text-transform: uppercase;
    user-select: none;
}

.ft-1 { top: 3%; animation: moveRight 50s linear infinite; font-size: 3.5rem; } 
.ft-2 { top: 15%; animation: moveLeft 65s linear infinite; font-size: 5rem; }
.ft-3 { top: 28%; animation: moveRight 45s linear infinite; font-size: 4rem; }
.ft-4 { top: 42%; animation: moveLeft 55s linear infinite; font-size: 6rem; }
.ft-5 { top: 58%; animation: moveRight 70s linear infinite; font-size: 4.5rem; }
.ft-6 { top: 72%; animation: moveLeft 40s linear infinite; font-size: 3.8rem; }
.ft-7 { top: 85%; animation: moveRight 60s linear infinite; font-size: 5.5rem; }
.ft-8 { top: 94%; animation: moveLeft 50s linear infinite; font-size: 3rem; }

@keyframes moveRight {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes moveLeft {
    0% { left: 100%; }
    100% { left: -100%; }
}

/* Estilização do Menu Superior Direito */
.top-nav {
    padding: 20px 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-menu-item {
    color: #ffffff;
    text-decoration: none;
    margin-left: 30px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.nav-menu-item.hover-effect {
    color: #fca311;
    text-shadow: 0 0 8px rgba(252, 163, 17, 0.6);
    transform: translateY(-2px);
}

.nav-menu-item.click-effect {
    color: #e5e5e5;
    transform: scale(0.95);
}

/* Estilização do Conteúdo Principal */
.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.badge-sam {
    border: 1px solid #fca311;
    color: #fca311;
    border-radius: 20px;
    padding: 5px 20px;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    background-color: rgba(252, 163, 17, 0.05);
}

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.text-highlight {
    color: #fca311;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: #d1d5db;
    max-width: 800px;
    margin: 0 auto 40px auto;
    line-height: 1.5;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
}

/* --- Estilização da Seção de Cards com Fotos --- */
.photo-cards-section {
    padding-bottom: 60px;
}

.photo-card {
    background-color: rgb(110, 110, 110);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.photo-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease; 
}

.photo-card:hover .photo-wrapper img {
    transform: scale(1.1); 
}

.photo-card-content {
    padding: 25px;
    flex-grow: 1;
}

.photo-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
}

.photo-card-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #fca311;
    margin-bottom: 15px;
}

.photo-card-text {
    font-size: 0.95rem;
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 0;
}

/* --- Estilização da Seção Nossa História --- */
.history-section {
    padding-bottom: 60px;
}

.history-content {
    padding-right: 20px;
}

.history-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fca311;
    margin-bottom: 20px;
}

.history-text {
    font-size: 1.1rem;
    color: #9ca3af;
    line-height: 1.7;
    margin-bottom: 15px;
}

.history-image-wrapper {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.history-image-wrapper:hover img {
    transform: scale(1.05);
}

/* --- Estilização da Seção de Direcionadores Estratégicos --- */
.strategic-section {
    padding-bottom: 60px;
}

.strategic-card {
    background-color: rgb(110, 110, 110);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 380px; 
}

.strategic-card:hover {
    transform: translateY(-5px);
}

.icon-box {
    background-color: #171b22;
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fca311;
    border: 1px solid rgba(252, 163, 17, 0.2);
}

.strategic-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.strategic-text {
    font-size: 1.1rem;
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 0;
}

/* --- Estilização da Seção Ensaios Elétricos e Normas --- */
.ensaios-section {
    padding-bottom: 60px;
}

.ensaio-card {
    background-color: rgb(110, 110, 110);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    margin-bottom: 15px; 
}

.ensaio-card:hover {
    transform: translateY(-3px);
}

.ensaio-icon {
    color: #fca311;
    font-size: 1.5rem;
    margin-right: 20px;
    min-width: 40px;
    text-align: center;
}

.ensaio-text {
    font-size: 1.05rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.5;
}

.ensaio-text strong {
    color: #ffffff;
    font-weight: 700;
}

/* --- Estilização da Seção Linha do Tempo (Timeline) --- */
.timeline-section {
    padding-bottom: 60px;
}

.timeline {
    border-left: 3px solid rgba(252, 163, 17, 0.3);
    padding-left: 30px;
    margin-left: 15px;
    position: relative;
}

.timeline-item {
    margin-bottom: 20px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -38px;
    top: 15px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #fca311;
    border: 3px solid #171b22;
}

.timeline-header {
    background-color: rgb(110, 110, 110);
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.timeline-header:hover {
    transform: translateX(5px);
    border-color: rgba(252, 163, 17, 0.5);
}

.timeline-year {
    font-weight: 900;
    color: #fca311;
    margin-right: 25px;
    font-size: 1.3rem;
    min-width: 80px;
    text-align: center;
}

.timeline-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0;
    flex-grow: 1;
}

.timeline-icon {
    color: #9ca3af;
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.timeline-header[aria-expanded="true"] .timeline-icon {
    transform: rotate(180deg);
    color: #fca311;
}

.timeline-header[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: rgba(252, 163, 17, 0.3);
}

.timeline-body {
    background-color: #1a1f26;
    padding: 20px 25px;
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(255,255,255,0.05);
    border-top: none;
    color: #9ca3af;
    font-size: 1.05rem;
    line-height: 1.6;
}

.status-badge {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 15px;
    display: inline-block;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

/* --- Estilização da Seção de Indicadores --- */
.indicators-section {
    padding-bottom: 60px;
}

.indicator-card {
    background-color: rgb(110, 110, 110);
    border-top: 5px solid #fca311;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    min-height: 380px; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
}

.indicator-card:hover {
    transform: translateY(-5px);
}

.indicator-number {
    font-size: 5rem; 
    font-weight: 900;
    color: #fca311;
    margin-bottom: 10px;
    line-height: 1;
}

.indicator-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
}

.indicator-text {
    font-size: 1.15rem;
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 0;
}

/* --- Estilização da Seção de Portfólio de Serviços --- */
.portfolio-section {
    padding-bottom: 60px;
}

.portfolio-card {
    background-color: rgb(110, 110, 110);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
}

.portfolio-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.portfolio-card-title i {
    color: #fca311;
    font-size: 1.8rem;
}

.portfolio-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portfolio-list li {
    font-size: 1.1rem;
    color: #9ca3af;
    margin-bottom: 20px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}

.portfolio-list li i {
    color: #fca311;
    margin-top: 5px;
    margin-right: 15px;
    font-size: 1.1rem;
}

.portfolio-list li strong {
    color: #e5e7eb;
    font-weight: 700;
}

/* --- Estilização da Seção de Clientes (Carrossel Antigo) --- */
.clients-section {
    padding-bottom: 0; 
    margin-bottom: 0;
    overflow: hidden; 
}

.clients-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0 40px 0; 
}

.clients-track {
    display: flex;
    width: fit-content;
    animation: scrollClients 45s linear infinite;
}

.clients-track:hover {
    animation-play-state: paused; 
}

.clients-group {
    display: flex;
    gap: 30px; 
    padding-right: 30px; 
}

.client-logo-box {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 15px;
    width: 200px; 
    height: 100px; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0; 
}

.client-logo-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(252, 163, 17, 0.2);
}

.client-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes scrollClients {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Estilização da Página Específica de Clientes (Grid) --- */
.clients-grid-section {
    padding: 60px 0;
    flex: 1; 
}

.clients-grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.client-grid-box {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 15px;
    width: 206px; 
    height: 106px; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.client-grid-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(252, 163, 17, 0.2);
}

.client-grid-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- Botão Voltar ao Topo --- */
#backToTopBtn {
    display: none; 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 99; 
    font-size: 20px; 
    border: none; 
    outline: none; 
    background-color: #fca311; 
    color: #171b22; 
    cursor: pointer; 
    width: 50px;
    height: 50px;
    border-radius: 50%; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#backToTopBtn:hover {
    background-color: #ffffff; 
    transform: scale(1.1);
}

/* --- Botão Flutuante WhatsApp --- */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    left: 30px; 
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.floating-whatsapp:hover {
    background-color: #128c7e;
    color: #FFF;
    transform: scale(1.1);
}

/* --- Botão Flutuante Instagram --- */
.floating-instagram {
    position: fixed;
    bottom: 105px; /* Posicionado 75px acima do bottom do whatsapp (30px + 60px + 15px de gap) */
    left: 30px; 
    width: 60px;
    height: 60px;
    /* Gradiente oficial do Instagram */
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);
    color: #FFF;
    border-radius: 50px;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.floating-instagram:hover {
    transform: scale(1.1);
    color: #FFF;
}

/* ========================================================================= */
/* --- AJUSTES DE RESPONSIVIDADE (MOBILE) ---                                */
/* ========================================================================= */
@media (max-width: 992px) {
    .top-nav {
        justify-content: center;
        flex-wrap: wrap;
        padding: 10px 20px;
    }
    
    .nav-menu-item {
        margin: 10px 15px;
        font-size: 0.9rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    /* Ajustes dos botões flutuantes para mobile */
    .floating-whatsapp {
        width: 50px;
        height: 50px;
        font-size: 30px;
        left: 15px;
        bottom: 15px;
    }
    
    .floating-instagram {
        width: 50px;
        height: 50px;
        font-size: 30px;
        left: 15px;
        bottom: 75px; /* 15px + 50px + 10px de gap */
    }
    
    #backToTopBtn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        right: 15px;
        bottom: 15px;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-year {
        margin-bottom: 5px;
    }
    
    .timeline-icon {
        position: absolute;
        right: 20px;
        top: 20px;
    }
}