/* ==========================================
   Storest Portal - Dark Mode Neon CSS Design System
   ========================================== */

:root {
  --bg-dark: #080B11;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-neon-cyan: rgba(0, 242, 254, 0.4);
  --border-neon-purple: rgba(121, 40, 202, 0.4);

  --neon-cyan: #00F2FE;
  --neon-cyan-glow: rgba(0, 242, 254, 0.25);
  --neon-purple: #9D4EDD;
  --neon-purple-glow: rgba(157, 78, 221, 0.25);
  --neon-amber: #F59E0B;
  --neon-emerald: #10B981;
  --neon-red: #FF4D4D;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.dark-neon-theme {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* --- ANIMATED BACKGROUND MESH GLOW --- */
.glow-mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: pulse-glow 12s infinite alternate ease-in-out;
}

.glow-circle.cyan {
  width: 500px;
  height: 500px;
  background: #00F2FE;
  top: -100px;
  left: -100px;
}

.glow-circle.purple {
  width: 600px;
  height: 600px;
  background: #7928CA;
  bottom: -150px;
  right: -100px;
  animation-delay: 4s;
}

.glow-circle.amber {
  width: 400px;
  height: 400px;
  background: #F59E0B;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 8s;
  opacity: 0.15;
}

@keyframes pulse-glow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
  100% { transform: scale(1.15) translate(30px, -20px); opacity: 0.35; }
}

/* --- LAYOUT SCREENS --- */
.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view-screen {
  display: none;
  width: 100%;
  min-height: 100vh;
}

.view-screen.active {
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* --- GLASSMORPHISM CARDS & CONTAINERS --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-normal);
}

.glass-nav {
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

.glass-modal {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px var(--neon-cyan-glow);
}

/* --- NEON TEXT & UTILITIES --- */
.neon-text-cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--neon-cyan-glow);
}

.neon-text-purple {
  color: var(--neon-purple);
  text-shadow: 0 0 12px var(--neon-purple-glow);
}

.text-emerald { color: var(--neon-emerald); }
.text-amber { color: var(--neon-amber); }
.text-purple { color: var(--neon-purple); }
.text-red { color: var(--neon-red); }
.text-muted { color: var(--text-muted); }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.hidden { display: none !important; }
.block { display: block; }

/* --- BUTTONS --- */
.btn-neon-primary {
  background: linear-gradient(135deg, #00F2FE 0%, #4FACFE 100%);
  color: #080B11;
  font-weight: 700;
  font-family: var(--font-family);
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-neon-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  filter: brightness(1.1);
}

.btn-neon-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-neon-cyan);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-neon-outline:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.btn-icon-only {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-only:hover {
  background: rgba(255, 77, 77, 0.15);
  border-color: var(--neon-red);
}

.btn-icon-svg { width: 18px; height: 18px; }

/* --- INPUTS & FORM CONTROL --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.neon-input, .neon-input-sm, .neon-select-sm {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.95rem;
  padding: 12px 14px 12px 42px;
  transition: var(--transition-fast);
}

.neon-input-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.neon-select-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.neon-input:focus, .neon-input-sm:focus, .neon-select-sm:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
  background: rgba(15, 23, 42, 0.95);
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
}

.btn-toggle-password:hover { opacity: 1; }

/* --- SCREEN 1: LOGIN VIEW --- */
#view-login {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
}

.login-card {
  padding: 36px 30px;
  border-color: var(--border-neon-cyan);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px var(--neon-cyan-glow);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.logo-hexagon {
  width: 56px;
  height: 56px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--neon-cyan);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--neon-cyan-glow);
}

.logo-hexagon svg { width: 32px; height: 32px; }

.brand-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-glass);
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.system-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  margin-top: 4px;
}

/* --- SCREEN 2: LAUNCHER HUB VIEW --- */
.portal-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon-sm { width: 28px; height: 28px; }

.brand-mini h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-mini h2 span { color: var(--neon-cyan); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 30px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #7928CA, #00F2FE);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.user-info {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.badge-role {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  width: fit-content;
}

.badge-role.super-admin {
  background: rgba(245, 158, 11, 0.2);
  color: var(--neon-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-role.user {
  background: rgba(0, 242, 254, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.portal-body {
  padding-top: 30px;
  padding-bottom: 40px;
  flex: 1;
}

.portal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 36px;
}

.hero-text h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

.hero-stats {
  display: flex;
  gap: 24px;
}

.hero-stat-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 20px;
  text-align: center;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-count {
  font-size: 0.75rem;
  background: rgba(0, 242, 254, 0.1);
  color: var(--neon-cyan);
  border: 1px solid var(--border-neon-cyan);
  padding: 2px 10px;
  border-radius: 20px;
}

.search-box {
  position: relative;
  width: 260px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

.search-box input {
  padding-left: 32px;
}

/* --- MODULE CARDS GRID --- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  transition: var(--transition-normal);
  overflow: hidden;
}

.module-card.allowed:hover {
  transform: translateY(-4px);
  border-color: var(--neon-cyan);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--neon-cyan-glow);
}

.module-card.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
  cursor: not-allowed;
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.module-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--border-neon-cyan);
  color: var(--neon-cyan);
}

.module-card.locked .module-icon-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass);
  color: var(--text-dim);
}

.module-icon-box svg { width: 26px; height: 26px; }

.status-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.status-badge.unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: var(--neon-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.locked-badge {
  background: rgba(255, 77, 77, 0.15);
  color: var(--neon-red);
  border: 1px solid rgba(255, 77, 77, 0.3);
}

.module-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.module-card-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.module-card-bottom {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-glass);
}

.btn-launch-module {
  width: 100%;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* --- MODAL: ADMIN USER MANAGEMENT --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover { color: var(--neon-red); }

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
}

.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.checkbox-item input {
  accent-color: var(--neon-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
}

/* --- NEON TABLE --- */
.neon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.neon-table th, .neon-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

.neon-table th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.neon-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.tag-perm {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(0, 242, 254, 0.1);
  color: var(--neon-cyan);
  border: 1px solid var(--border-neon-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 4px;
}

.action-btns {
  display: flex;
  gap: 8px;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.88rem;
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-color: var(--neon-emerald); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }
.toast.error { border-color: var(--neon-red); box-shadow: 0 0 15px rgba(255, 77, 77, 0.2); }

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.portal-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-glass);
}
