/**
 * DHANNYLLO+ Plataforma - Estilos Modernos
 * Versão: 1.0.0
 * Data: 25 de maio de 2026
 * 
 * Paleta de cores:
 * - Primária: #2949C7 (Azul inspirado no logo)
 * - Secundária: #6F8CF2 (Azul claro)
 * - Accent: #F0B75E (Dourado)
 * - Dark: #17264D
 * - Light: #ECF0F1
 */

:root {
  --primary: #2949C7;
  --secondary: #6F8CF2;
  --accent: #F0B75E;
  --dark: #17264D;
  --light: #ECF0F1;
  --text-primary: #182442;
  --text-secondary: #53617E;
  --bg-primary: #F3F6FC;
  --bg-secondary: #FFFFFF;
  --border-color: rgba(41, 73, 199, 0.12);
  --shadow: 0 2px 10px rgba(30, 55, 130, 0.12);
  --transition: all 0.3s ease;
}

/* ================================
   RESET E BASE
   ================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
  touch-action: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

/* Durante roteamento, minimizar transições/animações para evitar flicker */
body.routing *,
body.routing::before,
body.routing::after {
  transition: none !important;
  animation: none !important;
}

body.routing .modal-backdrop {
  backdrop-filter: none !important;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: auto;
  overscroll-behavior: auto;
  transition: var(--transition);
}

#app {
  min-height: 100%;
}

/* ================================
   TIPOGRAFIA
   ================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* ================================
   LAYOUT PRINCIPAL
   ================================ */

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.app-container {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 250px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  touch-action: auto;
  transition: var(--transition);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.nav-item {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: var(--transition);
  color: var(--text-secondary);
}

.nav-item:hover {
  background-color: var(--bg-primary);
  color: var(--primary);
  border-left-color: var(--primary);
}

.app-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  touch-action: auto;
  padding: 2rem;
}

img,
picture,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================================
   SEÇÕES
   ================================ */

.section-page {
  animation: fadeIn 0.3s ease;
}

.section-page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   HERO SECTION
   ================================ */

.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--primary)20% 0%, var(--secondary)20% 100%);
  border-radius: 20px;
  margin-bottom: 2rem;
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* ================================
   BOTÕES
   ================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: #0D5FFF;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(11, 75, 255, 0.24);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: #45B8AA;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 0.5rem;
}

.icon-btn:hover {
  transform: scale(1.1);
}

/* ================================
   INPUTS
   ================================ */

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 75, 255, 0.12);
}

/* ================================
   CARDS E CONTAINERS
   ================================ */

.plan-card {
  background-color: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.plan-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.plan-card.featured {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(11, 75, 255, 0.18);
  transform: scale(1.05);
}

.price {
  font-size: 2rem;
  color: var(--primary);
  font-weight: 700;
  margin: 1rem 0;
}

.price span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.features {
  list-style: none;
  margin: 1.5rem 0;
  text-align: left;
}

.features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
}

/* ================================
   GRID LAYOUTS
   ================================ */

.plans-grid,
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

/* ================================
   MODAIS
   ================================ */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  pointer-events: none;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background-color: var(--bg-primary);
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition);
  z-index: 1001;
  pointer-events: none;
}

.modal.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.modal-content {
  padding: 2rem;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--primary);
}

/* ================================
   CHAT
   ================================ */

.ia-chat {
  display: flex;
  flex-direction: column;
  height: 500px;
  background-color: var(--bg-secondary);
  border-radius: 15px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-input-area {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

#chat-input {
  flex: 1;
  margin-bottom: 0;
}

#send-btn {
  min-width: 100px;
}

/* ================================
   TOASTS
   ================================ */

#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast {
  background-color: var(--dark);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 250px;
  opacity: 0;
  transform: translateX(500px);
  transition: var(--transition);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  background-color: #27AE60;
}

.toast-error {
  background-color: #E74C3C;
}

.toast-info {
  background-color: #3498DB;
}

.toast-warning {
  background-color: #F39C12;
}

/* ================================
   LOADING
   ================================ */

#global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top: 5px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================
   HAMBURGER MENU
   ================================ */

.hamburger-menu {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  flex-direction: column;
  gap: 0.4rem;
}

.hamburger-menu span {
  width: 25px;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger-menu:hover span {
  background-color: var(--accent);
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 768px) {
  .app-header {
    padding: 1rem;
  }

  .app-title {
    font-size: 1.3rem;
  }

  .hamburger-menu {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -250px;
    top: 60px;
    height: calc(100vh - 60px);
    z-index: 99;
    transition: left 0.3s ease;
  }

  .sidebar.open,
  .sidebar.active {
    left: 0;
  }

  body.sidebar-open {
    overflow-x: hidden;
  }

  .app-content {
    padding: 1rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h2 {
    font-size: 1.75rem;
  }

  .plans-grid,
  .games-grid {
    grid-template-columns: 1fr;
  }

  .plan-card.featured {
    transform: scale(1);
  }

  #toast-container {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  .modal {
    width: 95%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .hero h2 {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
  }

  .header-right {
    gap: 0.5rem;
  }

  .icon-btn {
    font-size: 1.2rem;
  }
}

/* ================================
   ANIMAÇÕES
   ================================ */

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ================================
   UTILIDADES
   ================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}
