/* The HoodzHUB - UK street / cars / gangs theme */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #0d0d0f;
  --bg-card: #151518;
  --bg-elevated: #1c1c21;
  --accent: #c41e3a;
  --accent-hover: #a01830;
  --accent-glow: rgba(196, 30, 58, 0.35);
  --text: #e8e6e3;
  --text-muted: #9a9690;
  --border: #2a2826;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #dc2626;
  --font-heading: 'Oswald', sans-serif;
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  /* Custom cursor: arrow with accent tip (SVG data URI). Hotspot 2 2 = tip of arrow. */
  --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23e8e6e3' stroke='%23c41e3a' stroke-width='1.5' d='M2 2 L2 24 L11 17 L15 28 L18 26 L14 14 L26 10 Z'/%3E%3C/svg%3E") 2 2, auto;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23e8e6e3' stroke='%23c41e3a' stroke-width='1.5' d='M2 2 L2 24 L11 17 L15 28 L18 26 L14 14 L26 10 Z'/%3E%3C/svg%3E") 2 2, pointer;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, .nav-logo, .section-title, .hero h1 {
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

a {
  color: var(--accent);
  text-decoration: none;
  cursor: var(--cursor-pointer);
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Avatars: prevent full-size display if avatar image appears outside nav/profile */
img[src*="uploads/avatars"]:not(.nav-avatar):not(.profile-avatar-preview img) {
  max-width: 96px;
  max-height: 96px;
  object-fit: cover;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--accent);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-left-sep {
  display: inline-block;
  width: 1px;
  height: 28px;
  background: var(--border);
  margin-right: 1.5rem;
  flex-shrink: 0;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  text-transform: uppercase;
}
.nav-logo span { color: var(--accent); }
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.nav-user:hover { color: var(--accent); text-decoration: none; }
.nav-username { font-size: 0.95rem; }
.nav-avatar {
  width: 36px !important;
  min-width: 36px;
  max-width: 36px;
  height: 36px !important;
  min-height: 36px;
  max-height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
  flex-shrink: 0;
}
.nav .nav-user img.nav-avatar {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
}
.nav-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  min-width: 36px;
  max-width: 36px;
  height: 36px !important;
  min-height: 36px;
  max-height: 36px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}
.nav-links .btn { text-decoration: none; }
.nav-role {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent);
}

/* Buttons */
.btn,
button,
input[type="submit"],
input[type="button"],
[role="button"] {
  cursor: var(--cursor-pointer);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  text-decoration: none;
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); text-decoration: none; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.status-open { color: var(--success); }
.status-closed { color: var(--text-muted); }

/* Hero */
.hero {
  padding: 8rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 400px;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  text-transform: uppercase;
}
.hero h1 span { color: var(--accent); }
.hero .server-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
}
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  position: relative;
}
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* Sections */
.section {
  padding: 4rem 0;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}
.section-title span { color: var(--accent); }

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Server stats bar */
.stats-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}
.stat {
  text-align: center;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label { color: var(--text-muted); font-size: 0.9rem; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.card-body { padding: 1.25rem; }

/* Shop grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.shop-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.shop-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.shop-item-image {
  height: 160px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
}
.shop-item-body { padding: 1.25rem; }
.shop-item-body h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.shop-item-body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.shop-item-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

/* Profile page */
.profile-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.profile-avatar-preview {
  flex-shrink: 0;
}
.profile-avatar-preview img,
.profile-avatar-preview .avatar-placeholder {
  width: 96px !important;
  min-width: 96px;
  max-width: 96px;
  height: 96px !important;
  min-height: 96px;
  max-height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  display: block;
}
.profile-avatar-preview {
  overflow: hidden;
}
.profile-avatar-preview .avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Characters grid (multi-character) */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.character-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.character-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.character-card-inner {
  padding: 1.25rem;
  text-align: center;
}
.character-card-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
}
.character-card-name {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.character-card-id {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.character-card-action {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
}

/* Portal */
.portal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  padding: 6rem 1.5rem 3rem;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 768px) {
  .portal-layout {
    grid-template-columns: 1fr;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
.portal-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  position: sticky;
  top: 88px;
}
@media (max-width: 768px) {
  .portal-sidebar { position: static; }
}
.portal-sidebar a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: 8px;
  margin-bottom: 0.25rem;
  text-decoration: none;
}
.portal-sidebar a:hover, .portal-sidebar a.active {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}
.portal-main {
  min-width: 0;
}

/* Dashboard stats - cards side by side */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.dash-card:hover {
  border-color: var(--accent);
}
.dash-card h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.03em; }
.dash-card .value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
tr:hover td { background: var(--bg-elevated); }
.col-item-img { width: 40px; padding: 0.35rem 0.5rem !important; vertical-align: middle; }
.item-thumb { width: 32px; height: 32px; object-fit: contain; display: block; }

.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.inventory-item-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem; text-align: center; }
.inventory-item-card .inv-img { min-height: 40px; margin-bottom: 0.35rem; }
.inventory-item-card .inv-img img { width: 40px; height: 40px; object-fit: contain; margin: 0 auto; }
.inventory-item-card .inv-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; word-break: break-word; }
.inventory-item-card .inv-amount { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.inventory-item-card .inv-actions { display: flex; gap: 0.35rem; justify-content: center; flex-wrap: wrap; }

.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; min-width: 320px; max-width: 90%; }
.modal-card .card-header { padding: 1rem; border-bottom: 1px solid var(--border); }
.modal-card .card-body { padding: 1rem; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 10001; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; min-width: 320px; max-width: 520px; width: 90%; max-height: 85vh; overflow: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.25rem; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--text-muted);
}
input[type="text"], input[type="email"], input[type="password"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: #fca5a5; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--success); color: #6ee7b7; }
.alert-info { background: rgba(59, 130, 246, 0.15); border: 1px solid var(--accent); color: #93c5fd; }

/* Footer */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Page transition overlay */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.page-transition-overlay.visible {
  opacity: 1;
  visibility: visible;
}
.page-transition-content {
  width: 100%;
  max-width: 320px;
  padding: 1.5rem;
}
.page-transition-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.page-transition-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width 2s ease-out;
}
.page-transition-bar.animate {
  width: 100%;
}
.page-transition-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
