/* VARIÁVEIS DE TEMA E TRANSIÇÃO GLOBAL */
:root {
  /* LIGHT MODE (Padrão) */
  --bg: #ffffff;
  --bg2: url('fundolight.png'); 
  --bg3: url('fundomobilelight.png');
  --text: #334155;
  --text-soft: #475569;
  --primary: #1e3a8a;
  --primary-hover: #2563eb;
  --card: #ffffff;
  --border: #e2e8f0;
  --footer: #f1f5f9;
  --text2: #002152;
  --btnsecond: #ffffff;
  --sidebar-bg: #1e3a8a; 
}

[data-theme="dark"] {
  /* DARK MODE */
  --bg: #0f172a;
  --bg2: url('fundodark.png');
  --bg3: url('fundomobiledark.png');
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --primary: #002152;
  --primary-hover: #001d42;
  --card: rgba(169, 177, 180, 0.11);
  --border: #334155;
  --footer: #020617;
  --text2: #ffffff;
  --btnsecond: #002152;
  --sidebar-bg: #050a14; 
}

/* RESET E TRANSIÇÃO GLOBAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;  
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  overflow-x: hidden;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  height: 100vh;
  background: var(--sidebar-bg); 
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  padding: 30px 0;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-header {
  text-align: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}

.sidebar h2 {
  font-size: 1.4rem;
  color: white; 
}

.sidebar p {
  font-size: 0.9rem;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.85);
}

.sidebar a {
  display: block;
  padding: 14px 30px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  border-left: 4px solid transparent;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left: 4px solid white;
  color: white;
}

/* BOTÃO TEMA */
.theme-toggle-btn {
  margin-top: 15px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

/* CONTEÚDO PRINCIPAL */
.main-content {
  margin-left: 260px;
  width: calc(100% - 260px); 
}

section {
  min-height: 100vh;
  padding: 80px 10%;
  display: flex;
  flex-direction: column;
  justify-content: center; 
}

/* HERO E TIPOGRAFIA */
h1 {
  color: var(--text2);
  margin-bottom: 20px;
  font-size: 2.2rem;
}

h3 {
  margin-bottom: 10px;
  color: var(--text2);
}

p {
  color: var(--text-soft);
  line-height: 1.6;
}

.hero {
  gap: 20px;
  background: var(--bg2); 
    background-size: cover;    
    background-position: center; 
    background-repeat: no-repeat;
}

.greeting {
  font-size: 1rem;
  color: var(--text-soft);
}
.highlight {
  color: var(--text2);
}

/* CARDS */
.card, .hardware-card, .apostila-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
}

.card {
  border-left: 6px solid var(--primary);
}

.card:hover, .hardware-card:hover, .apostila-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* TAGS */
.tag {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin: 10px 5px 0 0;
  font-weight: 600;
}

/* GRIDS E HARDWARES */
.hardware-grid, .apostilas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.hardware-foto, .apostila-thumb {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--footer);
}

.hardware-foto img, .apostila-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apostila-thumb { height: 220px; }
.hardware-foto { height: 250px; }

/* BOTÕES E LINKS */
.cta-buttons {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 12px 25px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.btn-secondary {
  padding: 12px 25px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid var(--text2);
  color: var(--text2);
  background: var(--btnsecond);
}

.btn-secondary:hover {
  background: var(--footer);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
/* RODAPÉ */
footer {
  padding: 40px;
  text-align: center;
  background: var(--footer);
  color: var(--text-soft);
  border-top: 1px solid var(--border);
}

/* MENU MOBILE */
.menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2000;
}
#overlay {
    display: none; 
}

/* Somente para telas menores*/
@media (max-width: 1024px) {
    #overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9;        
    }

    body.menu-open #overlay {
        display: block;
    }
}
@media (max-width: 1240px) {
  .menu-toggle { display: block; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; }
  section { padding: 60px 20px; }
}
@media (max-width: 710px) {
  .cta-buttons { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
  
}
@media (max-width: 820px) {
   .hero{
      background: var(--bg3);
      background-size: cover;   
      background-position: center;
      background-repeat: no-repeat;
  }
  .bemvindo{
    margin-top: 150px;
  }
}
@media (max-width: 710px) {
  
  .hardware-grid {   
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; 
    gap: 15px; 
    padding: 10px;
  }

  .hardware-card {   
    width: 100% !important;
    margin-right: 0 !important;
    padding: 10px; 
  }

  .hardware-foto {
    height: 150px !important;
  }
}