/* Modern Modal Styles */
.modal {
  z-index: 1055;
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

/* Modern Modal Dialog */
.modal-dialog {
  margin: 15px auto;
  transition: all 0.3s ease;
}

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

.modal.in .modal-dialog {
  transform: translate(0, 0);
}

/* Modern Modal Content */
.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  background: #ffffff;
}

/* Modern Modal Header */
.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 25px 15px;
  border-bottom: none;
  position: relative;
}

.modal-header h4 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.modal-header .close {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  opacity: 0.8;
  font-size: 24px;
  font-weight: 300;
  text-shadow: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-header .close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

/* Modern Modal Body */
.modal-body {
  padding: 25px;
  background: #fafbfc;
  max-height: 70vh;
  overflow-y: auto;
}

/* Compact Form Styling */
.modal-body .row {
  margin-bottom: 15px;
}

.modal-body .form-group {
  margin-bottom: 15px;
}

.modal-body .box-body {
  padding: 0;
}

.modal-body label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
  display: block;
}

.modal-body .form-control {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
  height: auto;
  min-height: 36px;
}

.modal-body .form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.modal-body .select2-container {
  width: 100% !important;
}

.modal-body .select2-container--default .select2-selection--single {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  height: 36px;
  line-height: 36px;
  padding: 0 12px;
}

.modal-body .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #374151;
  font-size: 14px;
  line-height: 34px;
  padding: 0;
}

.modal-body .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 34px;
}

/* Section Headers */
.section-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 10px 15px;
  margin: 20px -25px 15px;
  border-left: 4px solid #3b82f6;
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-header i {
  margin-right: 8px;
  color: #3b82f6;
}

/* Modern Modal Footer */
.modal-footer {
  background: white;
  padding: 20px 25px;
  border-top: 1px solid #e5e7eb;
  text-align: right;
}

.modal-footer .btn {
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  margin-left: 10px;
  transition: all 0.2s ease;
  border: none;
  min-width: 80px;
}

.modal-footer .btn-warning {
  background: #f59e0b;
  color: white;
}

.modal-footer .btn-warning:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
}

.modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Compact Layout for Small Modals */
.modal-sm .modal-content {
  border-radius: 10px;
}

.modal-sm .modal-header {
  padding: 15px 20px 10px;
}

.modal-sm .modal-header h4 {
  font-size: 18px;
}

.modal-sm .modal-body {
  padding: 20px;
}

.modal-sm .modal-footer {
  padding: 15px 20px;
}

/* Choice Buttons for Item/Service Modal */
.choice-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 16px;
  width: 100%;
  margin-bottom: 15px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.choice-btn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(139, 92, 246, 0.3);
  color: white;
}

.choice-btn i {
  margin-right: 10px;
  font-size: 18px;
}

/* Compact grid layout */
.modal-body .col-md-3,
.modal-body .col-md-4,
.modal-body .col-md-6 {
  padding-left: 8px;
  padding-right: 8px;
}

/* Tighter row spacing in compact mode */
.modal-lg .modal-body .row {
  margin-bottom: 12px;
}

.modal-lg .modal-body .form-group {
  margin-bottom: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px;
  }
  
  .modal-body {
    padding: 20px 15px;
  }
  
  .modal-header {
    padding: 15px 20px 10px;
  }
  
  .modal-footer {
    padding: 15px 20px;
  }
  
  .section-header {
    margin: 15px -15px 10px;
  }
  
  .modal-body .col-md-3,
  .modal-body .col-md-4,
  .modal-body .col-md-6 {
    padding-left: 5px;
    padding-right: 5px;
  }
}

/* Error message styling */
.text-danger {
  font-size: 12px;
  font-weight: 500;
}

/* Required field indicator */
.text-danger {
  color: #ef4444 !important;
}

/* Checkbox styling */
.modal-body .checkbox {
  margin-top: 10px;
  margin-bottom: 10px;
}

.modal-body .checkbox label {
  font-weight: 500;
  color: #4b5563;
}

.modal-body .checkbox-inline {
  font-weight: 500;
  color: #4b5563;
  font-size: 13px;
}

/* File input styling */
input[type="file"] {
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  padding: 15px;
  background: #f9fafb;
  width: 100%;
  transition: all 0.2s ease;
}

input[type="file"]:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* Textarea styling */
textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Loading state */
.modal-loading {
  position: relative;
}

.modal-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
  border-radius: 12px;
}

/* Animation for modal appearance */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal.fade.in .modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

/* Professional form enhancements */
.form-control::-webkit-input-placeholder {
  color: #9ca3af;
  font-style: italic;
}

.form-control::-moz-placeholder {
  color: #9ca3af;
  font-style: italic;
}

.form-control:-ms-input-placeholder {
  color: #9ca3af;
  font-style: italic;
}

.form-control::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* Professional focus states */
.form-control:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Modern scrollbar for modal body */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

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