/* Início das Regras Globais */
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Cairo", sans-serif;
}
:root {
  --main-color: #2365ba;
  --main-color-alt: #1787e0;
  --main-transition: 0.3s;
  --main-padding-top: 100px;
  --main-padding-bottom: 100px;
  --section-background: #ececec;
}
.main-title {
  margin: 0 auto 80px;
  border: 2px solid black;
  padding: 10px 20px;
  font-size: 30px;
  width: fit-content;
  position: relative;
  z-index: 1;
  transition: var(--main-transition);
}
.main-title::before,
.main-title::after {
  content: "";
  width: 12px;
  height: 12px;
  background-color: var(--main-color-alt);
  position: absolute;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}
.main-title::before {
  left: -30px;
}
.main-title::after {
  right: -30px;
}
.main-title:hover::before {
  z-index: -1;
  animation: left-move 0.5s linear forwards;
}
.main-title:hover::after {
  z-index: -1;
  animation: right-move 0.5s linear forwards;
}
.main-title:hover {
  color: white;
  border: 2px solid white;
  transition-delay: 0.5s;
}
a {
  text-decoration: none;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.container {
  padding-left: 15px;
  padding-right: 15px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .container {
    width: 750px;
  }
}
@media (min-width: 992x) {
  .container {
    width: 970px;
  }
}
@media (min-width: 1200px) {
  .container {
    width: 1170px;
  }
}
/* /* Fim das regras globais */
 
/* Início do cabeçalho  */
.header {
  background-color: white;
  position: relative;
  -webkit-box-shadow: 0 0 10px #ddd;
  -moz-box-shadow: 0 0 10px #ddd;
  box-shadow: 0 0 10px #ddd;
}
.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}
.header .logo {
  color: var(--main-color);
  font-size: 27px;
  font-weight: bold;
  height: 72px;
  display: flex;
  justify-content: center;
  align-items: center;
}
@media (max-width: 767px) {
  .header .logo {
    width: 100%;
    height: 50px;
  }
}
.header .main-nav {
  display: flex;
}
@media (max-width: 767px) {
  .header .main-nav {
    margin: auto;
  }
}
.header .main-nav > li:hover .mega-menu {
  opacity: 1;
  z-index: 2;
  top: calc(100% + 1px);
}
.header .main-nav > li > a {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 72px;
  position: relative;
  color: black;
  overflow: hidden;
  padding: 0 30px;
  transition: var(--main-transition);
}
@media (max-width: 767px) {
  .header .main-nav > li > a {
    padding: 10px;
    font-size: 15px;
    height: 40px;
  }
}
.header .main-nav > li > a::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 4px;
  background-color: var(--main-color);
  top: 0;
  left: -100%;
  transition: var(--main-transition);
}
.header .main-nav > li > a:hover {
  color: var(--main-color);
  background-color: #fafafa;
}
.header .main-nav > li > a:hover::before {
  left: 0;
}
.header .mega-menu {
  position: absolute;
  width: 100%;
  left: 0;
  padding: 30px;
  background-color: white;
  border-bottom: 3px solid var(--main-color);
  z-index: -1;
  display: flex;
  gap: 40px;
  top: calc(100% + 50px);
  transition: top var(--main-transition), opacity var(--main-transition);
  opacity: 0;
}
@media (max-width: 767px) {
  .header .mega-menu {
    flex-direction: column;
    gap: 0;
    padding: 5px;
  }
}
.header .mega-menu .image img {
  max-width: 100%;
}
@media (max-width: 991px) {
  .header .mega-menu .image {
    display: none;
  }
}
@media (max-width: 1199px) {
  .header .mega-menu .image {
    display: none;
  }
}
.header .mega-menu .links {
  min-width: 250px;
  flex: 1;
}
.header .mega-menu .links li {
  position: relative;
}
.header .mega-menu .links li:not(:last-child) {
  border-bottom: 1px solid #e9e6e6;
}
@media (max-width: 767px) {
  .header .mega-menu .links:first-of-type li:last-child {
    border-bottom: 1px solid #e9e6e6;
  }
}
.header .mega-menu .links li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background-color: #ddd;
  z-index: -2;
  transition: var(--main-transition);
}
.header .mega-menu .links li:hover::before {
  width: 100%;
}
.header .mega-menu .links li a {
  color: var(--main-color);
  display: block;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
}
.header .mega-menu .links li a i {
  margin-right: 10px;
}
/* Fim do cabeçalho  */
/* Início da Landing Page */
.landing {
  position: relative;
}
.landing::before {
  content: "";
  position: absolute;
  left: 0;
  top: -40px;
  width: 100%;
  height: 100%;
  background-color: #ececec;
  z-index: -1;
  transform: skewY(-6deg);
  transform-origin: top left;
}
.landing .container {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  padding-bottom: 120px;
}
.landing .text {
  flex: 1;
}
@media (max-width: 991px) {
  .landing .text {
    text-align: center;
  }
}
.landing .text h1 {
  font-size: 40px;
  margin: 0;
  letter-spacing: -2px;
}
@media (max-width: 767px) {
  .landing .text h1 {
    font-size: 28px;
  }
}
.landing .text p {
  font-size: 26px;
  line-height: 1.7;
  margin: 5px 0 0;
  max-width: 500px;
}
@media (max-width: 991px) {
  .landing .text p {
    margin: 10px auto;
  }
}
@media (max-width: 767px) {
  .landing .text p {
    font-size: 18px;
  }
}
.landing .image img {
  width: 450px;
  margin-left: 10px;
  animation: up-and-down 5s linear infinite;
  position: relative;
}
@media (max-width: 991px) {
  .landing .image {
    display: none;
  }
}
.landing .go-down {
  color: var(--main-color);
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  transition: var(--main-transition);
}
.landing .go-down:hover {
  color: var(--main-color-alt);
}
.landing .go-down i {
  animation: bouncing 1.5s infinite;
}
/* Fim da Landing Page */
/*  Início dos Artigos */

