/* Pirata — Global CSS (same design tokens as pirata-app) */
:root {
  --bg-dark:      #070707;
  --bg-darker:    #030303;
  --bg-card:      rgba(255,255,255,0.03);
  --red-primary:  #B22222;
  --red-bright:   #dc143c;
  --gold-primary: #D4AF37;
  --gold-light:   #f0d060;
  --text-light:   #E0E0E0;
  --text-muted:   rgba(224,224,224,0.5);
  --hud-bg:       rgba(10,10,20,0.97);
  --hud-border:   rgba(212,175,55,0.25);
  --glass-border: rgba(212,175,55,0.15);
  --rank-novato:    #6c757d;
  --rank-corsario:  #007bff;
  --rank-oficial:   #20c997;
  --rank-capitao:   #fd7e14;
  --rank-cacador:   #e83e8c;
  --rank-lenda:     #D4AF37;
  --transition: 0.2s ease;
}

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

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

body {
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--gold-primary); text-decoration: none; }
a:hover { color: var(--gold-light); }

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

/* ─── Typography ──────────────────────────────────────────────────────────── */
.title-cinzel {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  color: var(--gold-primary);
}

h1, h2, h3 { font-family: 'Cinzel', serif; font-weight: 700; color: var(--gold-primary); }

/* ─── Utility ─────────────────────────────────────────────────────────────── */
.text-gold    { color: var(--gold-primary); }
.text-red     { color: var(--red-bright); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-16       { gap: 16px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mb-16        { margin-bottom: 16px; }
.w-full       { width: 100%; }
.hidden       { display: none !important; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), #b8960c);
  color: #000;
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.1); }

.btn-red {
  background: var(--red-primary);
  color: #fff;
}
.btn-red:hover:not(:disabled) { background: var(--red-bright); }

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

.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-full { width: 100%; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.form-input, .form-select, .form-textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  padding: 10px 12px;
  transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
}
.form-select option { background: #1a1a2e; color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 80px; }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-gold   { background: rgba(212,175,55,0.2);  color: var(--gold-primary); }
.badge-red    { background: rgba(220,20,60,0.2);   color: #ff6b6b; }
.badge-blue   { background: rgba(0,136,255,0.2);   color: #66b3ff; }
.badge-green  { background: rgba(76,175,80,0.2);   color: #81c784; }
.badge-gray   { background: rgba(136,136,136,0.2); color: #aaa; }
.badge-purple { background: rgba(156,39,176,0.2);  color: #ce93d8; }

.rank-badge {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.rank-novato   { background: rgba(108,117,125,0.2); color: #6c757d; }
.rank-corsario { background: rgba(0,123,255,0.2);   color: #007bff; }
.rank-oficial  { background: rgba(32,201,151,0.2);  color: #20c997; }
.rank-capitao  { background: rgba(253,126,20,0.2);  color: #fd7e14; }
.rank-cacador  { background: rgba(232,62,140,0.2);  color: #e83e8c; }
.rank-lenda    { background: rgba(212,175,55,0.2);  color: var(--gold-primary); }

/* ─── Table ───────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--hud-border);
  color: var(--gold-primary);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(224,224,224,0.8);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: #0d0d1a;
  border: 1px solid var(--hud-border);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  min-width: 240px;
  animation: toast-in 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast-success { background: #1b4332; border: 1px solid #2d6a4f; color: #95d5b2; }
.toast-error   { background: #4a0404; border: 1px solid #7d0000; color: #ff8fa3; }
.toast-info    { background: #0a1929; border: 1px solid #1565c0; color: #90caf9; }

@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ─── Loading spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state { text-align: center; padding: 40px; color: var(--text-muted); }

/* ─── Shimmer animation for gold text ────────────────────────────────────── */
.anim-shimmer-text {
  background: linear-gradient(90deg, #b8960c 0%, #f0d060 50%, #b8960c 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

/* ─── Progress bar ────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
  transition: width 0.5s ease;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }

/* ─── Responsive base ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .card { padding: 12px; }
  .btn  { padding: 9px 16px; font-size: 12px; }
  .modal { padding: 18px; }
}
