/* ===== DESIGN SYSTEM ADVERSE TOOLS HUB ===== */

:root {
  /* Cores OKLCH */
  --background: oklch(0.05 0.02 264);
  --foreground: oklch(0.98 0.01 264);
  --primary: oklch(0.7 0.2 270);
  --accent: oklch(0.7 0.2 210);
  --card: oklch(0.08 0.02 264);
  --secondary: oklch(0.12 0.02 264);
  --muted: oklch(0.12 0.02 264);
  --muted-foreground: oklch(0.8 0.01 264);
  --border: oklch(0.15 0.02 264);

  /* Estado */
  --success: oklch(0.7 0.2 140);
  --error: oklch(0.7 0.2 20);
  --warning: oklch(0.7 0.2 60);

  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  --gradient-text: linear-gradient(135deg, var(--accent), var(--primary));
  --gradient-success: linear-gradient(135deg, #10b981, #059669);

  /* Raios */
  --radius: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Espacamentos */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 6rem;

  /* Sombras */
  --shadow-sm: 0 1px 2px oklch(0.05 0.02 264 / 0.1);
  --shadow-md: 0 4px 6px oklch(0.05 0.02 264 / 0.1);
  --shadow-lg: 0 10px 15px oklch(0.05 0.02 264 / 0.1);
  --shadow-xl: 0 20px 25px oklch(0.05 0.02 264 / 0.25);
  --shadow-glow: 0 0 20px oklch(0.7 0.2 270 / 0.3);
  --shadow-glow-strong: 0 0 30px oklch(0.7 0.2 270 / 0.6);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: oklch(0.7 0.2 270 / 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: oklch(0.7 0.2 270 / 0.5); }

/* ===== TIPOGRAFIA ===== */
.text-display { font-size: 2.5rem; line-height: 1.15; letter-spacing: -0.025em; font-weight: 200; }
.text-h1 { font-size: 2.5rem; line-height: 1.1; letter-spacing: -0.02em; font-weight: 300; }
.text-h2 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.015em; font-weight: 400; }
.text-h3 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 500; }
.text-body { font-size: 1.125rem; line-height: 1.7; letter-spacing: 0; font-weight: 300; }
.text-caption { font-size: 0.875rem; line-height: 1.5; letter-spacing: 0.025em; font-weight: 500; }

/* ===== EFEITOS VISUAIS ===== */
.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
.glass-effect:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-glow);
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Floating Orbs */
.floating-orbs { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.floating-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; background: var(--gradient-primary); animation: float 6s ease-in-out infinite; }
.orb-1 { width: 30vw; height: 30vw; max-width: 300px; max-height: 300px; top: 10%; left: 5%; animation-delay: 0s; }
.orb-2 { width: 20vw; height: 20vw; max-width: 200px; max-height: 200px; top: 60%; right: 5%; animation-delay: 2s; }
.orb-3 { width: 25vw; height: 25vw; max-width: 250px; max-height: 250px; bottom: 20%; left: 10%; animation-delay: 4s; }

/* Animacoes */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(120deg); }
  66% { transform: translateY(10px) rotate(240deg); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--shadow-glow); }
  50% { box-shadow: var(--shadow-glow-strong); }
}

.fade-in-up { animation: fadeInUp 0.8s ease-out; }
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.hover-lift { transition: all 0.3s ease; }
.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-glow); }

/* ===== COMPONENTES ===== */

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: oklch(0.05 0.02 264 / 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo { height: 32px; opacity: 0.9; }
.navbar-logo:hover { opacity: 1; }

.navbar-links { display: flex; gap: 1.5rem; align-items: center; }
.navbar-links a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.3s;
}
.navbar-links a:hover { color: var(--foreground); }
.navbar-links a.active { color: var(--primary); }

/* Section Badge */
.section-badge {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
}

/* Botoes */
.btn-primary {
  background: var(--gradient-success);
  color: var(--foreground);
  padding: 1rem 2.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 1.125rem;
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--foreground);
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 1rem;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  transition: all 0.3s ease;
}
.card:hover {
  border-color: oklch(0.7 0.2 270 / 0.3);
  box-shadow: var(--shadow-glow);
}

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.page-content { position: relative; z-index: 1; padding-top: 80px; }

