/*==========================
Starter Kit Brand Variables
==========================*/
:root {
  /* Brand Primary Colors - Mapped from HTML injection with fallbacks */
  --brand-primary: var(--primary-color, #0d6efd);
  --brand-secondary: var(--secondary-color, #6c757d);
  --brand-accent: var(--accent-color, #ffc107);
  
  /* Functional Colors */
  --brand-success: var(--success-color, #198754);
  --brand-danger: var(--danger-color, #dc3545);
  --brand-dark: var(--dark-color, #212529);
  --brand-light: var(--light-color, #f8f9fa);

  /* Layout Variables */
  --bg-canvas: var(--brand-light);
  --white-accent: #FFFFFF;
  --text-main: #1A1A1A;
  --border-color: #e2e8f0;
}


/* == Start of Custom Select */
.custom-select-wrapper {
  position: relative;
  z-index: 10;
}

.custom-select-wrapper.active {
  z-index: 1070 !important;
}

.full-width {
  width: 100%;
}

.custom-select-label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--text-main);
}

.custom-select-display {
  border: 2px solid var(--border-color);
  padding: .5rem .85rem;
  border-radius: 12px;
  cursor: pointer;
  background: var(--white-accent);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 42px;
  display: flex;
  align-items: center;
  user-select: none;
}

[dir="ltr"] .custom-select-display {
  padding-right: 2.25rem;
  padding-left: 0.85rem;
  text-align: left;
}

[dir="rtl"] .custom-select-display {
  padding-left: 2.25rem;
  padding-right: 0.85rem;
  text-align: right;
}

.custom-select-display:hover {
  border-color: var(--brand-secondary);
}

.custom-select-display.active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.custom-select-display .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1.1rem;
  color: var(--text-main);
  transition: transform 0.2s ease, color 0.2s ease;
}

[dir="ltr"] .custom-select-display .arrow {
  right: 12px;
  left: auto;
}

[dir="rtl"] .custom-select-display .arrow {
  left: 12px;
  right: auto;
}

.custom-select-wrapper.active .custom-select-display .arrow {
  transform: translateY(-50%) rotate(180deg);
  color: var(--brand-primary);
}

.custom-select-list {
  list-style: none;
  padding: 0;
  margin: 5px 0 0 0;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  /* show items, scrollable */
  overflow-y: auto;
  background: var(--white-accent);
  display: none;
  z-index: 1075 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.custom-select-list.show {
  display: block;
}

.custom-select-list li {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
  color: var(--text-main);
  background: var(--white-accent);
}

.custom-select-list li:last-child {
  border-bottom: none;
}

[dir="ltr"] .custom-select-list li {
  text-align: left;
}

[dir="rtl"] .custom-select-list li {
  text-align: right;
}

[dir="ltr"] .custom-select-list li:hover {
  background: var(--brand-light);
  color: var(--brand-primary);
  padding-left: 20px;
  padding-right: 15px;
}

[dir="rtl"] .custom-select-list li:hover {
  background: var(--brand-light);
  color: var(--brand-primary);
  padding-right: 20px;
  padding-left: 15px;
}

/* Modal overflow support for custom dropdowns */
.modal-content {
  overflow: visible !important;
}

.modal-header {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.modal-footer {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

/* End of custom select == */

/*==========================
Custom File Input Styling
==========================*/
.file-input-container {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: .375rem .75rem;
    background-color: var(--white-accent);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 50px;
}

.file-input-container:hover {
    border-color: var(--brand-secondary);
    background-image: linear-gradient(rgba(0,0,0,0.02), rgba(0,0,0,0.02));
}

.file-input-container.active, 
.file-input-container.has-file {
    border-color: var(--brand-primary);
}

.file-input-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.file-icon {
    font-size: 1.2rem;
    color: var(--brand-secondary);
    flex-shrink: 0;
}

.file-placeholder {
    color: #6c757d;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-name {
    color: var(--text-main);
    font-weight: 500;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visually-hidden-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
}

[dir="ltr"] .form-label {
    text-align: left;
    display: block;
}

[dir="rtl"] .form-label {
    text-align: right;
    display: block;
}

[dir="ltr"] .file-input-content {
    text-align: left;
}

[dir="rtl"] .file-input-content {
    text-align: right;
    flex-direction: row;
}

/* Spinner color */
.spinner-border-sm {
    --bs-spinner-border-width: 0.2em;
    border-color: rgba(255, 255, 255, 0.3) !important;
    border-right-color: white !important;
}


body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--brand-light);
  color: var(--text-main);
}

/* Navbar Styles */
.navbar {
  background-color: var(--white-accent) !important;
  border-bottom: 2px solid var(--brand-primary);
}

.navbar-brand {
  font-weight: bold;
  color: var(--brand-primary) !important;
  font-size: 1.5rem;
}

.navbar-brand:hover {
  color: var(--brand-secondary) !important;
}

.nav-link {
  color: var(--text-main);
  border-radius: 0.25rem;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--brand-light);
  color: var(--brand-primary);
}

/* Main Content */
.main-content {
  padding: 7px;
  min-height: calc(100vh - 56px);
}

/* Card Styles */
.card {
  border: none;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 8px;
}

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

.card-header {
  background-color: var(--brand-primary);
  color: var(--white-accent);
  border-radius: 8px 8px 0 0 !important;
}

/* Stat Cards */
.stat-card {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--white-accent) 0%, var(--brand-light) 100%);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  opacity: 0.8;
}

.stat-icon.text-primary {
  color: var(--brand-primary) !important;
}

.stat-icon.text-success {
  color: var(--brand-success) !important;
}

.stat-icon.text-warning {
  color: var(--brand-accent) !important;
}

.stat-icon.text-danger {
  color: var(--brand-danger) !important;
}

/* Button Styles */
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}

.btn-primary:hover {
  background-color: var(--brand-primary); /* Keep same base */
  background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)); /* Layer dark */
  border-color: rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)); /* Deepen layer */
  transform: translateY(0);
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:hover {
  background-color: var(--brand-primary);
  background-image: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.1)); /* Layer light */
  border-color: var(--brand-primary);
  color: white;
}

