/* ══════════════════════════════════════════════
   VOLTÁRIA — CSS Global
   Industrial Arcano Theme
══════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── CSS Variables ── */
:root {
  /* Fundo */
  --bg-primary: #0a0a0f;
  --bg-secondary: #101018;
  --bg-card: #141420;
  --bg-card-hover: #1a1a2a;
  --bg-overlay: rgba(10, 10, 15, 0.92);

  /* Bordas */
  --border-primary: #8b6b4a;
  --border-subtle: #2a2a3a;
  --border-glow: #f0d080;

  /* Texto */
  --text-gold: #f0d080;
  --text-body: #b8b0a0;
  --text-secondary: #78706a;
  --text-muted: #4a4a5a;
  --text-white: #f0ece4;

  /* Status */
  --color-success: #7be082;
  --color-error: #e07b7b;
  --color-warning: #f0a030;
  --color-energy: #f0a030;
  --color-arcane: #60a0f0;
  --color-info: #60a0f0;

  /* Barras */
  --bar-hp: linear-gradient(90deg, #8b0000, #c0392b);
  --bar-energy: linear-gradient(90deg, #005a20, #00a040);
  --bar-mana: linear-gradient(90deg, #2a0080, #7b2fbe);
  --bar-xp: linear-gradient(90deg, #0a4a9a, #1a90e0, #40b8ff);

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 20px rgba(240, 208, 128, 0.15);

  /* Espaçamento */
  --topbar-height: 68px;
  --dock-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Transições */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ── Tipografia ── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
  padding-top: var(--topbar-height);
  padding-bottom: calc(var(--dock-height) + var(--safe-bottom) + 16px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.auth-layout {
  padding-top: 0;
  padding-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  color: var(--text-gold);
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: var(--text-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #fff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-gold);
}

/* ── Utilitários ── */
/* Layout/spacing utilities now via Tailwind. Keep only project-specific ones. */

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(180deg, #8b6b4a, #6a4a2a);
  color: var(--text-gold);
  border: 1px solid var(--border-primary);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #a07850, #7a5a3a);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-primary);
}

.btn-success {
  background: linear-gradient(180deg, #2a7a3a, #1a5a2a);
  color: var(--color-success);
  border: 1px solid #2a7a3a;
}

.btn-success:hover {
  background: linear-gradient(180deg, #3a8a4a, #2a6a3a);
}

.btn-gold {
  background: linear-gradient(180deg, #c9a84c, #a08030);
  color: #1a1208;
  border: 1px solid #c9a84c;
  font-weight: 700;
}

.btn-gold:hover {
  background: linear-gradient(180deg, #d9b85c, #b09040);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-primary);
  background: var(--bg-card-hover);
}

.card-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-gold {
  background: rgba(240, 208, 128, 0.15);
  color: var(--text-gold);
  border: 1px solid rgba(240, 208, 128, 0.3);
}

.badge-success {
  background: rgba(123, 224, 130, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(123, 224, 130, 0.3);
}

.badge-error {
  background: rgba(224, 123, 123, 0.15);
  color: var(--color-error);
  border: 1px solid rgba(224, 123, 123, 0.3);
}

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(240, 208, 128, 0.3); }
  50% { box-shadow: 0 0 20px rgba(240, 208, 128, 0.6); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }
.animate-slideUp { animation: slideUp 0.3s ease-out; }
.animate-fadeIn { animation: fadeIn 0.3s ease-out; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  background: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-gold);
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Toast/Notificação ── */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 16px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-body);
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease-out;
  max-width: 320px;
}

.toast-success { border-color: var(--color-success); }
.toast-error { border-color: var(--color-error); }
.toast-info { border-color: var(--color-info); }

/* ── Responsive ── */
@media (max-width: 768px) {
  :root {
    --topbar-height: 60px;
    --dock-height: 64px;
  }

  body {
    font-size: 14px;
  }

  .container {
    padding: 0 12px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  :root {
    --topbar-height: 56px;
    --dock-height: 60px;
  }
}

/* ── City Event Banner ── */
.city-event-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(139, 107, 74, 0.15) 0%, rgba(20, 20, 32, 0.8) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  animation: slideDown 0.4s ease-out;
}

.city-event-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.city-event-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.city-event-title {
  font-weight: 700;
  color: var(--text-gold);
  font-size: 14px;
}

.city-event-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
