/* Modern Profile Modal Styles */
  /* .modal-profile .modal-dialog { max-width: 400px; } -- removed to restore default size */
  .modal-profile .modal-content {
    background: #fff;
    color: #222;
    border-radius: 1.25rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.16);
    border: none;
    padding: -1.5rem 0 0.5rem 0;
    overflow: hidden;
  }
  .modal-profile .profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(90deg, #f8f9fb 60%, #e9f0fa 100%);
    padding: 2rem 1rem 1.5rem 1rem;
    border-bottom: 1px solid #e0e3e8;
    position: relative;
  }
  .modal-profile .profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
  }
  .modal-profile .profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid #e0e3e8;
    object-fit: cover;
    background: #f8f9fb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: block;
  }
  .modal-profile .profile-online-indicator {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border: 2px solid #e0e3e8;
    z-index: 2;
  }
  .modal-profile .profile-online-indicator .online-dot {
    width: 12px;
    height: 12px;
    background: #28c76f;
    border-radius: 50%;
    border: 2px solid #fff;
    display: block;
  }
  .modal-profile .profile-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .modal-profile .profile-role {
    font-size: 1.05rem;
    color: #4a5a6a;
    margin-bottom: 0.5rem;
  }
  .modal-profile .edit-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
  }
  .modal-profile .modal-body {
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    background: #fff;
  }
  .modal-profile .profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2.5rem;
    margin-bottom: 0.5rem;
  }
  .modal-profile .profile-details .detail-label {
    font-size: 0.98rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.4em;
  }
  .modal-profile .profile-details .detail-value {
    font-size: 1.05rem;
    color: #222;
    font-weight: 400;
    word-break: break-word;
  }
  .modal-profile .profile-divider {
    border-top: 1px solid #e0e3e8;
    margin: 1.5rem 0 1rem 0;
  }
  .modal-profile .profile-bio {
    font-size: 1.02rem;
    color: #3a3a3a;
    margin-bottom: 0.5rem;
    padding-left: 0.1rem;
  }
  .modal-profile .modal-footer {
    background: #f8f9fb;
    border-bottom-left-radius: 1.25rem;
    border-bottom-right-radius: 1.25rem;
    border-top: 1px solid #e0e3e8;
    padding: 1rem 2.5rem;
  }
  .modal-profile .form-label {
    color: #333;
    font-weight: 500;
  }
  .modal-profile .form-control,
  .modal-profile textarea.form-control {
    background: #f8f9fb;
    color: #222;
    border-radius: 0.5rem;
    border: 1px solid #e0e3e8;
    font-size: 1rem;
  }
  .modal-profile .btn-outline-primary {
    border-radius: 0.5rem;
  }
  @media (max-width: 768px) {
    .modal-profile .modal-body, .modal-profile .modal-footer {
      padding-left: 1rem;
      padding-right: 1rem;
    }
    .modal-profile .profile-details {
      grid-template-columns: 1fr;
      gap: 1rem 0;
    }
  }
  @media (max-width: 576px) {
    .modal-profile .modal-content {
      border-radius: 0.5rem;
    }
    .modal-profile .modal-header,
    .modal-profile .modal-footer {
      border-radius: 0.5rem 0.5rem 0 0;
    }
    .modal-profile .modal-body {
      padding: 1.2rem 0.5rem 1rem 0.5rem;
    }
  }

  .highlight-missing {
    border: 2px solid #dc3545 !important;
    background-color: #ffe6e6 !important;
    z-index: 9999 !important;
    position: relative;
  }