/* Nav Links & Items */
.nav-link:hover,
.nav-link.active {
  background-color: var(--brand-light);
  background-image: linear-gradient(rgba(0,0,0,0.03), rgba(0,0,0,0.03));
  color: var(--brand-primary);
}

.dropdown-item:hover {
  background-color: var(--brand-light);
  background-image: linear-gradient(rgba(0,0,0,0.02), rgba(0,0,0,0.02));
  color: var(--brand-primary);
}

[dir="ltr"] .custom-select-list li:hover {
  background-color: var(--brand-light);
  background-image: linear-gradient(rgba(0,0,0,0.02), rgba(0,0,0,0.02));
  color: var(--brand-primary);
  padding-left: 20px;
  padding-right: 15px;
}

[dir="rtl"] .custom-select-list li:hover {
  background-color: var(--brand-light);
  background-image: linear-gradient(rgba(0,0,0,0.02), rgba(0,0,0,0.02));
  color: var(--brand-primary);
  padding-right: 20px;
  padding-left: 15px;
}

/* Pagination Links */
.pagination-item.active .pagination-link {
  background-color: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pagination-link:hover {
  background-color: var(--brand-light);
  background-image: linear-gradient(rgba(0,0,0,0.03), rgba(0,0,0,0.03));
  color: var(--brand-primary);
  transform: translateY(-2px);
}

/* Sidebar Styles */
.sidebar {
  background-color: var(--white-accent);
  border-left: 1px solid var(--border-color);
  min-height: 100vh;
}

.sidebar h6 {
  color: var(--brand-primary);
  font-weight: 600;
}

/* Footer Styles */
footer {
  background-color: var(--brand-primary) !important;
  color: var(--white-accent) !important;
  border-top: none !important;
}

footer p {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Text Colors */
.text-primary {
  color: var(--brand-primary) !important;
}

/* Alerts */
.alert-primary {
  background-color: var(--brand-light);
  border-color: var(--brand-secondary);
  color: var(--brand-primary);
}

/* Table Styles */
.table thead th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
}

/* Floating Language Switcher */
.floating-language-switcher {
  position: fixed !important;
  bottom: 24px !important;
  z-index: 1060 !important;
}

[dir="rtl"] .floating-language-switcher {
  left: 24px !important;
  right: auto !important;
}

[dir="ltr"] .floating-language-switcher {
  right: 24px !important;
  left: auto !important;
}

.floating-language-switcher .lang-toggle {
  background: #ffffff !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 50px !important;
  padding: 8px 18px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: var(--brand-dark, #1e293b) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.25s ease !important;
}

.floating-language-switcher .lang-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
  border-color: var(--brand-primary, #0d6efd) !important;
  color: var(--brand-primary, #0d6efd) !important;
}

.floating-language-switcher .dropdown-menu {
  border-radius: 16px !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15) !important;
  padding: 8px !important;
  margin-bottom: 12px !important;
  min-width: 175px !important;
}

.floating-language-switcher .dropdown-item {
  color: #1e293b !important;
  background: transparent !important;
  font-weight: 500 !important;
  font-size: 0.88rem !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  transition: all 0.15s ease !important;
}

.floating-language-switcher .dropdown-item:hover {
  background-color: #f1f5f9 !important;
  color: var(--brand-primary, #0d6efd) !important;
}

.floating-language-switcher .dropdown-item.is-selected {
  background-color: rgba(13, 110, 253, 0.08) !important;
  color: var(--brand-primary, #0d6efd) !important;
  border-color: rgba(13, 110, 253, 0.18) !important;
}

.floating-language-switcher .dropdown-item.is-selected .lang-text {
  font-weight: 700 !important;
  color: var(--brand-primary, #0d6efd) !important;
}

.language-dropdown .lang-toggle {
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  border-color: var(--brand-secondary);
  color: var(--brand-primary);
  background: rgba(0, 0, 0, 0.05);
}

.language-dropdown .lang-toggle:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: var(--brand-primary);
}

.language-dropdown .dropdown-menu {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 140px;
}

[dir="ltr"] .language-dropdown .dropdown-menu {
  right: 0;
  left: auto;
}

[dir="rtl"] .language-dropdown .dropdown-menu {
  left: 0;
  right: auto;
}

/* Form Inputs RTL/LTR Support */
[dir="ltr"] .form-control {
  text-align: left;
}

[dir="rtl"] .form-control {
  text-align: right;
}

[dir="ltr"] .form-control::placeholder {
  text-align: left;
}

[dir="rtl"] .form-control::placeholder {
  text-align: right;
}

/* Input Group Alignment */
[dir="ltr"] .input-group-text {
    border-radius: 12px 0 0 12px;
}

[dir="rtl"] .input-group-text {
    border-radius: 0 12px 12px 0;
}

[dir="ltr"] .input-group .form-control {
    border-radius: 0 12px 12px 0;
}

[dir="rtl"] .input-group .form-control {
    border-radius: 12px 0 0 12px;
}

/* Password field internal support */
.password-field {
    position: relative;
}

[dir="ltr"] .password-field .form-control {
    padding-right: 50px;
    padding-left: 12px;
}

[dir="rtl"] .password-field .form-control {
    padding-left: 50px;
    padding-right: 12px;
}

.password-toggle {
    color: var(--brand-secondary);
    background: none;
    border: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

[dir="ltr"] .password-toggle {
    right: 15px;
}

[dir="rtl"] .password-toggle {
    left: 15px;
}

.password-toggle:hover {
    color: var(--brand-primary);
}


[dir="rtl"] .fa-chevron-left { transform: rotate(180deg); }
[dir="rtl"] .fa-chevron-right { transform: rotate(180deg); }

@media (max-width: 576px) {
  .pagination-list {
    gap: 4px;
  }
  .pagination-link {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.8rem;
  }
}

/* ==========================================
   Error List & Alert Feedback Styling
   (partials/errorList.html and global forms)
   ========================================== */

#errorContainer,
.error-container {
  width: 100%;
  margin-bottom: 1rem;
}

#errorList,
.error-list {
  list-style: none !important;
  list-style-type: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#errorList li,
.error-list li {
  list-style: none !important;
  list-style-type: none !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  margin-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s ease !important;
}

/* Alert Warning */
#errorList li.alert-warning,
.error-list li.alert-warning {
  background-color: #fffbeb !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
  border-inline-start: 4px solid #f59e0b !important;
}

#errorList li.alert-warning::before,
.error-list li.alert-warning::before {
  content: "\f071";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #d97706;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Alert Danger */
#errorList li.alert-danger,
.error-list li.alert-danger {
  background-color: #fef2f2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
  border-inline-start: 4px solid var(--brand-danger, #dc3545) !important;
}

#errorList li.alert-danger::before,
.error-list li.alert-danger::before {
  content: "\f06a";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #dc2626;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Alert Success */
#errorList li.alert-success,
.error-list li.alert-success {
  background-color: #f0fdf4 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
  border-inline-start: 4px solid var(--brand-success, #198754) !important;
}

#errorList li.alert-success::before,
.error-list li.alert-success::before {
  content: "\f058";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #16a34a;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Direction Rules */
[dir="rtl"] #errorList,
[dir="rtl"] .error-list,
[dir="rtl"] #errorList li,
[dir="rtl"] .error-list li {
  direction: rtl;
  text-align: right;
}

[dir="ltr"] #errorList,
[dir="ltr"] .error-list,
[dir="ltr"] #errorList li,
[dir="ltr"] .error-list li {
  direction: ltr;
  text-align: left;
}


