/* ============================================================
   IMPORTAÇÃO DA FONTE
   Clash Display usada nos títulos e elementos de destaque
   ============================================================ */
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@500,600&display=swap');

/* ============================================================
   SCROLLBAR PERSONALIZADA
   Cor de destaque: #00ff66 (verde)
   ============================================================ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #333742; }
::-webkit-scrollbar-thumb { background: #4a4e5a; border-radius: 10px; border: 2px solid #333742; }
::-webkit-scrollbar-thumb:hover { background: #00ff66; }

/* ============================================================
   RESET E BASE
   Remove margens/paddings padrão do browser
   overflow-x: hidden previne scroll horizontal indesejado
   padding-top: 80px compensa a altura do header fixo
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background-color: #050505; 
    color: white; 
    font-family: Arial, sans-serif; 
    overflow-x: hidden; 
    padding-top: 80px;
    scrollbar-width: thin;
    scrollbar-color: #4a4e5a #333742;
}

/* ============================================================
   PARTÍCULAS DE FUNDO
   Contentor fixo atrás de todo o conteúdo (z-index: -1)
   As partículas são geradas por JS/effects.js
   Para alterar número/cor de partículas: edita effects.js
   ============================================================ */
#particles-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: -1; overflow: hidden;
}

/* Cada partícula individual gerada pelo JS */
.floating-particle {
    position: absolute; width: 30px;
    filter: drop-shadow(0 0 10px #ffffff) drop-shadow(0 0 20px #ffffff);
    animation: moveAndRotate 20s linear infinite alternate;
}

/* O main fica transparente para as partículas serem visíveis */
main { background-color: transparent !important; position: relative; z-index: 1; }

/* ============================================================
   CABEÇALHO (HEADER)
   Fixo no topo — afeta TODAS as páginas via index.css
   Fundo: #333742 | Borda inferior: #00ff66
   Em mobile: logo e PT|EN ficam na linha 1, nav na linha 2
   ============================================================ */
#header { 
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: #333742; padding: 15px 20px; border-bottom: 2px solid #00ff66;
}

/* Contentor interno com largura máxima centrada */
.header-container { 
    display: flex; justify-content: space-between; align-items: center;
    max-width: 1400px; margin: 0 auto;
}

/* Logo — link que engloba imagem + texto extenso */
.logo-link { text-decoration: none; transition: 0.3s; }
.logo-header { display: flex; align-items: center; gap: 10px; }
.header-logo-img { height: 40px; width: auto; transition: transform 0.3s ease; }
.logo-link:hover .header-logo-img { transform: scale(1.1); }

/* Texto extenso ao lado do logo: "VIDEOJOGOS E APLICAÇÕES MULTIMÉDIA" */
.extenso { 
    color: #00ff66; font-size: clamp(9px, 1.2vw, 12px);
    letter-spacing: 1px; font-weight: bold; text-transform: uppercase;
}

