:root {
  --primary-color: #1e293b;
  --light-color: #f8fafc;
  --border-color: #e2e8f0;
  --text-muted: #64748b;
}

body {
  background-color: #f8f9fa;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #334155 100%);
  color: var(--light-color);
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}



.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--light-color);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-item {
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--light-color);
  border-left-color: var(--light-color);
}

.sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--light-color);
  border-left-color: var(--light-color);
}

.sidebar-link i {
  width: 20px;
  margin-right: 12px;
  text-align: center;
}

.sidebar-link span {
  font-weight: 500;
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}



/* Loading Animation */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 123, 255, 0.3);
  border-radius: 50%;
  border-top-color: #007bff;
  animation: spin 1s ease-in-out infinite;
}

.loading-text {
  margin-top: 15px;
  color: #007bff;
  font-weight: 500;
  text-align: center;
}

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

.loading-hidden {
  display: none !important;
}

/* Main Content */
.main-content {
  margin-left: 280px;
  padding: 2rem;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}



/* Mobile Menu Button */
.mobile-menu-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: var(--primary-color);
  color: var(--light-color);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu-btn:hover {
  background: #334155;
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.25rem;
}

.content-section {
  animation: fadeIn 0.3s ease-in;
}

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

.card {
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table th {
  border-top: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.table td {
  vertical-align: middle;
}

/* DataTables custom styling */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dataTables_wrapper .dataTables_filter {
  text-align: right;
}

.dataTables_wrapper .dataTables_info {
  margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate {
  margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.375rem 0.75rem;
  margin-left: 2px;
  border: 1px solid var(--border-color);
  background-color: var(--light-color);
  color: var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: var(--primary-color) !important;
  color: var(--light-color) !important;
  border-color: var(--primary-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: var(--primary-color) !important;
  color: var(--light-color) !important;
  border-color: var(--primary-color);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  outline: none;
}

/* Custom styling for DataTables length select */
.dataTables_wrapper .dataTables_length select {
  width: auto;
  min-width: 60px;
  max-width: 80px;
  display: inline-block;
  margin: 0 5px;
}

.dataTables_wrapper .dataTables_length {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dataTables_wrapper .dataTables_length label {
  margin-bottom: 0;
  white-space: nowrap;
}

.provider-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.provider-type-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.discount-badge {
  background-color: var(--success-color);
  color: rgb(0, 0, 0);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-action {
  padding: 0.25rem 0.5rem;
  margin: 0 0.125rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-block;
}

.btn-action:hover {
  transform: translateY(-1px);
}

.btn-view {
  background-color: var(--secondary-color);
  color: rgb(0, 0, 0);
}

.btn-edit {
  background-color: var(--warning-color);
  color: rgb(0, 0, 0);
}

.btn-delete {
  background-color: var(--danger-color);
  color: red;
}

.chart-container {
  min-height: 300px;
  padding: 1rem;
  background-color: var(--light-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--primary-color);
  font-size: 1.125rem;
  overflow-y: auto;
}

.activity-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  background-color: var(--primary-color);
  color: var(--light-color);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--secondary-color);
}

.modal-lg {
  max-width: 800px;
}

.form-label {
  font-weight: 500;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.provider-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-item {
  padding: 0.75rem;
  background-color: var(--light-color);
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
}

.detail-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.detail-value {
  color: var(--dark-color);
  font-size: 1rem;
}

.map-container {
  height: 200px;
  background-color: #e9ecef;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
}

/* RTL Support for Arabic */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .navbar-brand {
  margin-right: 0;
  margin-left: auto;
}

[dir="rtl"] .text-end {
  text-align: left !important;
}

[dir="rtl"] .text-start {
  text-align: right !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.875rem;
  }

  .provider-logo {
    width: 30px;
    height: 30px;
  }

  .btn-action {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
  }

  .chart-container {
    min-height: 200px;
    font-size: 1rem;
    padding: 0.75rem;
  }
  
  /* Responsive DataTables controls */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.5rem;
  }
  
  .dataTables_wrapper .dataTables_length select {
    min-width: 50px;
    max-width: 70px;
  }
  
  .dataTables_wrapper .dataTables_length label {
    font-size: 0.875rem;
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .card-body {
    padding: 1rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Success/Error Messages */
.alert {
  border: none;
  border-radius: 0.5rem;
}

.alert-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.progress-bar {
  background-color: var(--primary-color) !important;
}

/* Login Page Styles */
.login-card {
  background: var(--light-color);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 2px 16px rgba(30, 41, 59, 0.08);
  padding: 2rem 2rem 1.5rem 2rem;
}
#loginSection {
  background: var(--light-color);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loginForm .form-label {
  color: var(--primary-color);
  font-weight: 500;
}
#loginForm .form-control {
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  font-size: 1rem;
}
#loginForm .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(30, 41, 59, 0.08);
}
#loginForm .btn-primary {
  background: var(--primary-color);
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background 0.2s;
}
#loginForm .btn-primary:hover {
  background: #334155;
}

/* Dashboard specific styles */
.dashboard-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.provider-type-card {
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.provider-type-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.progress {
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  border-radius: 10px;
  transition: width 0.6s ease;
}

/* Detailed breakdown styles */
#detailedBreakdown {
  animation: slideDown 0.3s ease-out;
}

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

.detailed-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.detailed-card:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: scale(1.02);
}

/* Enhanced chart container for better visualization */
.chart-container .row {
  margin: 0;
}

.chart-container .col-md-6,
.chart-container .col-md-4 {
  padding: 0.5rem;
}

/* Provider type badges with better styling */
.provider-type-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}

/* Chart content styling */
.chart-container .progress {
  border-radius: 8px;
  overflow: hidden;
}

.chart-container .progress-bar {
  border-radius: 8px;
  transition: width 0.6s ease;
}

.chart-container .fas {
  font-size: 0.9rem;
}

/* Ensure proper spacing in chart */
.chart-container .row > div {
  margin-bottom: 0.5rem;
}

.chart-container .row > div:last-child {
  margin-bottom: 0;
}

/* Summary cards with better hover effects */
.card[style*="background-color"] {
  transition: all 0.3s ease;
}

.card[style*="background-color"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
