/* ==============================
   RESET & BASE
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==============================
   THEMES
============================== */
.dark-theme {
  --bg: #121212;
  --text: #f1f1f1;
  --card-bg: #1e1e1e;
  --card-border: #333;
  --btn-bg: #2b2b2b;
  --btn-text: #fff;
  --accent: rgb(94, 211, 94);
  --overlay: rgba(0,0,0,0.6);
}

.light-theme {
  --bg: #f9f9f9;
  --text: #222;
  --card-bg: #fff;
  --card-border: #ddd;
  --btn-bg: #eee;
  --btn-text: #000;
  --accent: rgb(94, 211, 94);
  --overlay: rgba(0,0,0,0.3);
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ==============================
   NAVBAR
============================== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--card-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px;
  border-bottom: 1px solid var(--card-border);
  z-index: 1000;
}

.navbar .logo {
  color: var(--accent);
  font-weight: bold;
  font-size: 1.4rem;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.navbar a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 500;
}

.navbar a:hover {
  color: var(--accent);
}

/* ==============================
   HEADER / BANNER
============================== */
header {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

header .banner {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}

header .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--overlay);
  z-index: -1;
}

.header-content {
  text-align: center;
  color: var(--text);
  padding: 0 20px;
}

.header-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.header-content p {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.header-content .btn {
  background: var(--accent);
  color: #fff;
  padding: 12px 25px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
}

.header-content .btn:hover {
  background: rgb(80, 180, 80);
  transform: translateY(-2px);
}

/* ==============================
   MAIN CONTENT
============================== */
main {
  padding: 100px 20px 40px;
}

/* ==============================
   SECTIONS
============================== */
section {
  margin-bottom: 60px;
  text-align: center;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--accent);
}

section p {
  max-width: 800px;
  margin: 0 auto 20px;
  line-height: 1.8;
}

/* ==============================
   IMAGES
============================== */
section img {
  width: 100%;
  max-width: 800px;
  margin-top: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ==============================
   GRID / DISCIPLINAS / LISTAS
============================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.grid li {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

.grid li:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* ==============================
   CONTATO
============================== */
.contato ul {
  list-style: none;
  margin-top: 15px;
}

.contato li {
  margin: 8px 0;
}

.contato a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.contato a:hover {
  text-decoration: underline;
}

/* ==============================
   BOTÕES FIXOS
============================== */
#btnTopo, #btnTema {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 18px;
  border-radius: 50px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: background 0.3s, transform 0.2s;
}

#btnTopo {
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  display: none;
}

#btnTopo:hover {
  background: rgb(80, 180, 80);
  transform: translateY(-2px);
}

#btnTema {
  background: var(--btn-bg);
  color: var(--btn-text);
  display: block;
  right: 90px; /* afastado do topo */
}

#btnTema:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ==============================
   RESPONSIVO
============================== */
@media (max-width: 768px) {
  .header-content h1 {
    font-size: 2.2rem;
  }

  .navbar ul {
    flex-direction: column;
    background: var(--card-bg);
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    padding: 15px;
    display: none;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   ACCORDION / DISCIPLINAS
============================== */
.accordion-btn {
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  padding: 15px;
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  text-align: left;
  font-weight: bold;
  margin-bottom: 10px;
  transition: background 0.3s, color 0.3s;
}

.accordion-btn:hover {
  background: var(--accent);
  color: #fff;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--card-bg);
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  border-radius: 0 0 12px 12px;
  padding: 0 15px;
}

.accordion-content p {
  padding: 10px 0;
}

/* ==============================
   BIBLIOTECA / ACORDION LINKS - GRID LADO A LADO
============================== */
#biblioteca {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
}

#biblioteca h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-size: 2rem;
  letter-spacing: 1px;
}

#biblioteca .accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#biblioteca .accordion-btn {
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  padding: 14px 20px;
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 1.05rem;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#biblioteca .accordion-btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Conteúdo do Accordion em grid lado a lado */
#biblioteca .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--card-bg);
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  border-radius: 0 0 12px 12px;
  padding: 10px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#biblioteca .accordion-content li {
  list-style: none;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.3s;
  flex: 1 1 calc(33.333% - 10px); /* três links por linha */
  min-width: 120px;
  box-sizing: border-box;
}

#biblioteca .accordion-content li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  display: block;
  text-align: center;
  padding: 8px 0;
  border-radius: 6px;
  transition: background 0.3s;
}

/* ===============================
   Barra de pesquisa
================================*/
.search-input {
  width: 100%;
  max-width: 400px;
  padding: 10px 15px;
  margin: 15px auto 20px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--btnBg);
  font-size: 1rem;
  background: var(--card-bg, #1e1e1e);
  color: #fff;
}

.search-input::placeholder {
  color: #ccc;
}

.search-input:focus {
  outline: none;
  border-color: var(--btnFontColor, #00C851);
  box-shadow: 0 0 5px var(--btnFontColor, #00C851);
}

#biblioteca .accordion-content li a:hover {
  background: var(--accent);
  color: #fff;
}

/* ==============================
   RESPONSIVO
============================== */
@media (max-width: 768px) {
  #biblioteca {
    padding: 1rem;
  }
  
  #biblioteca .accordion-btn {
    font-size: 1rem;
    padding: 12px 15px;
  }

  #biblioteca .accordion-content {
    flex-direction: column;
  }

  #biblioteca .accordion-content li {
    flex: 1 1 100%;
    padding: 6px 10px;
  }
}