.articles {
  padding-top: var(--main-padding-top);
  padding-bottom: var(--main-padding-bottom);
  position: relative;
}
.articles .container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 40px;
}
.articles .box {
  box-shadow: 0 2px 15px rgb(0 0 0 / 30%);
  background-color: white;
  border-radius: 6px;
  overflow: hidden;
  transition: transform var(--main-transition),
    box-shadow var(--main-transition);
}
.articles .box:hover {
  transform: translateY(-10px);
  box-shadow: 0 2px 15px rgb(0 0 0 / 60%);
}
.articles .box img {
  width: 100%;
  max-width: 100%;
}
.articles .box .content {
  padding: 20px;
}
.articles .box .content h3 {
  margin: 0;
}
.articles .box .content p {
  margin: 10px 0 0;
  line-height: 1.6;
  color: #757676;
}
.articles .box .info {
  padding: 20px;
  border-top: 1px solid #e6e6e7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.articles .box .info a {
  color: var(--main-color);
  font-weight: bold;
}
.articles .box .info i {
  color: violet;
}
.articles .box:hover .info i {
  animation: moving-arrow 0.6s linear infinite;
}
/*  Fim dos Artigos  */
/* Início da Galeria */
.gallery {
  padding-top: var(--main-padding-top);
  padding-bottom: var(--main-padding-bottom);
  position: relative;
  background-color: var(--section-background);
}
.gallery .container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}
.gallery .box {
    padding: 15px;
    background-color: white;
    box-shadow: 0px 12px 20px 0px rgba(13, 74, 204, 0.705),
    0px 2px 4px 0px rgb(0 0 0 / 52%);
}
.gallery .box .image {
    position: relative;
    overflow: hidden;
}
.gallery .box .image::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(37, 82, 206, 0.3);
    width: 0;
    height: 0;
    opacity: 0;
    z-index: 2;
}
.gallery .box .image:hover::before {
    animation: flashing 0.7s ;
}
.gallery .box img {
    max-width: 100%;
    transition: var(--main-transition);
}
.gallery .box .image:hover img {
    transform: rotate(10deg) scale(1.2);
}
/*Fim da Galeria  */
/*  Início das Funcionalidades  */
.features {
    padding-top: var(--main-padding-top);
    padding-bottom: var(--main-padding-bottom);
    position: relative;
    background-color: white;
}
.features .container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}
.features .box {
    text-align: center;
    border: 1px solid #ccc;
}
.features .box .img-holder {
    position: relative;
    overflow: hidden;
}
.features .box .img-holder::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}
.features .box .img-holder::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    border-style: solid;
    border-width: 0px 0px 170px 500px;
    border-color: transparent transparent white transparent;
    transition: var(--main-transition);
}
.features .box .img-holder img {
    max-width: 100%;
}
.features .box:hover .img-holder::after {
    border-width: 170px 500px 170px 0px;
}
.features .box h2 {
    position: relative;
    font-size: 40px;
    margin: auto;
    width: fit-content;
}
.features .box h2::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 15px;
    height: 5px;
    width: calc(100% - 30px);
}
.features .box p {
    line-height: 2;
    font-size: 20px;
    margin: 30px 0;
    padding: 25px;
    color: #777;
    font-weight: bold;
}
.features .box a {
    display: block;
    border: 3px solid transparent;
    width: fit-content;
    margin: 0 auto 30px;
    font-weight: bold;
    font-size: 23px;
    padding: 10px 30px ;
    border-radius: 7px;
    transition: var(--main-transition);
}
.features .qualidade .img-holder::before {
    background-color: rgb(244 64 54 / 30%);
}

