/* ===================================
   MODALS CSS
   Styles for modal forms and dialogs
   =================================== */

/* Modal Content Styling */
.modal-content {
  background-color: #212529;
  border: 1px solid #495057;
  border-radius: 8px;
}

.modal-header {
  background-color: #343a40;
  border-bottom: 1px solid #495057;
  border-radius: 8px 8px 0 0;
}

.modal-footer {
  background-color: #343a40;
  border-top: 1px solid #495057;
  border-radius: 0 0 8px 8px;
}

.modal-title {
  color: #fff;
  font-weight: 600;
}

/* Modal Form Elements */
.modal-body {
  color: #fff;
}

.modal-body .form-label {
  color: #fff;
  font-weight: 500;
}

.modal-body .form-control {
  background-color: #343a40;
  border: 1px solid #495057;
  color: #fff;
}

.modal-body .form-control:focus {
  background-color: #343a40;
  border-color: #0d6efd;
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.modal-body .form-select {
  background-color: #343a40;
  border: 1px solid #495057;
  color: #fff;
}

.modal-body .form-select:focus {
  background-color: #343a40;
  border-color: #0d6efd;
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Modal Buttons */
.modal .btn-close {
  filter: invert(1) brightness(100);
}

.modal .btn-close:hover {
  filter: invert(1) brightness(80);
}

/* File Upload Styling */
.file-upload-container,
.file-upload-area {
  border: 2px dashed #495057;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.file-upload-container:hover,
.file-upload-area:hover {
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
}

.file-upload-container.dragover,
.file-upload-area.dragover {
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.2);
}

.file-upload-area.file-selected {
  border-color: #28a745 !important;
  background-color: rgba(40, 167, 69, 0.1) !important;
}

/* Modal Alert Styling */
.modal .alert {
  background-color: #343a40;
  border: 1px solid #495057;
  color: #fff;
}

.modal .alert-warning {
  background-color: #664d03;
  border-color: #ffc107;
  color: #fff;
}

.modal .alert-info {
  background-color: #055160;
  border-color: #0dcaf0;
  color: #fff;
}

.modal .alert-danger {
  background-color: #842029;
  border-color: #dc3545;
  color: #fff;
}

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

  .modal-content {
    border-radius: 6px;
  }

  .modal-header {
    border-radius: 6px 6px 0 0;
  }

  .modal-footer {
    border-radius: 0 0 6px 6px;
  }
}

/* Modal Animation */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

/* Form Control Enhancements */
.modal-body .form-control::placeholder {
  color: #6c757d !important;
}

.modal-body .form-label {
  margin-bottom: 0;
}

/* Datetime Picker Styling */
.modal-body input[type="datetime-local"] {
  color-scheme: dark;
}

.modal-body input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.modal-body input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Input Group Styling */
.modal-body .input-group .btn {
  border-left: 1px solid #495057;
}

.modal-body .input-group .btn:hover {
  background-color: #495057;
  border-color: #6c757d;
}

/* Modal Responsive Form Layout */
@media (max-width: 767.98px) {
  .modal-body .row.mb-3 {
    flex-direction: column;
    align-items: stretch !important;
  }

  .modal-body .col-md-5,
  .modal-body .col-md-7 {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .modal-body .col-md-5 {
    margin-bottom: 0.25rem;
  }
}

/* Form Select Styling */
.modal-body .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.modal-body .form-select:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
}