/* Menu de navegação principal */
nav { display: flex; }
nav a { 
    color: white; text-decoration: none; margin-left: 18px;
    font-size: 13px; text-transform: uppercase; font-weight: 500; transition: 0.3s;
}
/* Link ativo (página atual) e hover ficam verdes */
nav a.active, nav a:hover { color: #00ff66; }

/* Seletor PT | EN */
.language-selector { display: flex; align-items: center; gap: 8px; margin-left: 20px; }
.lang-btn { text-decoration: none; color: #888; font-size: 13px; font-weight: 800; transition: 0.3s; }
.lang-btn.active { color: #00ff66; }
.lang-btn:hover { color: #fff; }
.divider { color: #444; font-size: 12px; }

/* ============================================================
   SECÇÃO HERO (VÍDEO PRINCIPAL)
   Ocupa 90% da altura do ecrã
   Contém: animação do logo (só home) + vídeo + botão som
   ============================================================ */
#hero-wrap { 
    position: relative; height: 90vh; min-height: 500px;
    display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   ANIMAÇÃO DO LOGO (SÓ NA HOME)
   Só aparece quando body tem class="is-home"
   Duas imagens: logo_base.png + logo_triangle.png
   Animação: revealIcon → flyAndSnap → moveLogoUp (sobe e sai)
   Para trocar o logo: substitui as imagens em IMGS/
   ============================================================ */
.logo-animation-container {
    display: none; align-items: center; justify-content: center;
    z-index: 50; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.28);
    animation: moveLogoUp 1.2s cubic-bezier(0.85, 0, 0.15, 1) 2.5s forwards;
}
.is-home .logo-animation-container { display: flex; }

.logo-container-inner { position: relative; display: flex; align-items: center; justify-content: center; }
/* Base do logo — aparece primeiro */
.logo-base { height: 250px; opacity: 0; animation: revealIcon 0.8s ease-out 0.5s forwards; }
/* Triângulo — aparece por cima da base */
.logo-tri { height: 250px; position: absolute; top: 0; opacity: 0; animation: flyAndSnap 1s ease-out 1s forwards; }

/* ============================================================
   VÍDEO PRINCIPAL
   Reproduz automaticamente, sem som, em loop
   border-radius: 40px arredonda os cantos
   Para trocar o vídeo: altera src="VIDS/VAM_X.mp4" no HTML
   ============================================================ */
#indexvideo {
    margin-top: 50px; width: 92%; height: 80%; max-width: 1350px;
    border-radius: 40px; overflow: visible; opacity: 0; transform: scale(0.92);
    animation: revealVideo 1.5s ease-out 0.5s forwards;
    position: relative; box-shadow: 0 30px 60px rgba(0,0,0,0.4); z-index: 10;
}

/* Overlay transparente por cima do vídeo
   Nas páginas internas contém o título animado (.reveal-video-text)
   No index não tem escurecimento (sem background) */
.video-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 55; pointer-events: none;
}

#myVideo { width: 100%; height: 100%; object-fit: cover; }

/* Botão de som no canto inferior direito do vídeo
   Controlado por JS/soundvideo.js */
.mute-toggle {
    position: absolute; bottom: 30px; right: 30px; z-index: 9999;
    background: #00ff66; color: #000; border: none; padding: 10px 20px;
    font-family: Arial, sans-serif; font-weight: 900; font-size: 12px;
    letter-spacing: 1px; border-radius: 5px; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.mute-toggle:hover { transform: scale(1.05); background: #fff; }

/* ============================================================
   TÍTULOS E CONTEÚDO
   .titulo-seccao — secção com o título grande
   .shadow-text — estilo do título (usado em todas as páginas)
   .reveal-video-text — variante do título animada sobre o vídeo
   .content-wrapper — contentor do texto corrido
   .texto-corrido — parágrafo com borda esquerda verde
   ============================================================ */
.titulo-seccao { 
    text-align: center; 
    padding: 60px 20px 30px;
    opacity: 0; 
    animation: fadeInGeneral 1s forwards 1.2s;
}

/* Título principal — tamanho responsivo entre 32px e 70px */
.shadow-text { 
    font-size: clamp(32px, 5vw, 70px); font-weight: 900;
    letter-spacing: 4px; text-transform: uppercase; line-height: 1.1;
}
.shadow-text .highlight { color: #00ff66; }

/* Variante do título que anima sobre o vídeo nas páginas internas
   Controlado por JS/open-titles.js */
.shadow-text.reveal-video-text {
    text-shadow: 0 4px 20px rgba(0,0,0,0.9);
    position: absolute; left: 50%;
    transform: translateX(-50%);
    animation: moveTitleUp 1s cubic-bezier(0.85, 0, 0.15, 1) 0.2s forwards;
    margin-top: -100px;
    z-index: 999;
    white-space: nowrap;
}

/* Contentor do texto corrido — largura máxima centrada */
.content-wrapper { 
    max-width: 1100px; margin: 0 auto; 
    padding: 0 20px 50px;
    opacity: 0; animation: fadeInGeneral 1s forwards 1.4s;
}

/* Parágrafo com borda esquerda verde */
.texto-corrido { 
    padding-left: 30px; border-left: 5px solid #00ff66;
    font-size: clamp(16px, 2vw, 20px); line-height: 1.8; color: #ccc; text-align: justify;
}

/* ============================================================
   BOTÃO CANDIDATA-TE
   Fica entre o vídeo e o título na home
   Para alterar o link: muda o href no index.html
   ============================================================ */
.cta-home-wrapper { display: flex; justify-content: center; width: 100%; margin-top: 40px; }

.btn-candidata {
    display: inline-block; background: #00ff66; color: #000;
    padding: 15px 40px; text-decoration: none; font-weight: bold;
    border-radius: 50px; transition: 0.3s; text-transform: uppercase;
}
.btn-candidata:hover { transform: scale(1.1); background: white; }

/* ============================================================
   FOOTER
   Três colunas: logo/morada | contactos | redes sociais
   Para alterar contactos e redes: edita o HTML de cada página
   Para alterar a cor de destaque: substitui #00ff66
   ============================================================ */
#main-footer { 
    background-color: #1a1c23; border-top: 5px solid #00ff66;
    padding: 50px 20px 30px;
    margin-top: 50px;
}

.footer-container { 
    max-width: 1300px; margin: 0 auto; display: flex;
    justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 40px;
}

/* Coluna 1: Logo Lusófona + morada */
.footer-brand { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 250px; }
.footer-brand h4 { color: white; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 25px; font-weight: 900; }
.footer-university { color: white; font-weight: 900; font-size: 17px; text-transform: uppercase; letter-spacing: 1px; }
/* Logo Lusófona — filter inverte para branco */
.lusofona-logo { width: 400px; margin: 15px 0; filter: brightness(0) invert(1); }
.footer-address { font-size: 13px; color: white; line-height: 1.6; }

/* Coluna 2: Contactos */
.footer-info { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 300px; }
.footer-info h4 { color: white; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 25px; font-weight: 900; }
.info-items-group { display: flex; flex-direction: column; align-items: center; text-align: center; }
.info-item { margin-bottom: 12px; font-size: 15px; color: #ffffff; }
.info-item strong { color: #00ff66; margin-right: 8px; text-transform: uppercase; font-size: 12px; }
.footer-link-simple { color: white; text-decoration: none; font-weight: bold; transition: 0.3s ease; }
.footer-link-simple:hover { color: #00ff66; text-decoration: underline; }

/* Coluna 3: Redes sociais */
.footer-socials { display: flex; flex-direction: column; align-items: center; min-width: 150px; }
.footer-socials h4 { color: white; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 25px; font-weight: 900; }
.footer-socials a { color: white; text-decoration: none; font-size: 14px; margin-bottom: 12px; transition: 0.3s; }
.footer-socials a:hover { color: #00ff66; }

/* Linha de copyright no fundo */
.footer-bottom { 
    margin-top: 40px;
    padding-top: 25px; border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center; color: #555; font-size: 11px;
}

/* ============================================================
   KEYFRAMES — ANIMAÇÕES
   moveAndRotate: partículas de fundo
   flyAndSnap: triângulo do logo na home
   revealIcon: base do logo na home
   moveLogoUp: logo sobe e sai do ecrã após animação
   moveTitleUp: título sobe sobre o vídeo nas páginas internas
   revealVideo: vídeo aparece com fade + scale
   fadeInGeneral: fade simples para títulos e texto
   ============================================================ */
@keyframes moveAndRotate {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(5vw, 10vh) rotate(180deg); }
    100% { transform: translate(-5vw, -5vh) rotate(360deg); }
}
@keyframes flyAndSnap {
    0% { transform: scale(1); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes revealIcon { to { opacity: 1; transform: scale(1); } }
@keyframes moveLogoUp {
    0% { top: 50%; transform: translate(-50%, -50%) scale(0.28); }
    100% { top: -80px; transform: translate(-50%, 0) scale(0.28); }
}
@keyframes moveTitleUp {
    0% { top: 50%; transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
    20% { opacity: 1; }
    100% { top: 0%; transform: translate(-50%, 0) scale(1); opacity: 1; }
}
@keyframes revealVideo { to { opacity: 1; transform: scale(1); } }
@keyframes fadeInGeneral { to { opacity: 1; } }

/* ============================================================
   CURSOR PERSONALIZADO (só em dispositivos com rato)
   Triângulo verde que segue o cursor
   Em dispositivos touch é desativado via @media (pointer: coarse)
   Para alterar: edita #custom-cursor abaixo ou em effects.js
   ============================================================ */
@media (pointer: fine) {
    *, *::before, *::after { cursor: none !important; }
    video::-webkit-media-controls, video::-webkit-media-controls-enclosure,
    video::-webkit-media-controls-panel, video::-webkit-media-controls-play-button { cursor: none !important; }
    #custom-cursor {
        width: 18px; height: 18px; position: fixed; top: 0; left: 0;
        pointer-events: none; z-index: 99999; background-color: #00ff66;
        clip-path: polygon(0% 0%, 100% 30%, 30% 100%);
        transform: scale(1); transition: transform 0.15s ease-out, background-color 0.15s ease-out;
    }
}

/* ============================================================
   RESPONSIVIDADE
   1024px — tablets grandes/desktop pequeno
   768px  — tablets verticais
   480px  — telemóveis
   ============================================================ */

/* Tablets e desktops pequenos */
@media (max-width: 1024px) {
    /* Header passa a duas linhas: logo+PT|EN em cima, nav em baixo */
    .header-container { flex-wrap: wrap; gap: 0; }
    .logo-link { flex: 1; }
    .language-selector { margin-left: 0; order: 2; }
    nav { order: 3; width: 100%; justify-content: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
    #hero-wrap { height: 50vh; }
    .shadow-text { font-size: 2.5rem; }
    #indexvideo { width: 85%; height: 50%; }
}

/* Tablets verticais */
@media (max-width: 768px) {
    body { padding-top: 85px; }
    #header { padding: 10px 15px; }
    .header-container { flex-wrap: wrap; align-items: center; gap: 0; }
    .logo-link { flex: 1; display: flex; align-items: center; }
    .logo-header { gap: 8px; }
    /* Logo menor em mobile */
    .header-logo-img { height: 22px; }
    .extenso { display: inline-block; font-size: 8px; white-space: nowrap; line-height: 1; }
    .language-selector { margin-left: 0; order: 2; font-size: 10px; }
    nav { order: 3; width: 100%; justify-content: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
    nav a { margin: 0 8px; font-size: 10px; }
    #hero-wrap { height: 60vh; }
    .shadow-text { font-size: clamp(22px, 6vw, 30px); }
    .shadow-text.reveal-video-text { margin-top: -60px; }
    #indexvideo { width: 92%; height: 50%; margin-top: 15px; }
    .mute-toggle { bottom: 15px; right: 15px; padding: 6px 12px; font-size: 9px; }
    .texto-corrido { font-size: 15px; padding: 0 20px; text-align: justify; }
    /* Footer passa a coluna única centrada */
    .footer-container { flex-direction: column; text-align: center; align-items: center; gap: 25px; }
}

/* Telemóveis */
@media (max-width: 480px) {
    body { padding-top: 70px; }
    /* Hero sem altura mínima forçada para não cortar o logo animado */
    #hero-wrap { height: auto; min-height: 50vh; min-height: unset; display: flex; align-items: center; justify-content: center; }
    /* margin-top extra para dar espaço ao logo animado acima do vídeo */
    #indexvideo { width: 100%; height: auto; max-height: 300px; margin-top: 100px; }
    .shadow-text { font-size: 1.5rem; padding: 0 15px; text-align: center; }
    .texto-corrido { font-size: 1rem; line-height: 1.6; padding: 0 20px; text-align: justify; }
    .mute-toggle { font-size: 10px; padding: 5px; bottom: 10px; right: 10px; }
    /* Texto extenso do logo sem quebra de linha */
    .extenso { font-size: 7px; white-space: nowrap; max-width: unset; line-height: 1.2; }
    /* Nav mais compacto */
    nav a { margin: 0 4px; font-size: 8px; }
    /* Logo Lusófona limitado para não ultrapassar o ecrã */
    .lusofona-logo { width: 100%; max-width: 180px; }
    /* Footer em coluna única com min-width anulado */
    .footer-container { flex-direction: column; align-items: center; text-align: center; gap: 15px; }
    .footer-brand { min-width: unset; width: 100%; align-items: center; }
    .footer-brand h4 { margin-bottom: 10px; }
    .footer-info { min-width: unset; width: 100%; align-items: center; }
    .footer-info h4 { margin-bottom: 10px; }
    .footer-socials { min-width: unset; width: 100%; align-items: center; }
    .info-item { font-size: 12px; }
    .footer-bottom { font-size: 10px; }
}

/* Desativa cursor personalizado em dispositivos touch */
@media (pointer: coarse) {
    * { cursor: auto !important; }
    #custom-cursor { display: none !important; }
}