/* ===== HUB PAGE ===== */
.hub-hero {
  text-align: center;
  padding: var(--spacing-3xl) 0;
}
.hub-hero h1 { margin-bottom: var(--spacing-md); }
.hub-hero p { color: var(--muted-foreground); max-width: 600px; margin: 0 auto; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--spacing-lg);
  padding-bottom: var(--spacing-3xl);
}

.tool-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
.tool-card .card { height: 100%; }
.tool-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  color: white;
}
.tool-card h3 { margin-bottom: var(--spacing-xs); font-size: 1.25rem; font-weight: 600; }
.tool-card p { color: var(--muted-foreground); font-size: 0.95rem; line-height: 1.6; }
.tool-card-tag {
  display: inline-block;
  margin-top: var(--spacing-sm);
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: oklch(0.7 0.2 140 / 0.15);
  color: var(--success);
}

/* ===== CALCULATOR PAGE ===== */
.calc-page { padding: var(--spacing-xl) 0 var(--spacing-3xl); }
.calc-header { text-align: center; margin-bottom: var(--spacing-2xl); }
.calc-header h1 { margin-bottom: var(--spacing-sm); }
.calc-header p { color: var(--muted-foreground); max-width: 600px; margin: 0 auto; }

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: start;
}

/* Inputs Panel */
.calc-inputs { display: flex; flex-direction: column; gap: var(--spacing-md); }

.input-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.input-section h3 .color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-purple { background: var(--primary); }
.dot-yellow { background: var(--warning); }
.dot-blue { background: var(--accent); }

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted-foreground);
}

.input-label .tooltip-trigger {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted-foreground);
  transition: all 0.2s;
  flex-shrink: 0;
}
.input-label .tooltip-trigger:hover {
  background: oklch(0.7 0.2 270 / 0.2);
  border-color: var(--primary);
  color: var(--foreground);
}

.tooltip-content {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: oklch(0.15 0.02 264);
  border: 1px solid oklch(0.25 0.02 264);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--foreground);
  width: 240px;
  line-height: 1.5;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: oklch(0.25 0.02 264);
}
.tooltip-trigger:hover .tooltip-content { display: block; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix, .input-suffix {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-foreground);
  pointer-events: none;
}
.input-prefix { left: 1rem; }
.input-suffix { right: 1rem; }

.calc-input {
  width: 100%;
  background: oklch(0.1 0.02 264);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--foreground);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
  outline: none;
}
.calc-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.7 0.2 270 / 0.15);
}
.calc-input.has-prefix { padding-left: 2.25rem; }
.calc-input.has-suffix { padding-right: 2.25rem; }

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
}

/* Results Panel */
.calc-results {
  position: sticky;
  top: 100px;
}

.results-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid oklch(0.15 0.02 264 / 0.5);
}
.result-item:last-child { border-bottom: none; }

.result-label {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-value {
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result-highlight {
  background: oklch(0.1 0.03 264);
  border: 1px solid oklch(0.7 0.2 270 / 0.3);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  text-align: center;
}
.result-highlight .result-label {
  justify-content: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.result-highlight .result-value {
  font-size: 2rem;
  font-weight: 700;
}
.result-highlight .result-value.positive { color: var(--success); }
.result-highlight .result-value.negative { color: var(--error); }
.result-highlight .result-value.primary { color: var(--primary); }

.results-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* Target ROAS section */
.target-section {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
}
.target-section .input-group { margin-bottom: var(--spacing-sm); }

/* Export Section */
.export-section {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border);
}

.export-btn {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s;
}
.export-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

/* Email Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0.05 0.02 264 / 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: oklch(0.1 0.02 264);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  max-width: 420px;
  width: 90%;
  position: relative;
  animation: fadeInUp 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--foreground); }

.modal h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.modal p { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: var(--spacing-md); }

.modal .input-group { margin-bottom: var(--spacing-sm); }
.modal .calc-input { background: oklch(0.08 0.02 264); }

/* Footer */
.footer {
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}
.footer a { color: var(--primary); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
  .calc-results { position: static; }
  .input-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .text-display, .text-h1 { font-size: 1.75rem; }
  .text-h2 { font-size: 1.5rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .navbar { padding: 0.75rem 1rem; }
  .navbar-links { gap: 0.75rem; }
  .hub-hero { padding: var(--spacing-2xl) 0; }
  .result-highlight .result-value { font-size: 1.5rem; }
}