/* Profile Modal Custom Styles */
.modal-profile .modal-content {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-profile .modal-header {
  padding: 28px;
  min-height: 200px;
}

.modal-profile .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Avatar Styles */
.avatar-container {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.avatar-container:hover {
  transform: scale(1.05);
}

/* Card Styles */
.modal-profile .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-profile .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.modal-profile .card-header {
  border-radius: 12px 12px 0 0 !important;
}

/* Form Control Enhancements */
.modal-profile .form-control,
.modal-profile .form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-profile .form-control:focus,
.modal-profile .form-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Password Toggle Button */
.toggle-password {
  cursor: pointer;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: #007bff !important;
}

/* Action Buttons */
.modal-profile .btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.modal-profile .btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.modal-profile .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.modal-profile .btn-outline-secondary {
  border-width: 2px;
}

.modal-profile .btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #5a6268;
  color: white;
}

/* Info Display Cards */
.modal-profile .bg-light {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border: 1px solid #dee2e6;
}

/* Dark Mode Styles */
body.dark-mode .modal-profile .modal-content {
  background-color: #1a1a1a !important;
  border: 1px solid #333 !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
}

body.dark-mode .profile-header {
  background: linear-gradient(135deg, #1E325C 0%, #0f1419 100%) !important;
}

body.dark-mode .profile-header .text-white {
  color: #ffffff !important;
}

body.dark-mode .profile-header .opacity-75 {
  opacity: 0.8 !important;
}

body.dark-mode .profile-header .badge {
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}



body.dark-mode .profile-header .badge.bg-primary,
body.dark-mode .profile-header .badge.bg-primary.bg-opacity-90 {
  opacity: 1 !important;
}

body.dark-mode .profile-header .btn-light {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

body.dark-mode .profile-header .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

body.dark-mode .profile-header .btn-link {
  color: #ffffff !important;
  text-decoration: none !important;
}

body.dark-mode .profile-header .btn-link:hover {
  color: #e9ecef !important;
  text-decoration: none !important;
}

body.dark-mode .modal-profile .modal-body {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .card {
  background-color: #2a2a2a !important;
  border-color: #404040 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .card-header {
  background-color: #333 !important;
  border-color: #404040 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .card-header.bg-primary.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%) !important;
  border-color: rgba(13, 110, 253, 0.2) !important;
}

body.dark-mode .modal-profile .card-header.bg-success.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%) !important;
  border-color: rgba(25, 135, 84, 0.2) !important;
}

body.dark-mode .modal-profile .card-header.bg-info.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%) !important;
  border-color: rgba(13, 202, 240, 0.2) !important;
}

body.dark-mode .modal-profile .card-header.bg-warning.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%) !important;
  border-color: rgba(255, 193, 7, 0.2) !important;
}

