/* ============================================================
   Face-Crypt-Cloud | Admin Portal Stylesheet
   Theme: Dark Cyberpunk / Glassmorphism
   ============================================================ */

/* Body background/font: handled by landing.css (loaded before this file) */

/* ── Nav Logout Button ── */
.btn-nav-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 20px;
  color: #FCA5A5;
  font-family: var(--font-arabic);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-nav-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.7);
  color: #FCA5A5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

/* Base Headings */
h1, h3, h4 {
  text-align: center;
  color: var(--white);
  font-family: var(--font-arabic);
}

h1 {
  background: linear-gradient(135deg, var(--white) 0%, var(--cyan-300) 50%, var(--blue-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
}

/* Glassmorphism Cards */
.card {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--border-radius-xl) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 1px rgba(0,212,255,0.06) !important;
  color: var(--white) !important;
  margin-bottom: 24px;
}

#loginSection,
#adminPanel {
  max-width: 900px;
  margin: auto;
  position: relative;
  z-index: 10;
}

.hidden {
  display: none !important;
}

/* Labels and Inputs */
.form-label {
  color: var(--white-90);
}

.form-control, .form-select {
  background-color: var(--white-05) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--white) !important;
  border-radius: var(--border-radius-md) !important;
}

.form-control::placeholder {
  color: var(--white-50);
}

.form-control:focus, .form-select:focus {
  background-color: var(--white-10) !important;
  border-color: var(--cyan-400) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.25) !important;
}

/* Primary Buttons */
.btn-primary, .btn-success {
  background: linear-gradient(135deg, var(--blue-500) 0%, #005ACC 40%, var(--cyan-400) 100%) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: var(--border-radius-lg) !important;
  font-weight: 700 !important;
  transition: var(--transition-smooth) !important;
  box-shadow: 0 4px 16px rgba(0,128,255,0.3) !important;
}

.btn-primary:hover, .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,128,255,0.5), 0 0 20px rgba(0,212,255,0.2) !important;
}

.btn-danger {
  background: linear-gradient(135deg, #B91C1C 0%, #EF4444 100%) !important;
  border: none !important;
  border-radius: var(--border-radius-lg) !important;
}

.btn-outline-danger {
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}
.btn-outline-danger:hover {
  background: #EF4444 !important;
  color: var(--white) !important;
}

.btn-outline-secondary {
  border-color: var(--glass-border) !important;
  color: var(--cyan-300) !important;
}
.btn-outline-secondary:hover {
  background-color: var(--white-10) !important;
  color: var(--cyan-400) !important;
}

/* Password Visibility Toggle */
.input-group .btn-outline-secondary {
  background-color: var(--white-05) !important;
}
.input-group .btn-outline-secondary:hover {
  background-color: var(--white-10) !important;
  color: var(--cyan-400) !important;
  border-color: var(--cyan-400) !important;
}
.input-group .btn-outline-secondary:focus {
  box-shadow: none !important;
}

/* Statistics Cards */
.stat-card-hover {
  background: var(--navy-800) !important;
  border: 1px solid var(--white-05) !important;
  transition: var(--transition-smooth) !important;
  border-radius: var(--border-radius-md) !important;
}

.stat-card-hover:hover {
  background: var(--navy-700) !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,212,255,0.15) !important;
}