.features .qualidade h2::after {
    background-color: #f44036;
}

.features .qualidade a {
    color: #f44036;
    border-color: #f44036;
    background: linear-gradient(to right, #f44036 50%, white 50%);
    background-size: 200% 100%;
    background-position: right bottom;
}

.features .box:hover a {
    background-position: left bottom;
    color: white;
}
.features .fundador .img-holder::before {
    background-color: rgb(0 150 136 / 30%);
}

.features .fundador h2::after {
    background-color: #009688;
}

.features .fundador a {
    color: #009688;
    border-color: #009688;
    background: linear-gradient(to right, #009688 50%, white 50%);
    background-size: 200% 100%;
    background-position: right bottom;
}

.features .contato .img-holder::before {
    background-color: rgb(3 169 244 / 30%);
}

.features .contato h2::after {
    background-color: #03a9f4;
}

.features .contato a {
    color: #03a9f4;
    border-color: #03a9f4;
    background: linear-gradient(to right, #03a9f4 50%, white 50%);
    background-size: 200% 100%;
    background-position: right bottom;
}

/*  Fim das Funcionalidades  */
/* Início da Animação */
@keyframes up-and-down {
  0%,
  100% {
    top: 0;
  }
  50% {
    top: -50px;
  }
}
@keyframes bouncing {
  0%,
  10%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40%,
  60% {
    transform: translateY(-15px);
  }
}
@keyframes left-move {
  50% {
    left: 0;
    width: 12px;
    height: 12px;
  }
  100% {
    left: 0;
    border-radius: 0;
    width: 50%;
    height: 100%;
  }
}
@keyframes right-move {
  50% {
    right: 0;
    width: 12px;
    height: 12px;
  }
  100% {
    right: 0;
    border-radius: 0;
    width: 50%;
    height: 100%;
  }
}
@keyframes moving-arrow {
  100% {
    transform: translateX(10px);
  }
}
@keyframes flashing {
    0%,40% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        width: 200%;
        height: 200%;
    }
}

/* Fim da Animação */

/* ================= Botão Dark ================= */
body.dark-mode {
  background-color: #121212;
  color: #f1f1f1;
}

/* Estilização do botão de troca */
#toggle-dark-mode {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  background-color: #333;
  color: #fff;
  cursor: pointer;
}

/* ================= Botões de Scroll ================= */
#scroll-up, #scroll-down {
  position: fixed;
  right: 20px;
  z-index: 1000;
  padding: 10px;
  border: none;
  border-radius: 50%;
  background-color: #555;
  color: white;
  cursor: pointer;
  font-size: 18px;
}

#scroll-up {
  bottom: 80px;
}

#scroll-down {
  bottom: 140px;
}

/* ================= Modo Escuro por Seção ================= */

/* Seções que precisam de fundo claro mesmo no dark mode */
body.dark-mode .intro-section,
body.dark-mode .top-animes,
body.dark-mode .equipe-section {
  background-color: #f1f1f1;
  color: #121212;
}

/* Força a cor de textos dentro das seções claras */
body.dark-mode .intro-section h1,
body.dark-mode .intro-section h2,
body.dark-mode .intro-section p,
body.dark-mode .top-animes h2,
body.dark-mode .top-animes p,
body.dark-mode .equipe-section h3,
body.dark-mode .equipe-section p {
  color: #121212;
}

/* Botão "Fale Conosco" ou outros da equipe */
body.dark-mode .equipe-section .btn {
  color: #121212;
  border-color: #121212;
}

/* ================= Ajustes Globais de Tipografia ================= */
/* Evita textos sumindo em qualquer lugar */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode p,
body.dark-mode span,
body.dark-mode a,
body.dark-mode li {
  color: #5065a7;
}

:root {
  /* Cores para o modo claro */
  --bg-color: #ffffff;
  --text-color: #000000;
  --section-bg-color: #f1f1f1;
  --section-text-color: #121212;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Seções específicas */
.landing,
.articles,
.gallery,
.features {
  background-color: var(--section-bg-color);
  color: var(--section-text-color);
}

/* Modo escuro */
body.dark-mode {
  --bg-color: #121212;
  --text-color: #f1f1f1;
  --section-bg-color: #1e1e1e;
  --section-text-color: #ffffff;
}
