/*Estilos comuns para todas as paginas do site ou aplicativo*/

/* Importação das fontes - DEVE estar no topo do arquivo */
@import url("https://fonts.googleapis.com/css2?family=Gill+Sans&family=Handlee&family=Monsieur+La+Doulaise&family=Archivo+Black&display=swap");

/* ========================================================================== */
/* 1. Reset Básico e Variáveis CSS (Custom Properties)                        */
/* ========================================================================== */

:root {
  /* Cores */
  --color-primary-dark: rgba(8, 2, 93, 0.936);
  --color-text-shadow: rgb(101, 100, 105);
  --color-subtitle: rgba(3, 7, 252, 0.6);
  --color-subtitle-shadow: rgb(100, 98, 124);
  --color-footer-text: black;
  --color-border: #040111;

  /* Gradientes */
  --gradient-main: linear-gradient(to right, #ff5f6d, #ffc371, #fff8ba, #b5e8a6, #7ac5c1);

  /* Fontes */
  --font-primary: "Times New Roman", Times, serif;
  --font-title: "Archivo Black", sans-serif;
  --font-subtitle: "Handlee", cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========================================================================== */
/* 2. Estilos Globais e Layout de Tela Cheia                                  */
/* ========================================================================== */

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  font-family: var(--font-primary);
  line-height: 1.6;
  color: #333;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: hidden;
}

/* OTIMIZAÇÃO: 
  Usamos :not(.page-index) para que esta imagem de fundo global
  NÃO seja carregada na página 'index.html', que já tem seu próprio fundo.
*/
body:not(.page-index)::before {
  content: "";
  background-image: url("../img/Logo01.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.25;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* ========================================================================== */
/* 3. Estilos de Layout (Header, Main, Footer)                                */
/* ========================================================================== */

header,
footer {
  padding: 0.75rem 1rem;
  width: 100%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background: var(--gradient-main);
  z-index: 10;

  /* Adições para centralização correta */
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Centraliza verticalmente */
  align-items: center;
  /* Centraliza horizontalmente */
}

main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

footer {
  color: var(--color-footer-text);
  font-size: 1rem;
  text-shadow: 1px 1px 2px rgba(151, 137, 137, 0.8);
}

/* ========================================================================== */
/* 4. Estilos de Componentes Globais                                          */
/* ========================================================================== */

h1 {
  font-size: 1.8rem;
  color: var(--color-primary-dark);
  text-shadow: 2px 2px 3px var(--color-text-shadow);
  transition: transform 0.3s ease;
}

h1:hover {
  transform: scale(1.05);
}

#main-title {
  text-align: center;
  justify-content: center;
  justify-items: center;
}

#main-subtitle {
  font-size: 1.3rem;
  font-family: var(--font-subtitle);
  color: var(--color-subtitle);
  text-shadow: 1px 1px 2px var(--color-subtitle-shadow);
  font-style: italic;
  margin-top: -0.5rem;
  text-align: center;
}

p {
  max-width: 65ch;
  text-align: justify;
  text-indent: 2rem;
  margin-bottom: 0.8rem;
}

button {
  padding: 0.75rem 1.5rem;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  border-radius: 10px;
  border: 2px solid transparent;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

button:hover,
button:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
  outline: none;
}

button:active {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================================================== */
/* 5. Estilos Específicos de Páginas (Ex: Descricao)                          */
/* ========================================================================== */

.description-container,
.description-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.description-column {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#description-image {
  width: 100%;
  max-width: 250px;
  height: auto;
  border-radius: 40px;
  border: 15px double var(--color-border);
  box-shadow: 10px 10px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

#description-image:hover {
  transform: scale(1.03);
  box-shadow: 15px 15px 25px rgba(0, 0, 0, 0.6);
}

.controls {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

#objectives-btn,
#back-btn {
  background: linear-gradient(135deg, #010238, #208bf0);
  border: 2px outset #8ae1f3;
}

#exit-btn {
  background: linear-gradient(135deg, #6e0e0e, #c0392b);
  border-color: #f5b7b1;
}

/* ========================================================================== */
/* 6. Classes Utilitárias e Aviso de Orientação                               */
/* ========================================================================== */

.hidden {
  display: none !important;
}

#orientation-warning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  font-size: 1.5rem;
}

@media screen and (max-width: 800px) and (orientation: portrait) {
  #orientation-warning {
    display: flex;
  }
}

/* ========================================================================== */
/* 7. Media Queries para Responsividade                                       */
/* ========================================================================== */

/* --- Telas Pequenas (até 767px) --- */
@media (max-width: 767px) {
  body {
    overflow-y: auto;
    padding-bottom: 150px;
  }

  footer {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 101;
  }

  .controls {
    position: fixed;
    bottom: 2.5rem;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    z-index: 100;
    margin-top: 0;
  }
}

/* --- Telas Médias (Tablets, a partir de 768px) --- */
@media (min-width: 768px) {
  h1 {
    text-align: center;
    font-size: 2.5rem;
  }

  #main-subtitle {
    font-size: 1.5rem;
  }

  .description-content {
    flex-direction: row;
    align-items: flex-start;
  }

  #description-image {
    max-width: 350px;
  }
}

/* --- Telas Grandes (Desktops, a partir de 1024px) --- */
@media (min-width: 1024px) {

  h1 {
    text-align: center;
  }

  p {
    font-size: 1.1rem;
  }

  #description-image {
    max-width: 300px;
  }
}

/* ========================================================================== */
/* 8. Classes de Destaque (Adicionado na Refatoração)                     */
/* ========================================================================== */

/* Usado para substituir a tag <u> por semântica correta */
.highlight-text {
  text-decoration: underline;
  font-weight: bold;
}