/* Mapping bootstrap border colors to our palette for stats */
.border-primary { border-color: var(--blue-400) !important; }
.border-success { border-color: var(--cyan-400) !important; }
.border-danger { border-color: #EF4444 !important; }
.border-secondary { border-color: #9CA3AF !important; }
.border-warning { border-color: var(--gold-400) !important; }
.border-dark { border-color: #374151 !important; }
.border-info { border-color: var(--cyan-300) !important; }

/* Text colors mapping for stats */
.text-primary { color: var(--blue-400) !important; }
.text-success { color: var(--cyan-400) !important; }
.text-danger { color: #EF4444 !important; }
.text-secondary { color: #9CA3AF !important; }
.text-warning { color: var(--gold-400) !important; }
.text-dark { color: var(--white) !important; }
.text-info { color: var(--cyan-300) !important; }
.text-muted { color: var(--white-50) !important; }

/* Audit Logs Table */
.table {
  color: var(--white-90) !important;
  background-color: transparent !important;
  border-color: var(--white-10) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.02) !important;
  color: var(--white-90) !important;
}

.table-hover > tbody > tr:hover > * {
  background-color: rgba(0, 212, 255, 0.05) !important;
  color: var(--white) !important;
}

.table-dark {
  background-color: var(--navy-800) !important;
}
.table-dark th {
  background-color: var(--navy-700) !important;
  border-color: var(--glass-border) !important;
  color: var(--cyan-300) !important;
  font-weight: 600;
}

.table td, .table th {
  border-color: var(--white-10) !important;
  vertical-align: middle;
}

/* Badges for Audit Logs */
.badge {
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}

/* Animations */
#arabicWarning {
  display: block;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================================
   ADMIN UX IMPROVEMENTS
   ============================================================ */

/* -- Sticky Audit Table Header -- */
.table-responsive {
  max-height: 520px;
  overflow-y: auto;
  border-radius: var(--border-radius-md);
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,212,255,0.3) transparent;
}
.table-responsive::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.table-responsive::-webkit-scrollbar-track { background: transparent; }
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(0,212,255,0.3);
  border-radius: 10px;
}

.table thead.table-dark th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--navy-700) !important;
}

/* Minimum column widths to prevent squeezing */
.table th:nth-child(1), .table td:nth-child(1) { min-width: 110px; } /* الحدث */
.table th:nth-child(2), .table td:nth-child(2) { min-width: 80px;  } /* الحالة */
.table th:nth-child(3), .table td:nth-child(3) { min-width: 110px; } /* معرف المستخدم */
.table th:nth-child(4), .table td:nth-child(4) { min-width: 140px; } /* الوقت */
.table th:nth-child(5), .table td:nth-child(5) { min-width: 90px;  } /* الإجراءات */

/* -- Stat Cards — clearer number/label hierarchy -- */
.stat-card-hover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px !important;
  min-height: 88px;
  gap: 4px;
}

.stat-card-hover .fs-3 {
  font-size: 2rem !important;
  line-height: 1.1;
  font-weight: 800 !important;
}

.stat-card-hover .fs-6 {
  font-size: 0.72rem !important;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

/* -- Section card headers (Add/Delete user, Audit, Stats) -- */
.card h4 {
  font-size: 1rem;
  padding-bottom: 12px;
  margin-bottom: 16px !important;
  border-bottom: 1px solid var(--white-10);
  text-align: right;
}

/* -- Section title top-border accent line -- */
.card h4::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--cyan-400);
  border-radius: 2px;
  margin-inline-start: 10px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* -- Admin logout action bar -- */
#adminPanel > div:first-child {
  border-bottom: 1px solid var(--white-10);
  padding-bottom: 16px;
  margin-bottom: 20px !important;
}

/* -- Login page security info strip -- */
.admin-security-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,193,7,0.05);
  border: 1px solid rgba(255,193,7,0.18);
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--white-70);
  line-height: 1.7;
  text-align: right;
}

.admin-security-strip .strip-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

/* -- "فك الحظر" unblock button consistent style -- */
.btn-outline-success {
  border-color: var(--cyan-400) !important;
  color: var(--cyan-400) !important;
  border-radius: var(--border-radius-sm) !important;
  font-size: 0.78rem !important;
  padding: 4px 12px !important;
  transition: var(--transition-fast) !important;
}
.btn-outline-success:hover {
  background-color: rgba(0,212,255,0.12) !important;
  box-shadow: 0 0 12px rgba(0,212,255,0.2) !important;
}

/* -- Audit log search input spacing -- */
#auditSearch {
  margin-bottom: 4px;
}

/* -- Responsive: narrower viewports hide h1 subtitle on admin -- */
@media (max-width: 520px) {
  #loginSection, #adminPanel {
    max-width: 100%;
  }
  .stat-card-hover .fs-3 {
    font-size: 1.5rem !important;
  }
}

/* --- Security Settings Panel (Glassmorphism) --- */
.settings-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.settings-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.setting-info h3 {
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1.2rem;
}

.setting-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    max-width: 450px;
    line-height: 1.5;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.25);
    padding: 15px 25px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tolerance-badge {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    min-width: 65px;
    text-align: center;
}

/* Custom Sleek Range Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 220px;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.neon-control-box {
    background: rgba(0, 0, 0, 0.25);
    padding: 15px 25px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.neon-btn {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.neon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.6);
}

.custom-range-glow {
    width: 100%;
}
