/* ═══════ HashGate Common Styles ═══════ */
/* Design: "British Racing Terminal" — dark racing green + champagne gold + mint */

:root {
  --bg-deep: #001a12;
  --bg-primary: #00261a;
  --bg-secondary: #003328;
  --bg-card: rgba(0, 51, 40, 0.6);
  --bg-card-hover: rgba(0, 61, 48, 0.8);
  --bg-glass: rgba(0, 42, 32, 0.45);
  --border: rgba(212, 168, 72, 0.12);
  --border-hover: rgba(212, 168, 72, 0.3);
  --gold: #d4a848;
  --gold-light: #e8c96a;
  --gold-dim: rgba(212, 168, 72, 0.15);
  --mint: #7fffd4;
  --mint-dim: rgba(127, 255, 212, 0.12);
  --red: #ff6b6b;
  --red-dim: rgba(255, 107, 107, 0.12);
  --text-primary: #f5f1e8;
  --text-secondary: #a8b5a0;
  --text-muted: #5e7462;
  --green-glow: rgba(127, 255, 212, 0.06);
  --gold-glow: rgba(212, 168, 72, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-display);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* Ambient background */
.ambient {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0, 66, 37, 0.4) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(212, 168, 72, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(0, 42, 32, 0.3) 0%, transparent 70%);
}
.noise {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 256px;
}