body.dark-mode .modal-profile .card-body {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .form-control,
body.dark-mode .modal-profile .form-select {
  background-color: #333 !important;
  border-color: #555 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .form-control:focus,
body.dark-mode .modal-profile .form-select:focus {
  background-color: #333 !important;
  border-color: #1E325C !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.2rem rgba(30, 50, 92, 0.25) !important;
}

body.dark-mode .modal-profile .form-control::placeholder {
  color: #aaa !important;
}

body.dark-mode .modal-profile .form-label {
  color: #ffffff !important;
}

body.dark-mode .modal-profile .form-text {
  color: #ccc !important;
}

body.dark-mode .modal-profile .text-primary {
  color: #4dabf7 !important;
}

body.dark-mode .modal-profile .text-success {
  color: #51cf66 !important;
}

body.dark-mode .modal-profile .text-info {
  color: #74c0fc !important;
}

body.dark-mode .modal-profile .text-warning {
  color: #ffd43b !important;
}

body.dark-mode .modal-profile .text-secondary {
  color: #868e96 !important;
}

body.dark-mode .modal-profile .bg-light {
  background: linear-gradient(135deg, #333 0%, #2a2a2a 100%) !important;
  border-color: #404040 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .border {
  border-color: #404040 !important;
}

body.dark-mode .modal-profile .alert {
  background-color: #333 !important;
  border-color: #555 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .alert-warning {
  background-color: rgba(255, 193, 7, 0.1) !important;
  border-color: rgba(255, 193, 7, 0.3) !important;
  color: #ffd43b !important;
}

body.dark-mode .modal-profile .btn-outline-secondary {
  background-color: transparent !important;
  border-color: #666 !important;
  color: #ccc !important;
}

body.dark-mode .modal-profile .btn-outline-secondary:hover {
  background-color: #666 !important;
  border-color: #777 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .toggle-password {
  color: #ccc !important;
}

body.dark-mode .modal-profile .toggle-password:hover {
  color: #ffffff !important;
}

body.dark-mode .modal-profile .password-strength {
  color: #ccc !important;
}

body.dark-mode .modal-profile .modal-footer {
  background-color: #2a2a2a !important;
  border-color: #404040 !important;
  color: #ccc !important;
}

body.dark-mode .modal-profile .text-muted {
  color: #ccc !important;
}

/* Dark Mode Hover Effects */
body.dark-mode .modal-profile .card:hover {
  background-color: #2d2d2d !important;
  border-color: #555 !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

/* Dark Mode Focus States */
body.dark-mode .modal-profile .form-control:focus,
body.dark-mode .modal-profile .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(30, 50, 92, 0.25) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-profile .modal-dialog {
    margin: 0.5rem;
  }

  .modal-profile .modal-header {
    min-height: 180px;
    padding: 1rem;
  }

  .profile-header .d-flex {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 160px !important;
  }

  .profile-header .avatar-container {
    width: 80px !important;
    height: 80px !important;
    margin-bottom: 1rem;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .profile-header .position-relative {
    margin-right: 0 !important;
    margin-bottom: 1rem;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
  }

  .profile-header .flex-grow-1 {
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .profile-header .d-flex.align-items-center.mb-1 {
    justify-content: center !important;
    width: 100% !important;
  }

  .profile-header .d-flex.align-items-center.gap-2 {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .profile-header .btn-link {
    font-size: 1rem !important;
    margin-top: -0.2rem;
  }

  .modal-profile .modal-body {
    padding: 1rem;
  }

  .modal-profile .card-body {
    padding: 1rem;
  }

  .modal-profile .row.g-3 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 1rem;
  }

  .modal-profile .form-control,
  .modal-profile .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .modal-profile .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .modal-profile .d-flex.justify-content-end.gap-3 {
    flex-direction: column;
  }

  .modal-profile .d-flex.justify-content-end.gap-3 .btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .modal-profile .modal-xl {
    max-width: 95vw;
  }

  .modal-profile .modal-header {
    min-height: 180px;
  }

  .avatar-container {
    width: 80px !important;
    height: 80px !important;
  }

  .modal-profile h3 {
    font-size: 1.25rem;
  }

  .modal-profile .badge {
    font-size: 0.75rem;
  }

  .modal-profile .card-body .row .col-md-6 {
    margin-bottom: 1rem;
  }
}

/* Animation for form transitions */
#profileDetails,
#editProfileForm {
  transition: all 0.3s ease;
}

/* Highlight missing fields */
.highlight-missing {
  border: 2px solid #dc3545 !important;
  background-color: #ffe6e6 !important;
  z-index: 9999 !important;
  position: relative;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
/* Modern Profile Modal Styles */
  /* .modal-profile .modal-dialog { max-width: 400px; } -- removed to restore default size */
  .modal-profile .modal-content {
    background: #fff;
    color: #222;
    border-radius: 1.25rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.16);
    border: none;
    padding: -1.5rem 0 0.5rem 0;
    overflow: hidden;
  }
  .modal-profile .profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(90deg, #f8f9fb 60%, #e9f0fa 100%);
    padding: 2rem 1rem 1.5rem 1rem;
    border-bottom: 1px solid #e0e3e8;
    position: relative;
  }
  .modal-profile .profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
  }
  .modal-profile .profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid #e0e3e8;
    object-fit: cover;
    background: #f8f9fb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: block;
  }
  .modal-profile .profile-online-indicator {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border: 2px solid #e0e3e8;
    z-index: 2;
  }
  .modal-profile .profile-online-indicator .online-dot {
    width: 12px;
    height: 12px;
    background: #28c76f;
    border-radius: 50%;
    border: 2px solid #fff;
    display: block;
  }
  .modal-profile .profile-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .modal-profile .profile-role {
    font-size: 1.05rem;
    color: #4a5a6a;
    margin-bottom: 0.5rem;
  }
  .modal-profile .edit-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
  }
  .modal-profile .modal-body {
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    background: #fff;
  }
  .modal-profile .profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2.5rem;
    margin-bottom: 0.5rem;
  }
  .modal-profile .profile-details .detail-label {
    font-size: 0.98rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.4em;
  }
  .modal-profile .profile-details .detail-value {
    font-size: 1.05rem;
    color: #222;
    font-weight: 400;
    word-break: break-word;
  }
  .modal-profile .profile-divider {
    border-top: 1px solid #e0e3e8;
    margin: 1.5rem 0 1rem 0;
  }
  .modal-profile .profile-bio {
    font-size: 1.02rem;
    color: #3a3a3a;
    margin-bottom: 0.5rem;
    padding-left: 0.1rem;
  }
  .modal-profile .modal-footer {
    background: #f8f9fb;
    border-bottom-left-radius: 1.25rem;
    border-bottom-right-radius: 1.25rem;
    border-top: 1px solid #e0e3e8;
    padding: 1rem 2.5rem;
  }
  .modal-profile .form-label {
    color: #333;
    font-weight: 500;
  }
  .modal-profile .form-control,
  .modal-profile textarea.form-control {
    background: #f8f9fb;
    color: #222;
    border-radius: 0.5rem;
    border: 1px solid #e0e3e8;
    font-size: 1rem;
  }
  .modal-profile .btn-outline-primary {
    border-radius: 0.5rem;
  }
  @media (max-width: 768px) {
    .modal-profile .modal-body, .modal-profile .modal-footer {
      padding-left: 1rem;
      padding-right: 1rem;
    }
    .modal-profile .profile-details {
      grid-template-columns: 1fr;
      gap: 1rem 0;
    }
  }
  @media (max-width: 576px) {
    .modal-profile .modal-content {
      border-radius: 0.5rem;
    }
    .modal-profile .modal-header,
    .modal-profile .modal-footer {
      border-radius: 0.5rem 0.5rem 0 0;
    }
    .modal-profile .modal-body {
      padding: 1.2rem 0.5rem 1rem 0.5rem;
    }
  }

  .highlight-missing {
    border: 2px solid #dc3545 !important;
    background-color: #ffe6e6 !important;
    z-index: 9999 !important;
    position: relative;
  }

