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

:root {
  --bg-gradient: radial-gradient(circle at 50% 50%, #151a30 0%, #0d1020 100%);
  --panel-bg: rgba(26, 32, 58, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #10b981;
  --error: #ef4444;
  --card-bg: rgba(30, 41, 59, 0.5);
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Cairo', 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  direction: rtl;
}

/* Glassmorphism utility classes */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: 16px;
}

/* Installation Wizard styles */
.install-container {
  max-width: 700px;
  width: 90%;
  margin: auto;
  padding: 40px;
  margin-top: 40px;
  margin-bottom: 40px;
  text-align: center;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

.logo-container h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.install-header p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 30px;
}

.form-section-title {
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: right;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.form-group.full-width {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .form-group.full-width {
    grid-column: span 1;
  }
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

input, select, textarea {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition-speed) ease;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 4px 14px 0 var(--primary-glow);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
}

.btn:active {
  transform: translateY(1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #d97706);
  box-shadow: 0 4px 14px 0 var(--accent-glow);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px 0 var(--accent-glow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error), #dc2626);
  box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  box-shadow: 0 6px 20px 0 rgba(239, 68, 68, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

/* Dashboard Styles */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-left: 1px solid var(--panel-border);
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.sidebar-logo h2 {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.menu-item:hover, .menu-item.active {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.15);
  border-right: 4px solid var(--primary);
}

.menu-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content area */
.main-content {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  max-width: calc(100% - 260px);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
}

.user-details h3 {
  font-size: 14px;
  font-weight: 700;
}

.user-details p {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info h4 {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-info p {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

/* Table Card */
.table-card {
  padding: 24px;
  margin-bottom: 40px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

th {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

td {
  padding: 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-lawyer { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-citizen { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-secretary { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.badge-verified { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-pending { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-notverified { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.badge-rejected { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.badge-active { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-suspended { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.actions-cell {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 600px;
  padding: 30px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

/* Documents Viewer styles */
.doc-review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 30px;
}

.doc-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.doc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.doc-image-wrapper {
  width: 100%;
  height: 250px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  overflow: hidden;
  background: #090d16;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: zoom-in;
}

.doc-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--transition-speed) ease;
}

.doc-image-wrapper:hover img {
  transform: scale(1.05);
}

/* Toast styling */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease forwards;
}

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

.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--primary); }

/* Installer Steps & Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  margin-bottom: 30px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.4s ease;
}
