/* =========================================================
   IA Médica Aberta - styles.css
   Theme: Luxury Black & Gold
   ========================================================= */

:root {
  /* Palette Black & Gold */
  --bg-body: #050505;
  --bg-card: #0f0f0f;
  --bg-sidebar: #0a0a0a;
  
  --gold-primary: #d4af37;
  --gold-light: #f1c40f;
  --gold-dark: #aa8c2c;
  --gold-gradient: linear-gradient(135deg, #bf953f 0%, #fcf6ba 40%, #b38728 100%);
  --gold-gradient-hover: linear-gradient(135deg, #fcf6ba 0%, #bf953f 100%);
  
  --text-main: #e2e2e2;
  --text-muted: #a1a1a1;
  
  --border-subtle: #333333;
  --border-gold: rgba(212, 175, 55, 0.3);
  
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.15);
  
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
}

/* ===== RESET / BASE ===== */
* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
body { 
  margin: 0; 
  font-family: var(--font-sans);
  color: var(--text-main); 
  background-color: var(--bg-body);
  /* Fundo sutil com ruído ou gradiente muito suave para não ser chapado */
  background-image: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #050505 60%);
  line-height: 1.6; 
}
a { color: var(--gold-primary); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--gold-light); text-shadow: 0 0 5px rgba(241, 196, 15, 0.5); }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ===== TYPOGRAPHY LUXURY ===== */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; color: var(--gold-primary); margin-top: 0; }
.text-gold { 
  background: var(--gold-gradient); 
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  font-weight: 700;
}

/* ===== HEADER (Glassmorphism Dark) ===== */
.header { 
  position: fixed; top: 0; left: 0; width: 100%; z-index: 4000;
  background: rgba(10, 10, 10, 0.85); 
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  height: 80px;
}
.header-inner { 
  display: flex; align-items: center; justify-content: space-between; 
  height: 100%; width: 92%; margin: 0 auto; max-width: 1200px; 
}
.header-left-group { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle { background: none; border: none; cursor: pointer; padding: 4px; display: none; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-title { 
  font-family: var(--font-serif); 
  font-size: 24px; 
  letter-spacing: 0.05em; 
  color: #fff;
  text-transform: uppercase;
}

.header-right { display: flex; align-items: center; gap: 32px; }
.nav { display: flex; gap: 24px; }
.nav a { color: var(--text-muted); font-size: 14px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.nav a:hover { color: var(--gold-primary); }

.lang-switch-header { display: flex; gap: 8px; }
.lang-btn { 
  background: transparent; border: 1px solid var(--border-subtle); color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; font-size: 12px; border-radius: 4px; transition: 0.3s;
}
.lang-btn:hover, .lang-btn.active { 
  border-color: var(--gold-primary); color: var(--gold-primary); 
}

/* ===== SIDEBAR (Dark Luxury) ===== */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100%; width: 280px;
  background: var(--bg-sidebar); border-right: 1px solid var(--border-gold);
  z-index: 5000; transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
}
@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); padding-top: 80px; z-index: 100; }
  .header-inner { padding-left: 280px; max-width: 100%; padding-right: 40px; }
  .main-content, .footer { padding-left: 280px; }
  .sidebar-toggle { display: none; }
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(0,0,0,0.7); z-index: 4500; 
  display: none; opacity: 0; transition: opacity 0.3s; 
}
.sidebar-overlay.visible { display: block; opacity: 1; }

.sidebar-header { padding: 24px; }
.btn-new-chat { 
  width: 100%; padding: 12px; background: transparent; 
  border: 1px solid var(--gold-primary); color: var(--gold-primary); 
  border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 8px; 
  cursor: pointer; transition: all 0.3s;
}
.btn-new-chat:hover { 
  background: var(--gold-primary); color: #000; box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); 
}
.sidebar-content { flex: 1; overflow-y: auto; padding: 0 24px; }
.history-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 16px; letter-spacing: 2px; }
.history-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.history-item { 
  padding: 12px; border-radius: 4px; cursor: pointer; font-size: 14px; 
  color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
  border: 1px solid transparent; transition: 0.3s;
}
.history-item:hover { background: #1a1a1a; color: #fff; border-color: #333; }
.history-item.active { background: #1a1a1a; color: var(--gold-primary); border-color: var(--border-gold); }

/* Sidebar Footer Links */
.sidebar-footer-nav { padding: 24px; border-top: 1px solid var(--border-subtle); }
.sidebar-links { display: flex; flex-direction: column; gap: 12px; }
.sidebar-links a { font-size: 13px; color: var(--text-muted); }

/* ===== HERO SECTION ===== */
.main-content { padding-top: 80px; min-height: 100vh; display: flex; flex-direction: column; }
.hero { padding: 80px 0 40px 0; position: relative; }
/* Efeito de brilho dourado no fundo da hero */
.hero::before {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 60vw; height: 400px; background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.08), transparent 70%);
  z-index: -1; pointer-events: none;
}
.hero-inner { width: min(1000px, 92vw); margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }

