html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #ffc107;
    --accent-color: #dc3545;
    --background-light: #ffffff;
    --text-color: #333333;
    --border-color: rgba(0, 0, 0, 0.125);
    --hover-bg: rgba(0, 102, 204, 0.05);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: var(--background-light);
  color: var(--text-color);
}

/* Sidebar styles */
.sidebar {
  min-height: 100vh;
  width: 280px;
  position: fixed;
  top: 0;
  right: 0;
  background: linear-gradient(180deg, var(--primary-color) 0%, #004999 100%) !important;
  padding-top: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  text-align: center;
}

.sidebar-header h3 {
  color: var(--secondary-color);
  font-size: 1.75rem;
  margin: 0;
}

.nav-link {
  padding: 1rem 1.5rem;
  transition: all 0.3s;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  color: var(--text-color) !important;
}

.sidebar .nav-link {
  color: white !important;
}

.nav-link i {
  font-size: 1.5rem;
  margin-left: 1rem;
  width: 2rem;
  text-align: center;
  color: var(--secondary-color);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

/* Main content wrapper */
.content-wrapper {
  margin-right: 280px;
  margin-left: 0;
  width: calc(100% - 280px);
  min-height: 100vh;
  padding: 2rem;
}

/* Card styles */
.card {
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.card-header {
    background-color: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

/* Button styling */
.btn-primary {
  background-color: var(--primary-color);
  border: none;
}

.btn-secondary {
  background-color: var(--secondary-color);
  border: none;
  color: #000;
}

.btn-danger {
  background-color: var(--accent-color);
  border: none;
}

/* Action buttons styling */
.action-button {
  padding: 2rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  background: linear-gradient(145deg, var(--primary-color) 0%, #004999 100%);
  border-radius: 15px;
  color: white;
}

.action-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

.action-button i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

/* Table styling */
.table {
    color: var(--text-color);
    background-color: var(--background-light);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table thead th {
    background-color: rgba(0, 0, 0, 0.02);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
    font-weight: 600;
}

/* Member avatar styling */
.member-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.member-avatar:hover {
  transform: scale(1.1);
  border-color: var(--secondary-color);
}

/* Member table specific styles */
.member-table {
    margin-bottom: 0;
}

.member-table td {
    vertical-align: middle;
}

.member-table .text-muted {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Form controls */
.form-control, .form-select {
    background-color: var(--background-light);
    border-color: var(--border-color);
    color: var(--text-color);
}

.form-control:focus, .form-select:focus {
    background-color: var(--background-light);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
}

/* Badge styling */
.badge {
  padding: 0.5em 1em;
  border-radius: 50rem;
}

.badge.bg-success {
  background-color: #00c853 !important;
}

.badge.bg-danger {
  background-color: var(--accent-color) !important;
}

.badge.bg-warning {
  background-color: var(--secondary-color) !important;
  color: #000;
}

/* RTL specific styles */
[lang="ar"] {
  direction: rtl;
  text-align: right;
}

[lang="ar"] .sidebar {
  left: auto;
  right: 0;
}

[lang="ar"] .content-wrapper {
  margin-left: 0;
  margin-right: 280px;
}

[lang="ar"] .nav-link i {
  margin-right: 0;
  margin-left: 1rem;
}

[lang="ar"] .me-2 {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

[lang="ar"] .ms-2 {
  margin-right: 0.5rem !important;
  margin-left: 0 !important;
}

[lang="ar"] .float-end {
  float: left !important;
}

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

[lang="ar"] .modal-header .btn-close {
  margin: -0.5rem auto -0.5rem -0.5rem;
}

/* Alert styling */
.alert {
  border-radius: 10px;
  border: none;
}

.alert-success {
  background-color: rgba(0, 200, 83, 0.1);
  color: #00c853;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--accent-color);
}

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

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

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