/* =====================================================
   LifeM Website - Professional Blue Theme
   Glassmorphism & Modern UI
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&family=Inter:wght@400;600;700&display=swap');

:root {
  /* Color Palette - Professional Blue */
  --primary-blue: #2563eb;       /* Blue 600 */
  --primary-hover: #1d4ed8;      /* Blue 700 */
  --secondary-blue: #3b82f6;     /* Blue 500 */
  --accent-blue: #60a5fa;        /* Blue 400 */
  
  --dark-bg: #0f172a;            /* Slate 900 */
  --darker-bg: #020617;          /* Slate 950 */
  
  --text-main: #f8fafc;          /* Slate 50 */
  --text-muted: #94a3b8;         /* Slate 400 */
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', 'Cairo', sans-serif;
  background-color: var(--darker-bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  direction: ltr; /* Left-to-Right for English */
}

/* ─────────────────────────────────────────────────
   Background Setup
───────────────────────────────────────────────── */
#bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

#bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) contrast(1.1); /* Darken for readability */
}

/* ─────────────────────────────────────────────────
   Typography
───────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700;
  margin-bottom: 1rem;
}

p {
  line-height: 1.6;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────
   Navbar (Glassmorphism)
───────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  z-index: 1000;
  box-shadow: var(--glass-shadow);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-logo {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 10px;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: none; /* Hidden by default, shown by JS */
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-blue);
}

.nav-btn.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-hover);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

/* User Profile in Navbar */
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 5px 5px 15px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
}

.user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 2px solid var(--primary-blue);
}

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

.user-name {
  font-weight: bold;
}

.user-role {
  color: var(--accent-blue);
  font-size: 0.75rem;
}

.logout-btn {
  color: #ef4444;
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 10px;
  transition: var(--transition-smooth);
}
.logout-btn:hover { color: #dc2626; }

/* ─────────────────────────────────────────────────
   Containers & Pages
───────────────────────────────────────────────── */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.page-section.active {
  display: block;
}

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

/* ─────────────────────────────────────────────────
   Glass Cards
───────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
  margin-bottom: 2rem;
}

/* ─────────────────────────────────────────────────
   Buttons
───────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-blue));
}

.btn-discord {
  background: #5865F2;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}
.btn-discord:hover {
  background: #4752C4;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

/* ─────────────────────────────────────────────────
   Login Screen (Initial)
───────────────────────────────────────────────── */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.hero-logo {
  max-width: 250px;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

/* ─────────────────────────────────────────────────
   Store Grid
───────────────────────────────────────────────── */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.store-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.store-card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.store-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #111;
  border-bottom: 1px solid var(--glass-border);
}

.store-info {
  padding: 1.5rem;
}

.store-info h3 {
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.price-tag {
  display: inline-block;
  background: rgba(37, 99, 235, 0.2);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ─────────────────────────────────────────────────
   Rules List
───────────────────────────────────────────────── */
.rules-list {
  list-style: none;
  counter-reset: rule-counter;
}

.rules-list li {
  position: relative;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border-left: 3px solid var(--primary-blue);
  transition: var(--transition-smooth);
}

.rules-list li:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ─────────────────────────────────────────────────
   Forms (Applications)
───────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ─────────────────────────────────────────────────
   Loading Overlay
───────────────────────────────────────────────── */
#loading-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: var(--darker-bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* ─────────────────────────────────────────────────
   Responsive Design
───────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 15px;
    padding: 1rem;
  }
  
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ─────────────────────────────────────────────────
   Staff Administration Section
   ───────────────────────────────────────────────── */
.staff-group-section {
  margin-top: 2rem;
}

.staff-group-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.staff-grid {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.staff-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-smooth);
  min-width: 220px;
}

.staff-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.staff-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.staff-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.staff-name {
  font-weight: 600;
  font-size: 0.95rem;
}

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

/* ─────────────────────────────────────────────────
   Stock Badges & Sold Out States
   ───────────────────────────────────────────────── */
.stock-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.stock-badge.in-stock {
  background: rgba(34, 197, 94, 0.85); /* Transparent green */
  color: white;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.stock-badge.low-stock {
  background: rgba(245, 158, 11, 0.85); /* Transparent amber */
  color: white;
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulse 2s infinite;
}

.stock-badge.sold-out {
  background: rgba(239, 68, 68, 0.85); /* Transparent red */
  color: white;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.card-sold-out {
  opacity: 0.75;
  filter: grayscale(0.4);
}

.btn-sold-out {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ─────────────────────────────────────────────────
   Rules Tabbed System Styling
   ───────────────────────────────────────────────── */
.rules-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.rules-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rules-tab-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: white;
  border-color: var(--accent-blue);
}

.rules-tab-btn.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-hover);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.rules-tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.rules-tab-content.active {
  display: block;
}

.rules-list-arabic {
  list-style: none;
  padding-right: 0;
}

.rules-list-arabic li {
  position: relative;
  padding: 12px 18px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border-right: 3px solid var(--primary-blue);
  transition: var(--transition-smooth);
  font-family: 'Cairo', 'Inter', sans-serif;
  line-height: 1.8;
  font-size: 0.95rem;
}

.rules-list-arabic li:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(-3px);
}

#tab-violations-rules .rules-list-arabic li {
  border-right-color: #ef4444;
}

/* Robbery System Styles */
.robbery-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 0.95rem;
}

.robbery-table td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.robbery-table tr:last-child td {
  border-bottom: none;
}

.robbery-table td:last-child {
  text-align: right;
  color: var(--accent-blue);
}

.table-highlight {
  background: rgba(255, 255, 255, 0.03);
  font-weight: bold;
}

@media (max-width: 768px) {
  .robbery-system-container {
    grid-template-columns: 1fr !important;
  }
}