/* Profile Modal Custom Styles */
.modal-profile .modal-content {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-profile .modal-header {
  padding: 28px;
  min-height: 200px;
}

.modal-profile .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Avatar Styles */
.avatar-container {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.avatar-container:hover {
  transform: scale(1.05);
}

/* Card Styles */
.modal-profile .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-profile .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.modal-profile .card-header {
  border-radius: 12px 12px 0 0 !important;
}

/* Form Control Enhancements */
.modal-profile .form-control,
.modal-profile .form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-profile .form-control:focus,
.modal-profile .form-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Password Toggle Button */
.toggle-password {
  cursor: pointer;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: #007bff !important;
}

/* Action Buttons */
.modal-profile .btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.modal-profile .btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.modal-profile .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.modal-profile .btn-outline-secondary {
  border-width: 2px;
}

.modal-profile .btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #5a6268;
  color: white;
}

/* Info Display Cards */
.modal-profile .bg-light {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border: 1px solid #dee2e6;
}

/* Dark Mode Styles */
body.dark-mode .modal-profile .modal-content {
  background-color: #1a1a1a !important;
  border: 1px solid #333 !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
}

body.dark-mode .profile-header {
  background: linear-gradient(135deg, #1E325C 0%, #0f1419 100%) !important;
}

body.dark-mode .profile-header .text-white {
  color: #ffffff !important;
}

body.dark-mode .profile-header .opacity-75 {
  opacity: 0.8 !important;
}

body.dark-mode .profile-header .badge {
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}



body.dark-mode .profile-header .badge.bg-primary,
body.dark-mode .profile-header .badge.bg-primary.bg-opacity-90 {
  opacity: 1 !important;
}

body.dark-mode .profile-header .btn-light {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

body.dark-mode .profile-header .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

body.dark-mode .profile-header .btn-link {
  color: #ffffff !important;
  text-decoration: none !important;
}

body.dark-mode .profile-header .btn-link:hover {
  color: #e9ecef !important;
  text-decoration: none !important;
}

body.dark-mode .modal-profile .modal-body {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .card {
  background-color: #2a2a2a !important;
  border-color: #404040 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .card-header {
  background-color: #333 !important;
  border-color: #404040 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .card-header.bg-primary.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%) !important;
  border-color: rgba(13, 110, 253, 0.2) !important;
}

body.dark-mode .modal-profile .card-header.bg-success.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%) !important;
  border-color: rgba(25, 135, 84, 0.2) !important;
}

body.dark-mode .modal-profile .card-header.bg-info.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%) !important;
  border-color: rgba(13, 202, 240, 0.2) !important;
}

