/* style.css — Tema Obsidian & Imperial Gold de Napoleon Hill */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(22, 22, 32, 0.75);
  --bg-card-hover: rgba(28, 28, 42, 0.85);
  
  --gold-primary: #d4af37;
  --gold-light: #fbeea4;
  --gold-dark: #9e791e;
  --gold-glow: rgba(212, 175, 55, 0.25);
  
  --text-main: #f0f0f5;
  --text-muted: #9ba1b0;
  --text-gold: #e5c158;
  
  --border-color: rgba(212, 175, 55, 0.22);
  --border-active: rgba(212, 175, 55, 0.65);
  
  --color-success: #2ecc71;
  --color-warning: #f39c12;
  --color-danger: #e74c3c;
  --color-info: #3498db;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-gold: 0 8px 32px -4px rgba(212, 175, 55, 0.15);
  --shadow-elevation: 0 12px 40px rgba(0, 0, 0, 0.6);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 65%),
    radial-gradient(circle at 10% 80%, rgba(158, 121, 30, 0.04) 0%, transparent 40%);
}

/* Tipografia */
h1, h2, h3, .serif-font {
  font-family: "Cinzel", "Times New Roman", Times, Georgia, serif;
  letter-spacing: 0.5px;
}

h1 {
  font-size: 1.45rem;
  color: var(--gold-light);
  text-shadow: 0 0 15px var(--gold-glow);
}

h2 {
  font-size: 1.25rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* App Container */
.app-container {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 6.5rem 1rem;
  flex: 1;
}

/* Header Superior */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-light);
}

/* Hero / Card Principal de Autosugestão */
.hero-card {
  background: linear-gradient(145deg, rgba(30, 28, 40, 0.9) 0%, rgba(18, 18, 25, 0.85) 100%);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-elevation), var(--shadow-gold);
}

.hero-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.chief-aim-preview {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #fff;
  border-left: 3px solid var(--gold-primary);
  padding-left: 1rem;
  margin: 1rem 0;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1rem;
}

.hero-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
  color: #0b0b0e;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
  font-weight: 700;
}

.btn-gold:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-color);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
}

.btn-outline-gold:hover {
  background: rgba(212, 175, 55, 0.15);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

/* Painel de Janelas Douradas (Manhã, Anti-Alienação, Noite) */
.windows-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.window-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.85rem;
  text-align: center;
  transition: var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.window-card.active {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.window-card.completed::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.window-icon {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  display: block;
}

.window-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.window-time {
  font-size: 0.72rem;
  color: var(--gold-primary);
}

/* Áudio & Frequências Fita Flutuante */
.audio-station {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.5rem;
}

.tone-selector {
  display: flex;
  gap: 0.5rem;
  margin: 0.85rem 0;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.tone-selector::-webkit-scrollbar {
  display: none;
}

.tone-chip {
  flex: 0 0 auto;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tone-chip.active {
  background: var(--gold-primary);
  color: #0b0b0e;
  border-color: var(--gold-light);
  font-weight: 700;
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Seções e Tabs */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards Genéricos */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(10px);
}

/* Formulario do Objetivo Principal Definido */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
}

.form-helper {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-input, .form-textarea {
  width: 100%;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

/* Trilha dos 30 Dias de Ritmo Hipnótico */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.streak-day {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition-fast);
}

.streak-day.completed {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  box-shadow: 0 0 8px var(--gold-glow);
}

.streak-day.today {
  border: 2px dashed var(--gold-light);
}

/* Transmutador Emocional */
.emotion-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.emotion-card {
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.emotion-card:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--gold-primary);
}

/* Barra de Navegação Inferior Fixa para Mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(12, 12, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 0.5rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 0.2rem;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  transition: var(--transition-fast);
}

.nav-item.active {
  color: var(--gold-light);
}

.nav-item.active svg {
  stroke: var(--gold-light);
  filter: drop-shadow(0 0 5px var(--gold-glow));
}

/* Modal e Popups */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), var(--shadow-gold);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Pulsação do Subconsciente durante a Leitura */
@keyframes subconsciousPulse {
  0% { box-shadow: 0 0 10px var(--gold-glow); }
  50% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.45); }
  100% { box-shadow: 0 0 10px var(--gold-glow); }
}

.reciting-active {
  animation: subconsciousPulse 2.5s infinite ease-in-out;
  border-color: var(--gold-light) !important;
}

/* Responsividade */
@media (max-width: 480px) {
  .windows-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .window-card {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 0.85rem 1rem;
    gap: 1rem;
  }
  .window-icon {
    font-size: 1.8rem;
    margin-bottom: 0;
  }
  .streak-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .emotion-picker {
    grid-template-columns: 1fr;
  }
}
