/* ========================================
   GlowLocal Tools — Design System
   Black Minimal Theme
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #000000;
  --bg-secondary: #161617;
  --bg-card: #1d1d1f;
  --bg-elevated: #2c2c2e;
  --gold: #0071e3;
  --gold-light: #2997ff;
  --gold-dark: #005bb5;
  --ivory: #f5f5f7;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --success: #1f9d70;
  --error: #d94b4b;
  --warning: #d28b18;
  --info: #2878d4;
  --border: rgba(255,255,255,0.12);
  --border-active: rgba(255,255,255,0.28);
  --overlay: rgba(0,0,0,0.72);
  --glass: rgba(29,29,31,0.78);
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.38);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 4px 20px rgba(0,113,227,0.2);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; }

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border: none; border-radius: var(--radius-md); cursor: pointer;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  transition: all var(--transition-base); position: relative; overflow: hidden;
  min-height: 48px;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0; transition: opacity var(--transition-fast);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #ffffff; box-shadow: var(--shadow-gold);
}
.btn-gold:hover { box-shadow: 0 6px 28px rgba(0,113,227,0.32); transform: translateY(-1px); }

.btn-outline {
  background: transparent; border: 1.5px solid var(--border-active);
  color: var(--gold);
}
.btn-outline:hover { background: rgba(255,255,255,0.06); }

.btn-danger {
  background: linear-gradient(135deg, var(--error), #c62828);
  color: #fff;
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; min-height: 38px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}
.card:hover { border-color: var(--border-active); box-shadow: var(--shadow-gold); }

.card-glass {
  background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ---- Inputs ---- */
.input-group { margin-bottom: 16px; }
.input-group label {
  display: block; font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.3px;
}
.input-field {
  width: 100%; padding: 12px 16px;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.95rem;
  transition: all var(--transition-fast); outline: none;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(0,113,227,0.18); }
.input-field.error { border-color: var(--error); }

select.input-field { cursor: pointer; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; background: var(--bg-secondary); border-radius: var(--radius-md); padding: 4px; }
.tab-btn {
  flex: 1; padding: 10px 16px; border: none; background: transparent;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast); white-space: nowrap;
}
.tab-btn.active { background: var(--gold); color: #ffffff; font-weight: 600; }
.tab-btn:not(.active):hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* ---- PIN Input ---- */
.pin-container { display: flex; gap: 12px; justify-content: center; }
.pin-digit {
  width: 56px; height: 64px; text-align: center; font-size: 1.5rem; font-weight: 700;
  background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: var(--radius-md); color: var(--gold);
  font-family: var(--font-body); outline: none; transition: all var(--transition-fast);
  -webkit-text-security: disc;
}
.pin-digit:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(0,113,227,0.18); }
.pin-digit.filled { border-color: var(--gold-dark); background: rgba(0,113,227,0.08); }

/* ---- Toast ---- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 500; color: #fff;
  box-shadow: var(--shadow-lg); animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}
.toast-success { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.toast-error { background: linear-gradient(135deg, #c62828, #b71c1c); }
.toast-warning { background: linear-gradient(135deg, #e65100, #bf360c); }
.toast-info { background: linear-gradient(135deg, #1565c0, #0d47a1); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; opacity: 0; pointer-events: none;
  transition: opacity var(--transition-base);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; max-width: 480px;
  width: 90%; max-height: 80vh; overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-base);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal h3 { color: var(--gold); margin-bottom: 16px; }

/* ---- Badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--radius-xl);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success { background: rgba(76,175,80,0.15); color: var(--success); }
.badge-error { background: rgba(239,83,80,0.15); color: var(--error); }
.badge-warning { background: rgba(255,152,0,0.15); color: var(--warning); }
.badge-gold { background: rgba(0,113,227,0.12); color: var(--gold-light); }

/* ---- Language Pills ---- */
.lang-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-pill {
  padding: 8px 20px; border: 1.5px solid var(--border);
  border-radius: var(--radius-xl); background: transparent;
  color: var(--text-secondary); font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast);
}
.lang-pill.active { border-color: var(--gold); color: var(--gold-light); background: rgba(0,113,227,0.1); }
.lang-pill:hover:not(.active) { border-color: var(--text-muted); color: var(--text-primary); }

/* ---- Table ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 0.8rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.9rem;
}
.data-table tr:hover td { background: rgba(255,255,255,0.04); }

/* ---- Progress Bar ---- */
.progress-bar {
  height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  transition: width 0.6s ease;
}

/* ---- PWA Install Button ---- */
.pwa-install-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 8000;
  padding: 12px 24px; border-radius: 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none; color: #ffffff; font-size: 0.9rem; font-weight: 600;
  font-family: var(--font-body); cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,113,227,0.26);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  animation: pulse 2s infinite;
  transition: transform var(--transition-fast);
  white-space: nowrap; letter-spacing: 0.3px;
}
.pwa-install-btn:hover { transform: scale(1.05); }
.pwa-install-btn.hidden { display: none; }

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 4px 20px rgba(0,113,227,0.26); } 50% { box-shadow: 0 4px 30px rgba(0,113,227,0.42); } }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fade-in { animation: fadeIn 0.5s ease forwards; }
.fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.shake { animation: shake 0.4s ease; }

/* ---- Utilities ---- */
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .card { padding: 18px; }
  .tabs { overflow-x: auto; }
  .tab-btn { font-size: 0.78rem; padding: 8px 12px; }
  .pin-digit { width: 48px; height: 56px; font-size: 1.3rem; }
  .toast-container { right: 12px; left: 12px; }
  .toast { max-width: 100%; }
}