body.dark-mode .modal-profile .card-header.bg-warning.bg-opacity-10 {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%) !important;
  border-color: rgba(255, 193, 7, 0.2) !important;
}

body.dark-mode .modal-profile .card-body {
  background-color: #2a2a2a !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .form-control,
body.dark-mode .modal-profile .form-select {
  background-color: #333 !important;
  border-color: #555 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .form-control:focus,
body.dark-mode .modal-profile .form-select:focus {
  background-color: #333 !important;
  border-color: #1E325C !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.2rem rgba(30, 50, 92, 0.25) !important;
}

body.dark-mode .modal-profile .form-control::placeholder {
  color: #aaa !important;
}

body.dark-mode .modal-profile .form-label {
  color: #ffffff !important;
}

body.dark-mode .modal-profile .form-text {
  color: #ccc !important;
}

body.dark-mode .modal-profile .text-primary {
  color: #4dabf7 !important;
}

body.dark-mode .modal-profile .text-success {
  color: #51cf66 !important;
}

body.dark-mode .modal-profile .text-info {
  color: #74c0fc !important;
}

body.dark-mode .modal-profile .text-warning {
  color: #ffd43b !important;
}

body.dark-mode .modal-profile .text-secondary {
  color: #868e96 !important;
}

body.dark-mode .modal-profile .bg-light {
  background: linear-gradient(135deg, #333 0%, #2a2a2a 100%) !important;
  border-color: #404040 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .border {
  border-color: #404040 !important;
}

body.dark-mode .modal-profile .alert {
  background-color: #333 !important;
  border-color: #555 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .alert-warning {
  background-color: rgba(255, 193, 7, 0.1) !important;
  border-color: rgba(255, 193, 7, 0.3) !important;
  color: #ffd43b !important;
}

body.dark-mode .modal-profile .btn-outline-secondary {
  background-color: transparent !important;
  border-color: #666 !important;
  color: #ccc !important;
}

body.dark-mode .modal-profile .btn-outline-secondary:hover {
  background-color: #666 !important;
  border-color: #777 !important;
  color: #ffffff !important;
}

body.dark-mode .modal-profile .toggle-password {
  color: #ccc !important;
}

body.dark-mode .modal-profile .toggle-password:hover {
  color: #ffffff !important;
}

body.dark-mode .modal-profile .password-strength {
  color: #ccc !important;
}

body.dark-mode .modal-profile .modal-footer {
  background-color: #2a2a2a !important;
  border-color: #404040 !important;
  color: #ccc !important;
}

body.dark-mode .modal-profile .text-muted {
  color: #ccc !important;
}

/* Dark Mode Hover Effects */
body.dark-mode .modal-profile .card:hover {
  background-color: #2d2d2d !important;
  border-color: #555 !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

/* Dark Mode Focus States */
body.dark-mode .modal-profile .form-control:focus,
body.dark-mode .modal-profile .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(30, 50, 92, 0.25) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-profile .modal-dialog {
    margin: 0.5rem;
  }

  .modal-profile .modal-header {
    min-height: 180px;
    padding: 1rem;
  }

  .profile-header .d-flex {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 160px !important;
  }

  .profile-header .avatar-container {
    width: 80px !important;
    height: 80px !important;
    margin-bottom: 1rem;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .profile-header .position-relative {
    margin-right: 0 !important;
    margin-bottom: 1rem;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
  }

  .profile-header .flex-grow-1 {
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .profile-header .d-flex.align-items-center.mb-1 {
    justify-content: center !important;
    width: 100% !important;
  }

  .profile-header .d-flex.align-items-center.gap-2 {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .profile-header .btn-link {
    font-size: 1rem !important;
    margin-top: -0.2rem;
  }

  .modal-profile .modal-body {
    padding: 1rem;
  }

  .modal-profile .card-body {
    padding: 1rem;
  }

  .modal-profile .row.g-3 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 1rem;
  }

  .modal-profile .form-control,
  .modal-profile .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .modal-profile .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .modal-profile .d-flex.justify-content-end.gap-3 {
    flex-direction: column;
  }

  .modal-profile .d-flex.justify-content-end.gap-3 .btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .modal-profile .modal-xl {
    max-width: 95vw;
  }

  .modal-profile .modal-header {
    min-height: 180px;
  }

  .avatar-container {
    width: 80px !important;
    height: 80px !important;
  }

  .modal-profile h3 {
    font-size: 1.25rem;
  }

  .modal-profile .badge {
    font-size: 0.75rem;
  }

  .modal-profile .card-body .row .col-md-6 {
    margin-bottom: 1rem;
  }
}

/* Animation for form transitions */
#profileDetails,
#editProfileForm {
  transition: all 0.3s ease;
}

/* Highlight missing fields */
.highlight-missing {
  border: 2px solid #dc3545 !important;
  background-color: #ffe6e6 !important;
  z-index: 9999 !important;
  position: relative;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
/* Select2 container should match Bootstrap width */
.select2-container {
  width: 100% !important;
}

/* Closed select */
.select2-container--default .select2-selection--single {
  height: calc(2.25rem + 2px);
  min-height: 38px;
  border: 1px solid #ced4da !important;
  border-radius: 0.375rem !important;
  background-color: #fff !important;
  color: #212529 !important;
  display: flex !important;
  align-items: center;
  padding: 0 0.75rem;
  box-shadow: none !important;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

/* Rendered text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #212529 !important;
  line-height: normal !important;
  padding-left: 0 !important;
  padding-right: 1.75rem !important;
}

/* Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100% !important;
  right: 10px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #6c757d transparent transparent transparent !important;
}

/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #6c757d !important;
}

/* Focus state */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #86b7fe !important;
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25) !important;
}

/* Disabled */
.select2-container--default.select2-container--disabled .select2-selection--single {
  background-color: #e9ecef !important;
  cursor: not-allowed;
  opacity: 1;
}

/* Dropdown */
.select2-dropdown {
  border: 1px solid #ced4da !important;
  border-radius: 0.5rem !important;
  overflow: hidden;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
  background: #fff !important;
}

/* Search box */
.select2-container--default .select2-search--dropdown {
  padding: 0.5rem;
  background: #fff;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #ced4da !important;
  border-radius: 0.375rem !important;
  padding: 0.5rem 0.75rem !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Results */
.select2-results__option {
  padding: 0.55rem 0.75rem !important;
  font-size: 0.95rem;
}

/* Hover */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #192A4D !important;
  color: #fff !important;
}

/* Selected item in dropdown */
.select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: rgba(25, 42, 77, 0.08) !important;
  color: #192A4D !important;
  font-weight: 600;
}

/* Clear button */
.select2-container--default .select2-selection--single .select2-selection__clear {
  color: #6c757d;
  margin-right: 0.5rem;
}

/* Open dropdown above modal content */
.select2-container--open {
  z-index: 2500 !important;
}

.select2-dropdown {
  z-index: 2501 !important;
}
body.dark-mode .modal-profile .select2-container--default .select2-selection--single {
  background-color: #333 !important;
  border-color: #555 !important;
  color: #fff !important;
}

body.dark-mode .modal-profile .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #fff !important;
}

body.dark-mode .modal-profile .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #aaa !important;
}

body.dark-mode .modal-profile .select2-dropdown {
  background-color: #2a2a2a !important;
  border-color: #555 !important;
}

body.dark-mode .modal-profile .select2-container--default .select2-search--dropdown {
  background-color: #2a2a2a !important;
}

body.dark-mode .modal-profile .select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: #333 !important;
  border-color: #555 !important;
  color: #fff !important;
}

body.dark-mode .modal-profile .select2-results__option {
  background-color: #2a2a2a !important;
  color: #fff !important;
}

body.dark-mode .modal-profile .select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: rgba(77, 171, 247, 0.12) !important;
  color: #74c0fc !important;
}

body.dark-mode .modal-profile .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #1E325C !important;
  color: #fff !important;
}