/* Top nav */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: rgba(0, 26, 18, 0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.topnav .logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.3rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.topnav .logo span { font-weight: 400; opacity: 0.7; }
.topnav nav { display: flex; gap: 6px; }
.topnav nav a {
  font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
  padding: 8px 14px; border-radius: var(--radius-sm);
  transition: var(--transition);
  text-decoration: none;
}
.topnav nav a:hover { color: var(--text-primary); background: var(--gold-dim); }
.topnav nav a.active { color: var(--gold); background: var(--gold-dim); }

.topnav .right-section { display: flex; align-items: center; gap: 12px; }
.wallet-badge {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  background: var(--gold-dim); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px;
  color: var(--gold-light); display: none;
}
.user-menu {
  display: none; align-items: center; gap: 10px;
  font-size: 0.85rem; color: var(--text-secondary);
}
.user-menu .username { color: var(--text-primary); font-weight: 600; }
.role-badge {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 2px 8px;
  border-radius: 100px; background: var(--gold-dim); color: var(--gold);
}
.role-super-admin { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.role-moderator { background: rgba(107,136,255,0.15); color: #6b88ff; }
.role-super-miner, .role-miner { background: var(--mint-dim); color: var(--mint); }
.role-super-renter, .role-renter { background: var(--gold-dim); color: var(--gold); }

#auth-buttons { display: flex; gap: 8px; }
#auth-buttons a {
  font-size: 0.82rem; font-weight: 500; padding: 7px 16px;
  border-radius: var(--radius-sm); transition: var(--transition);
}
#auth-buttons .btn-login { color: var(--text-secondary); }
#auth-buttons .btn-login:hover { color: var(--text-primary); }
#auth-buttons .btn-register {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-deep); font-weight: 600;
}

.btn-logout {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 5px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.75rem; font-family: var(--font-display);
  transition: var(--transition);
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* Username link to profile */
.user-menu .username {
  cursor: pointer; transition: var(--transition);
}
.user-menu .username:hover { color: var(--gold-light); }

/* Notification bell */
.notif-bell {
  position: relative; display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; cursor: pointer;
  border-radius: var(--radius-sm); transition: var(--transition);
  color: var(--text-secondary); font-size: 1.1rem;
}
.notif-bell:hover { background: var(--gold-dim); color: var(--text-primary); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff;
  font-size: 0.62rem; font-weight: 700; font-family: var(--font-display);
  border-radius: 100px; display: none;
  align-items: center; justify-content: center;
  line-height: 1;
}

/* Notification dropdown */
.notif-dropdown {
  position: absolute; top: 44px; right: 0; width: 360px; max-height: 480px;
  background: rgba(0, 26, 18, 0.97);
  backdrop-filter: blur(20px); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: none; z-index: 200;
  flex-direction: column;
}
.notif-dropdown.open { display: flex; }
.notif-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.notif-dropdown-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
}
.notif-mark-read {
  font-size: 0.72rem; color: var(--gold); cursor: pointer;
  background: none; border: none; font-family: var(--font-display);
  transition: var(--transition);
}
.notif-mark-read:hover { color: var(--gold-light); }
.notif-list {
  overflow-y: auto; max-height: 400px; flex: 1;
}
.notif-item {
  display: flex; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: var(--transition); cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item.unread { background: rgba(212, 168, 72, 0.05); }
.notif-item.unread .notif-title { color: var(--text-primary); }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0; margin-top: 5px;
}
.notif-item:not(.unread) .notif-dot { background: transparent; }
.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-message {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-time {
  font-size: 0.68rem; color: var(--text-muted); margin-top: 3px;
  font-family: var(--font-mono);
}
.notif-empty {
  padding: 32px 16px; text-align: center;
  color: var(--text-muted); font-size: 0.85rem;
}
.notif-see-all {
  display: block; text-align: center; padding: 10px;
  font-size: 0.78rem; color: var(--gold);
  border-top: 1px solid var(--border);
  transition: var(--transition);
}
.notif-see-all:hover { background: var(--gold-dim); }

/* Main content area */
.main-content {
  position: relative; z-index: 2;
  max-width: 1200px; margin: 0 auto;
  padding: 96px 32px 60px;
}

/* Page title */
.page-title {
  font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.page-subtitle {
  color: var(--text-secondary); font-size: 0.95rem;
  margin-bottom: 32px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.card-title {
  font-size: 1.1rem; font-weight: 600;
}

/* Tables */
.data-table {
  width: 100%; border-collapse: collapse;
}
.data-table th {
  text-align: left; padding: 10px 14px;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.88rem;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .mono { font-family: var(--font-mono); font-size: 0.82rem; }

/* Status dots */
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 6px;
}
.status-online { background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.status-offline { background: var(--text-muted); }
.status-idle { background: var(--gold); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 0.88rem; font-weight: 600;
  border: none; cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-deep);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn-danger {
  background: var(--red-dim); border: 1px solid rgba(255,107,107,0.2);
  color: var(--red);
}
.btn-danger:hover { background: rgba(255,107,107,0.2); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.82rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%; padding: 10px 14px;
  background: rgba(0, 20, 14, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-display); font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-primary); color: var(--text-primary); }

.form-error {
  background: var(--red-dim); border: 1px solid rgba(255,107,107,0.2);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--red); font-size: 0.85rem;
  margin-bottom: 16px; display: none;
}
.form-success {
  background: var(--mint-dim); border: 1px solid rgba(127,255,212,0.2);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--mint); font-size: 0.85rem;
  margin-bottom: 16px; display: none;
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Stat cards */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  text-align: center;
}
.stat-card .stat-value {
  font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600;
  color: var(--gold-light); margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 10, 6, 0.8); z-index: 200;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 500px; width: 90%;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title {
  font-size: 1.2rem; font-weight: 600; margin-bottom: 20px;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px;
}

/* Copy button */
.copy-btn {
  background: var(--gold-dim); border: 1px solid var(--border);
  color: var(--gold); padding: 4px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.72rem; font-family: var(--font-mono);
  transition: var(--transition);
}
.copy-btn:hover { background: var(--gold); color: var(--bg-deep); }
.copy-btn.copied { background: var(--mint-dim); border-color: var(--mint); color: var(--mint); }

/* Credential display */
.credential-block {
  background: rgba(0, 20, 14, 0.8); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
}
.credential-label {
  font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 4px;
}
.credential-value {
  font-family: var(--font-mono); font-size: 1rem; color: var(--mint);
  display: flex; justify-content: space-between; align-items: center;
}

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state .message { font-size: 1rem; margin-bottom: 16px; }

/* Loading spinner */
.spinner {
  width: 24px; height: 24px; border: 2px solid var(--border);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
  .topnav { padding: 0 16px; }
  .topnav nav { display: none; }
  .main-content { padding: 80px 16px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-title { font-size: 1.4rem; }
}