.hero-kicker { 
  color: var(--gold-primary); font-size: 12px; letter-spacing: 3px; font-weight: 700; 
  margin-bottom: 16px; text-transform: uppercase; 
}
.hero-title { 
  font-size: clamp(32px, 5vw, 56px); line-height: 1.1; margin-bottom: 24px; 
  background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle { 
  font-size: 18px; color: var(--text-muted); max-width: 600px; margin-bottom: 48px; font-weight: 300; 
}

/* ===== SEARCH BOX LUXURY ===== */
.search-form { width: min(700px, 90vw); margin: 0 auto 32px auto; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.search-box { width: 100%; position: relative; }
.search-box textarea { 
  width: 100%; padding: 20px 50px 20px 24px; font-size: 16px; font-family: var(--font-sans);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-subtle);
  color: #fff; border-radius: 8px; outline: none; transition: 0.3s; resize: none; overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.search-box textarea:focus { 
  border-color: var(--gold-primary); background: rgba(0,0,0,0.2); 
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.1); 
}
.search-box textarea::placeholder { color: #555; }
.clear-btn { color: #555; position: absolute; right: 16px; top: 16px; background: none; border: none; font-size: 24px; cursor: pointer; }
.clear-btn:hover { color: var(--gold-primary); }

.search-button { 
  background: var(--gold-gradient); border: 0; color: #000; 
  border-radius: 4px; padding: 16px 48px; font-size: 14px; font-weight: 700; 
  text-transform: uppercase; letter-spacing: 1.5px; cursor: pointer; 
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}
.search-button:hover { 
  background: var(--gold-gradient-hover); transform: translateY(-2px); 
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.4); 
}
.search-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Chips */
.chips-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.chip { 
  background: transparent; border: 1px solid var(--border-subtle); 
  color: var(--text-muted); border-radius: 50px; padding: 8px 16px; 
  font-size: 12px; cursor: pointer; transition: 0.3s; 
}
.chip:hover { border-color: var(--gold-primary); color: var(--gold-primary); background: rgba(212, 175, 55, 0.05); }

/* ===== RESULTS / CARDS ===== */
.results-container { width: min(800px, 90vw); margin: 0 auto; padding: 40px 0; }
.hidden { display: none !important; }
.thread { display: flex; flex-direction: column; gap: 32px; }

.turn { 
  background: var(--bg-card); border: 1px solid var(--border-subtle); 
  border-radius: 8px; padding: 32px; position: relative;
}
/* Borda dourada sutil no topo do card de resposta */
.turn::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0.5;
}

.turn-label { 
  font-size: 10px; color: var(--gold-primary); text-transform: uppercase; 
  letter-spacing: 1.5px; margin-bottom: 12px; font-weight: 700;
}
.turn-question { font-family: var(--font-serif); font-size: 20px; color: #fff; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
.turn-answer { font-size: 16px; color: var(--text-main); font-weight: 300; }
.turn-answer strong { color: #fff; font-weight: 600; }
.turn-answer h3 { color: var(--gold-primary); font-size: 18px; margin-top: 24px; border-left: 2px solid var(--gold-primary); padding-left: 12px; }

/* Actions */
.turn-actions { display: flex; gap: 12px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.action-btn { 
  background: transparent; border: 1px solid transparent; color: var(--text-muted); 
  padding: 8px; border-radius: 4px; cursor: pointer; transition: 0.3s; 
}
.action-btn:hover { color: var(--gold-primary); background: rgba(255,255,255,0.05); }
.action-btn.liked { color: var(--gold-primary); }

/* ===== SECTIONS & CARDS ===== */
.section { padding: 80px 0; border-top: 1px solid var(--border-subtle); }
.section-inner { width: min(1000px, 90vw); margin: 0 auto; }
.section h2 { font-size: 32px; margin-bottom: 16px; text-align: center; }
.section-subtitle { text-align: center; font-family: var(--font-sans); color: var(--text-muted); font-weight: 300; margin-bottom: 48px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.card { 
  background: var(--bg-card); border: 1px solid var(--border-subtle); 
  padding: 32px; border-radius: 8px; transition: 0.3s; 
}
.card:hover { transform: translateY(-5px); border-color: var(--gold-dark); box-shadow: var(--shadow-gold); }
.card.gold-border { border: 1px solid var(--gold-dark); }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.card-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; font-style: italic; }

.feature-list { list-style: none; padding: 0; }
.feature-list li { margin-bottom: 12px; color: #ccc; font-size: 14px; position: relative; padding-left: 20px; }
.feature-list li::before { content: "✦"; color: var(--gold-primary); position: absolute; left: 0; top: 2px; font-size: 10px; }

/* ===== FOOTER ===== */
.footer { padding: 60px 0; background: #000; border-top: 1px solid var(--border-subtle); text-align: center; margin-top: auto; }
.footer-inner { width: min(1000px, 90vw); margin: 0 auto; }
.legal-warning { font-size: 12px; color: #555; margin-bottom: 20px; max-width: 700px; margin: 0 auto 20px auto; }
.copyright { font-size: 12px; color: var(--gold-dark); letter-spacing: 1px; text-transform: uppercase; }

/* Mobile Sidebar Toggle visibility logic overrides */
@media (max-width: 1023px) {
  .sidebar-toggle { display: block; }
  .nav { display: none; }
  .header-inner { justify-content: space-between; }
  .brand-title { font-size: 16px; }
}