@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
:root {
  --bg-deep: #090c0f;
  --bg-panel: #0f1419;
  --bg-surface: #161d25;
  --bg-hover: #1c2530;
  --accent: #00d4e8;
  --accent-dim: rgba(0, 212, 232, 0.12);
  --accent-glow: rgba(0, 212, 232, 0.06);
  --signal-red: #e84855;
  --signal-amber: #f5a623;
  --text-primary: #e8edf2;
  --text-secondary: #7a8fa6;
  --text-muted: #3d5068;
  --border: rgba(0, 212, 232, 0.14);
  --border-hard: rgba(0, 212, 232, 0.28);
  --border-panel: rgba(255, 255, 255, 0.05);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --font-display: -apple-system, "Manrope", sans-serif;
  --font-mono: -apple-system, "Roboto", monospace;
  --font-body: -apple-system, "Manrope", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--accent);
  color: var(--bg-deep);
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
  background-image:
    linear-gradient(rgba(0, 212, 232, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 232, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(0, 212, 232, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 232, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
}

.loading p {
  margin-top: var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.loader {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 24px rgba(0, 212, 232, 0.25);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.content {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  flex: 1;
}

.profileBanner {
  height: 260px;
  background:
    radial-gradient(circle at top left, rgba(0, 212, 232, 0.12), transparent 50%),
    linear-gradient(135deg, var(--bg-panel), var(--bg-deep));
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.profileBanner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 232, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.profileWrapper {
  width: 100%;
  padding: 0 1.5rem 4rem;
  margin-top: -100px;
  position: relative;
  z-index: 1;
}

.profileCard {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  animation: fadeUp 0.45s ease both;
}

.profileTop {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.avatarContainer {
  position: relative;
  flex-shrink: 0;
}

.profileAvatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-hard);
  display: block;
}

.statusDot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--bg-panel);
  background: #4fca7a;
}

.profileIdentity {
  flex: 1;
  min-width: 0;
}

.profileIdentity h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.profileIdentity p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.profileBadges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge.admin {
  background: rgba(232, 72, 85, 0.15);
  color: var(--signal-red);
  border: 1px solid rgba(232, 72, 85, 0.35);
}

.badge.staff {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-hard);
}

.badge.user {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-panel);
}

.profileGrid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.infoCard {
  background: var(--bg-surface);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.25s;
}

.infoCard:hover {
  border-color: var(--border);
  transform: translateY(-3px);
}

.infoCard span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.infoCard h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.statsGrid,
.staffGrid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.statCard {
  background: var(--bg-surface);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.25s;
}

.statCard:hover {
  border-color: var(--border);
  transform: translateY(-3px);
}

.statCard span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.statCard h2 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

#messageBox {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.5;
  transition: border-color 0.2s;
}

#messageBox.success {
  background: rgba(79, 202, 122, 0.08);
  border-color: rgba(79, 202, 122, 0.35);
  color: #4fca7a;
}

#messageBox.error {
  background: rgba(232, 72, 85, 0.08);
  border-color: rgba(232, 72, 85, 0.35);
  color: var(--signal-red);
}

#messageBox.warning {
  background: rgba(245, 166, 35, 0.08);
  border-color: rgba(245, 166, 35, 0.35);
  color: var(--signal-amber);
}

#messageBox.info {
  background: var(--accent-dim);
  border-color: var(--border-hard);
  color: var(--accent);
}

#messageBox:empty {
  display: none;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.popup {
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  background: var(--bg-panel);
  border: 1px solid var(--border-hard);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent-dim);
  border-bottom: 1px solid var(--border);
}

.popup-header h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.popup-content {
  padding: 1.25rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  background: var(--bg-surface);
}

.photo-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.25s;
}

.photo-card:hover {
  border-color: var(--border);
  transform: translateY(-3px);
}

.popup-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.popup-photo:hover {
  transform: scale(1.04);
  filter: brightness(0.75);
}

.photo-info {
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  word-break: break-word;
}

.photo-info p {
  margin: 0;
  line-height: 1.5;
}

.close-popup {
  background: transparent;
  color: var(--signal-red);
  border: 1px solid var(--signal-red);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.close-popup:hover {
  background: var(--signal-red);
  color: #fff;
}

.callCenter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2rem;
}

.callCenter a {
  color: var(--signal-red);
  text-decoration: underline;
}

.none {
  display: none !important;
}

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

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

@media (max-width: 992px) {
  .profileCard {
    padding: 2rem;
  }

  .profileIdentity h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .profileBanner {
    height: 200px;
  }

  .profileWrapper {
    margin-top: -70px;
  }

  .profileTop {
    flex-direction: column;
    text-align: center;
  }

  .profileIdentity h1 {
    font-size: 1.75rem;
  }

  .profileIdentity p {
    font-size: 0.9rem;
  }

  .profileBadges {
    justify-content: center;
  }

  #statHiddenCard {
    display: none;
  }

  .popup {
    width: 95%;
    max-height: 90vh;
  }

  .popup-content {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }

  .popup-photo {
    height: 180px;
  }

  .photo-info {
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .profileCard {
    padding: 1.25rem;
  }

  .profileAvatar {
    width: 110px;
    height: 110px;
  }

  .profileIdentity h1 {
    font-size: 1.5rem;
  }

  .infoCard {
    padding: 1rem;
  }
}