/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cairo", sans-serif;
  direction: rtl;
  background-color: #f9fafb;
  color: #1f2937;
  line-height: 1.6;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header Styles */
.header {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  font-size: 32px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #1e3a8a;
}

/* Header with Navigation */
.header-nav {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
  text-decoration: none;
  padding-bottom: 4px;
  transition: all 0.2s;
}

.nav-link:hover {
  color: #3b82f6;
}

.nav-link.active {
  color: #3b82f6;
  border-bottom: 2px solid #3b82f6;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-menu {
  position: relative;
}

.user-button {
  background: none;
  border: none;
  border-radius: 50%;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.user-button:hover {
  background-color: #f3f4f6;
}

.user-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 8px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-width: 192px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #1f2937;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
}

.dropdown-item.text-red {
  color: #ef4444;
}

/* Button Styles */
.btn-outline {
  background: transparent;
  border: 2px solid #3b82f6;
  color: #3b82f6;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background-color: #3b82f6;
  color: white;
}

.btn-sm {
  font-size: 14px;
  padding: 6px 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  border: none;
  padding: 12px 48px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  margin-top: auto;
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Main Content */
.main-content {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.hero-text {
  text-align: center;
  margin-bottom: 48px;
}

.hero-title {
  font-size: 36px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 20px;
  color: #6b7280;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.auth-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 450px;
  transition: all 0.3s;
}

.auth-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.card-icon {
  width: 96px;
  height: 96px;
  color: #3b82f6;
  margin-bottom: 24px;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 16px;
}

.card-description {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 24px;
  line-height: 1.6;
}

.btn-learn-more {
  background: transparent;
  border: 2px solid #f59e0b;
  color: #f59e0b;
  padding: 8px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.btn-learn-more:hover {
  background-color: #f59e0b;
  color: white;
}

.phone-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-align: center;
  font-family: "Cairo", sans-serif;
  font-size: 16px;
  margin-bottom: 16px;
}

/* QR Page Styles */
.qr-main {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.qr-container {
  width: 100%;
  max-width: 600px;
}

.qr-card {
  background: white;
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.qr-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 32px;
}

.qr-code-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

#qrcode {
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
}

.qr-timer-section {
  margin-bottom: 24px;
}

.qr-timer-label {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 8px;
}

.qr-timer {
  font-size: 36px;
  font-weight: 700;
  color: #f59e0b;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.qr-instructions {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 24px;
}

.btn-refresh {
  background: white;
  border: 2px solid #3b82f6;
  color: #3b82f6;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background-color: #3b82f6;
  color: white;
}

/* Dashboard Hero */
.dashboard-hero {
  background: linear-gradient(to bottom, #eff6ff, white);
  padding: 64px 16px;
  text-align: center;
}

.dashboard-hero-title {
  font-size: 40px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 16px;
}

.dashboard-hero-subtitle {
  font-size: 20px;
  color: #6b7280;
  margin-bottom: 32px;
}

.search-wrapper {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 48px 16px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-family: "Cairo", sans-serif;
  font-size: 16px;
}

.search-button {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
}

/* Services Section */
.services-section {
  padding: 64px 16px;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: #1e3a8a;
  text-align: center;
  margin-bottom: 48px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.service-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.service-name {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.service-description {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 16px;
}

.btn-service {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  border: none;
  padding: 10px 32px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.btn-service:hover {
  transform: scale(1.02);
}

/* Profile Page */
.profile-main {
  padding: 48px 16px;
  min-height: calc(100vh - 400px);
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 32px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.profile-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}

.profile-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.profile-field label {
  font-weight: 600;
  color: #6b7280;
}

.profile-field span {
  color: #1f2937;
}

.badge-admin {
  background-color: #ef4444;
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.token-text {
  color: #ec4899;
  font-family: monospace;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1f2937;
}

.form-select {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: "Cairo", sans-serif;
  font-size: 16px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.form-checkbox label {
  cursor: pointer;
  color: #1f2937;
}

.btn-save {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 12px 48px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save:hover {
  background-color: #2563eb;
}

/* Handlers Page */
.handlers-main {
  padding: 48px 16px;
  min-height: calc(100vh - 400px);
}

.handlers-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 32px;
}

.handlers-subtitle {
  color: #6b7280;
  margin-top: 8px;
}

.handlers-layout {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 24px;
}

.handlers-table-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}

.handlers-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.table-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a8a;
}

.btn-add-handler {
  background-color: #10b981;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-handler:hover {
  background-color: #059669;
}

.table-wrapper {
  overflow-x: auto;
}

.handlers-table {
  width: 100%;
  border-collapse: collapse;
}

.handlers-table th {
  background-color: #f9fafb;
  padding: 12px;
  text-align: right;
  font-weight: 700;
  border-bottom: 2px solid #e5e7eb;
}

.handlers-table td {
  padding: 16px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.host-text {
  color: #ec4899;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-active {
  background-color: #10b981;
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.btn-action {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background-color: #3b82f6;
  color: white;
}

.btn-edit:hover {
  background-color: #2563eb;
}

.btn-delete {
  background-color: #ef4444;
  color: white;
}

.btn-delete:hover {
  background-color: #dc2626;
}

.handlers-note {
  margin-top: 16px;
  padding: 12px;
  background-color: #eff6ff;
  border-radius: 8px;
  color: #1e3a8a;
  font-size: 14px;
}

.handlers-form-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}

.form-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 24px;
  text-align: center;
}

.handler-form {
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1f2937;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: "Cairo", sans-serif;
  font-size: 16px;
}

.form-help {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  resize: vertical;
}

.btn-submit-handler {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-submit-handler:hover {
  background-color: #2563eb;
}

/* Footer Styles */
.footer {
  background-color: #1e3a8a;
  color: white;
  padding: 24px 0;
  text-align: center;
  margin-top: auto;
}

.footer-text {
  font-size: 14px;
}

.footer-full {
  background-color: #1e3a8a;
  color: white;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  padding: 48px 0 32px 0;
}

.footer-column {
  text-align: right;
}

.footer-logo {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.footer-logo-text {
  font-size: 14px;
  font-weight: 600;
}

.footer-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #f59e0b;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  font-size: 14px;
  margin-bottom: 4px;
}

/* Dialog Styles */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.dialog-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
}

.dialog-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e3a8a;
  text-align: center;
  margin-bottom: 16px;
}

.dialog-description {
  font-size: 18px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 24px;
}

.btn-dialog {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dialog:hover {
  background-color: #2563eb;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    display: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .handlers-layout {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  /* Adding responsive styles for users page */
  .users-grid {
    grid-template-columns: 1fr;
  }
}

/* Adding styles for users management page */
/* Users Management Page */
.users-grid {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 24px;
}

.users-table-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.users-table-card .card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.users-table-card .card-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a8a;
}

.users-table-card .card-content {
  padding: 24px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th {
  background-color: #f9fafb;
  padding: 12px 16px;
  text-align: right;
  font-weight: 700;
  border-bottom: 2px solid #e5e7eb;
  color: #1f2937;
}

.users-table td {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  text-align: right;
}

.users-table td.text-center {
  text-align: center;
}

.badge-user {
  background-color: #3b82f6;
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
}

.add-user-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.add-user-card .card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.add-user-card .card-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a8a;
}

.add-user-card .card-content {
  padding: 24px;
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-form .form-group {
  margin-bottom: 0;
}

.user-form input,
.user-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: "Cairo", sans-serif;
  font-size: 16px;
  text-align: right;
}

.user-form input:focus,
.user-form select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: #1f2937;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.text-danger {
  color: #ef4444;
}

/* Header Updates */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.flag {
  font-size: 32px;
}

.nav {
  display: flex;
  gap: 32px;
}

.lang-toggle {
  background: transparent;
  border: 2px solid #3b82f6;
  color: #3b82f6;
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.lang-toggle:hover {
  background-color: #3b82f6;
  color: white;
}

/* Completing the incomplete user-menu-btn styles */
.user-menu-btn {
  background: none;
  border: none;
  border-radius: 50%;
  padding: 8px;
}