/* ========== VARIÁVEIS E ESTILOS GLOBAIS ========== */
:root {
    /* Cores */
    --primary-color: #03008A;
    --secondary-color: #4f54c0;
    --accent-color: #03008acc;
    --white-color: #fff;
    --text-color: #333;
    --light-text-color: #777;
    --bg-color: #f5f7ff;
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.9);

    /* Efeitos */
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(3, 0, 138, 0.1);
    --transition: all 0.3s ease;

    /* Espaçamentos */
    --header-height: 80px;
    --section-spacing: 2.5rem;
}

/* Modo dark */
[data-theme="dark"] {
    --primary-color: #6366f1;
    --secondary-color: #818cf8;
    --accent-color: #6366f1cc;
    --text-color: #e5e7eb;
    --light-text-color: #9ca3af;
    --bg-color: #111827;
    --card-bg: #1f2937;
    --header-bg: rgba(31, 41, 55, 0.9);
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* ========== ESTILOS BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: var(--transition);
    padding-top: var(--header-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* BACKGROUND ANIMADO */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--bg-color) 100%);
    opacity: 0.05;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100" opacity="0.03"><path d="M0,50 C20,80 40,20 60,50 S100,20 120,50 S160,80 180,50 S220,20 240,50" stroke="%2303008A" fill="none" stroke-width="2"/></svg>'),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100" opacity="0.03"><path d="M0,30 C15,10 35,90 50,30 S85,90 100,30 S135,10 150,30 S185,90 200,30" stroke="%234f54c0" fill="none" stroke-width="2"/></svg>'),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100" opacity="0.03"><path d="M0,70 C25,40 50,90 75,70 S125,40 150,70 S200,90 225,70" stroke="%236366f1" fill="none" stroke-width="2"/></svg>');
    background-size: 300px 150px;
    animation: moveGraphs 120s linear infinite;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== HEADER ========== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo-container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    transition: var(--transition);
}

.back-button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.back-button:hover {
    background-color: rgba(3, 0, 138, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-selector {
    position: relative;
    display: inline-block;
}

.language-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.language-flag {
    width: 24px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
}

.language-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    z-index: 1;
    padding: 0.5rem 0;
}

.language-dropdown a {
    color: var(--text-color);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.language-dropdown a:hover {
    background-color: rgba(3, 0, 138, 0.1);
}

.language-selector:hover .language-dropdown {
    display: block;
}

/* Botão de tema */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary-color);
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle i {
  font-size: 18px;
  transition: var(--transition);
}

/* Cor do ícone no modo dark */
[data-theme="dark"] .theme-toggle {
  color: var(--white-color);
}

/* Classe para animação de troca de ícone */
.theme-toggle.animate i {
  animation: rotateAndScale 0.45s cubic-bezier(0.01, 0.39, 0.78, 1.04) forwards;
}

/* Animação de rotação e escala */
@keyframes rotateAndScale {
  0% {
    transform: rotate(0deg) scaleX(1);
  }
  50% {
    transform: rotate(90deg) scaleX(1.3); /* Aumenta a escala no meio da animação */
  }
  75% {
    transform: rotate(180deg) scaleX(1.1);
  }
  100% {
    transform: rotate(360deg) scaleX(1);
  }
}

/* Corrige a orientação da lua após a rotação */
.theme-toggle i.fa-moon {
  transform-origin: center;
}

/* Mantém a rotação cumulativa */
.theme-toggle i {
  transform: rotate(var(--rotation, 0deg));
}

/* ========== CONTAINER PRINCIPAL ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.page-header {
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ========== CONTEÚDO DOS TERMOS ========== */
.terms-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 3rem;
    transition: var(--transition);
}

.section {
    margin-bottom: var(--section-spacing);
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.section p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.section p strong {
    font-weight: 600;
}

.section ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.section ul li {
    margin-bottom: 0.5rem;
}

.section ul li strong {
    font-weight: 600;
}

.highlight-box {
    background-color: var(--accent-color);
    color: var(--white-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.highlight-box h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.highlight-box p {
    margin-bottom: 1rem;
}

/* ========== FOOTER ========== */
.main-footer {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

#google_translate_element {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

#translation-loader {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 5px;
    z-index: 1000;
    font-size: 14px;
    display: none;
}

#translation-loader:after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --section-spacing: 2rem;
    }

    .header-container {
        padding: 0 1.5rem;
    }

    .logo {
        height: 40px;
    }

    .container {
        padding: 1.5rem;
    }

    .terms-content {
        padding: 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .section h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 60px;
        --section-spacing: 1.5rem;
    }

    .header-container {
        padding: 0 1rem;
    }

    .container {
        padding: 1rem;
    }

    .terms-content {
        padding: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .section h2 {
        font-size: 1.2rem;
    }

    .highlight-box {
        padding: 1.5rem;
    }

    .language-button span {
        display: none;
    }
}

@keyframes moveGraphs {
    0% {
        background-position: 0 0, 100px 50px, 200px 100px;
    }

    100% {
        background-position: 3000px 1500px, 3100px 1550px, 3200px 1600px;
    }
}