:root {
  /* MODO DARK */
  --bg: #080c14;
  --sidebar-bg: #0f172a;
  --card: rgba(15, 23, 42, 0.75);
  --card-item: rgba(255, 255, 255, 0.03);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-yellow: #ffdb0d;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --accent-pink: #f43f5e;
  --border: rgba(179, 173, 173, 0.2);
  --font-family: "Plus Jakarta Sans", sans-serif;
}

body.light {
  /* MODO LIGHT */
  --bg: #e7eaeed3;
  --sidebar-bg: #ffffff;
  --card: rgba(255, 255, 255, 0.95);
  --card-item: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0284c7;
  --accent-purple: #7c3aed;
  --accent-green: #059669;
  --accent-pink: #e11d48;
  --border: rgba(15, 23, 42, 0.12);
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border);
  z-index: 2000;
  transition: background 0.3s, border-color 0.3s;
}

body.light .navbar {
  background: rgba(213, 212, 218, 0.801);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  font-size: 1.8rem;
  color: var(--accent);
}

.logo h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo h2 span {
  color: var(--accent);
}

.nav-desktop {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-desktop a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s;
  position: relative;
  padding: 8px 0;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--accent);
}

.nav-desktop a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-desktop a.active::after,
.nav-desktop a:hover::after {
  width: 100%;
  left: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.theme-switch-container {
  position: relative;
  width: 46px;
  height: 24px;
}

#theme-toggle {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  border-radius: 34px;
  transition: background-color 0.3s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: rgb(255, 255, 255);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

body.light .switch-slider {
  background-color: var(--accent-purple);
}

#theme-toggle:checked + .switch-slider::before,
body.light .switch-slider::before {
  transform: translateX(22px);
}

/* SIDEBAR MOBILE */
.sidebar {
  width: 260px;
  height: 90vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--sidebar-bg);
  z-index: 3000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  padding: 30px 20px;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.sidebar.open {
  transform: translateX(0);
}

.nav-mobile {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 10px;
}

.nav-mobile a {
  text-decoration: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
}

.nav-mobile a.active {
  color: var(--accent);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 2500;
  transition: opacity 0.3s;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* MAIN LAYOUT */
.main-content {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.dashboard-grid {
  display: flex;
  width: 500%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  touch-action: pan-y;
}

section {
  margin-top: 10px;
  width: 50%;
  height: 100vh;
  padding: 100px 5% 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}


.glass-card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-top:25px;
  padding: 10px;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.card-item {
  background: var(--card-item);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  transition: border-color 0.3s, background 0.3s;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  transition: transform 0.2s ease, filter 0.2s ease;
  cursor: default;
}

.card-item:hover .tag {
  transform: translateY(-2px);
}

.card-item .tag:hover {
  filter: brightness(1.2);
}

/* LISTA DE CARDS INTERATIVOS (HOME/SKILLS) */
.skills-card-list {
  padding: 20px;
  align-items: center;
  align-content: center;
  align-self: center;
  display: grid;
  flex-direction: column;
  gap: 15px;
  width: 90%;
}

.skill-card-item {
  background: var(--card-item);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.skill-card-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.15);
}

.skill-card-item i {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.skill-card-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.skill-card-item p {
  font-size: 0.8rem;
  color: var(--muted);
}

/* MODAL / POPUP */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  max-width: 500px;
  width: 100%;
  text-align: center;
  transform: scale(0.85);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
}

.modal-body img {
  width: 30%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.modal-body h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
  color: var(--accent-yellow);
}

.modal-body p {
  font-size: 1.3rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

.control-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
}

.mobile-only {
  display: none;
}

/* RESPONSIVIDADE MOBILE */
@media (max-width: 868px) {
  .nav-desktop {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .sidebar {
    top: 6px;
    left: 6px;
    width: min(380px, calc(100vw - 12px));
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    overflow-y: auto;
    border: 1px solid rgba(56, 189, 248, 0.14);
    border-radius: 16px;
    background: linear-gradient(160deg, #070b15 0%, #03060c 100%);
    transform: translateX(calc(-100% - 12px));
  }

  body.light .sidebar {
    background: var(--sidebar-bg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
  }

  .sidebar-menu-icon {
    color: var(--text);
    font-size: 1.6rem;
  }

  .sidebar-header .control-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--muted);
    font-size: 1.7rem;
  }

  .sidebar-profile {
    padding: 18px 0 16px;
  }

  .sidebar-profile h2 {
    color: #22d3c5;
    font-size: 1.3rem;
    font-weight: 800;
  }

  .sidebar-profile h2 span {
    color: #60a5fa;
  }

  .sidebar-profile p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.84rem;
  }

  section {
    padding: 85px 16px 20px;
  }

  .glass-card {
    max-height: calc(100vh - 100px);
    padding: 30px;
  }

  .nav-mobile {
    gap: 4px;
    margin: 0;
  }

  .nav-mobile a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 0 5px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
  }

  .nav-mobile a i {
    width: 22px;
    color: var(--muted);
    font-size: 1.3rem;
    text-align: center;
  }

  .nav-mobile a.active {
    color: #22d3c5;
    background: linear-gradient(90deg, rgba(34, 211, 197, 0.09), transparent);
  }

  .nav-mobile a.active i {
    color: #22d3c5;
  }

  .sidebar-socials {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border);
  }

  .sidebar-socials a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 50%;
    color: var(--muted);
    font-size: 1.25rem;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }

  .sidebar-socials a:hover {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent);
  }
}
