:root {
  --bg-main: #0c0f17;
  --bg-darker: #080a10;
  --bg-card: #131722;
  --bg-card-hover: #181d2b;
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --blue-primary: #335dfd;
  --blue-hover: #264be0;
  --blue-glow: rgba(51, 93, 253, 0.4);
  --emerald-green: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --crimson-red: #ef4444;
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Cairo', 'Tajawal', sans-serif;
}

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

body {
  background-color: #0c0f17 !important;
  background: #0c0f17 !important;
  color: var(--text-main);
  font-family: var(--font-family);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Ambient glow backgrounds - completely disabled for clean uniform grey */
.bg-ambient-glow {
  display: none !important;
}

/* Subtle grid overlay */
.bg-grid-pattern {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

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

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(12, 15, 23, 0.85);
  border-bottom: 1px solid var(--bg-card-border);
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.shield-icon {
  width: 36px;
  height: 36px;
  background: #141824;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-link .sparkle {
  color: #facc15;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--blue-primary);
  color: #fff;
  box-shadow: 0 4px 20px var(--blue-glow);
}

.btn-primary:hover {
  background-color: var(--blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(51, 93, 253, 0.5);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--emerald-glow);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

/* User profile button in header */
.user-menu-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: #fff;
}

.user-menu-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--blue-primary);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Hero Section */
.hero-section {
  padding: 5.5rem 0 3.5rem;
  text-align: center;
  position: relative;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(51, 93, 253, 0.1);
  border: 1px solid rgba(51, 93, 253, 0.3);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.75rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald-green);
  box-shadow: 0 0 10px var(--emerald-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 3.75rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtext {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

/* Feature Ticker / Ribbon */
.feature-ticker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  max-width: 900px;
  margin: 0 auto;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(17, 24, 47, 0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ticker-item svg {
  color: var(--blue-primary);
}

/* Stats Ribbon */
.stats-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 2rem;
  margin: 4rem auto;
  background: rgba(17, 24, 47, 0.45);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  backdrop-filter: blur(12px);
}

.stat-card {
  text-align: center;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.stat-number.green {
  color: var(--emerald-green);
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Threat Detection Section */
.section {
  padding: 5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  color: var(--blue-primary);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.threat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.threat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.threat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.threat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(51, 93, 253, 0.4);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.threat-card:hover::before {
  opacity: 1;
}

.threat-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(51, 93, 253, 0.1);
  border: 1px solid rgba(51, 93, 253, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-primary);
  margin-bottom: 1.25rem;
}

.threat-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.threat-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Beast Mode Highlight Section */
.beast-section {
  background: linear-gradient(180deg, #131724 0%, #0d1018 100%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 3.25rem;
  margin: 4rem 0;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3.5rem;
  align-items: center;
}

@media (max-width: 968px) {
  .beast-section {
    grid-template-columns: 1fr;
    padding: 2rem;
    gap: 2rem;
  }
}

.beast-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.terminal-box {
  background: #090c14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.terminal-header {
  background: #0e1320;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 1.35rem;
  font-size: 0.84rem;
  line-height: 1.8;
  background: #090c14;
}

.log-line {
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.6rem;
}

.log-line.normal { color: #94a3b8; }
.log-line.warn { color: #fbbf24; }
.log-line.danger { color: #f87171; font-weight: 600; }
.log-line.success { color: #34d399; font-weight: 600; }

/* Dashboard Styles */
.dashboard-layout {
  padding: 2.5rem 0 5rem;
}

.user-banner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(18, 23, 34, 0.8) 100%);
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  backdrop-filter: blur(12px);
}

.user-info-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.guild-card {
  background: linear-gradient(180deg, #121827 0%, #0c101c 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.28s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  position: relative;
}

.guild-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.guild-banner-wrapper {
  width: 100%;
  height: 80px;
  position: relative;
  overflow: hidden;
  background: #141b2a;
}

.guild-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-banner-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #192338 0%, #0e1422 100%);
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}

.guild-icon-centered {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #161f31;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.35rem;
  overflow: hidden;
  border: 4px solid #0c101c;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  margin: -33px auto 0.65rem auto;
  position: relative;
  z-index: 2;
}

.guild-icon-centered img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-meta-centered {
  text-align: center;
  padding: 0 1.25rem;
  flex: 1;
}

.guild-title-centered {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.guild-status-centered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.26rem 0.8rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.95rem;
  transition: all 0.2s ease;
}

.guild-status-centered.is-active {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(16, 185, 129, 0.25);
}

.guild-status-centered.is-inactive {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.14);
}

.guild-actions-centered {
  display: flex;
  gap: 0.65rem;
  padding: 0 1.25rem 1.35rem 1.25rem;
  margin-top: auto;
}

.btn-dark-grey {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, #1f2736 0%, #141b27 100%);
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  letter-spacing: -0.01em;
}

.btn-dark-grey:hover {
  background: linear-gradient(180deg, #283347 0%, #192232 100%);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-dark-grey:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-dark-grey.btn-full {
  flex: 1;
  width: 100%;
}

/* Modal and Settings Panel */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal {
  background: #0d111a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.modal-head {
  padding: 1.5rem 2rem;
  background: #121622;
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.modal-foot {
  padding: 1.25rem 2rem;
  background: #121622;
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

/* Control Row & Switch */
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #232a36;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

input:checked + .slider {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.rule-card.is-active-card {
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12) !important;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-weight: 600;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.footer {
  border-top: 1px solid var(--bg-card-border);
  padding: 4rem 0 2.5rem;
  margin-top: 5rem;
  background: rgba(11, 15, 25, 0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #fff;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--blue-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 992px) {
  .hero-title { font-size: 2.75rem; }
  .beast-section { grid-template-columns: 1fr; gap: 2rem; padding: 2rem; }
  .stats-container { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2.2rem; }
  .hero-subtext { font-size: 1rem; }
  .stats-container { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .hero-ctas { flex-direction: column; width: 100%; }
  .hero-ctas .btn { width: 100%; }
}

/* Language Switcher Button */
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--blue-primary);
}

[dir="rtl"] {
  text-align: right;
}

[dir="ltr"] {
  text-align: left;
}
