.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
  opacity: 0;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
}

.modal-content {
  position: relative;
  background: #1e293b;
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  z-index: 10000;
  border: 1px solid #334155;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #334155;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e5e7eb;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background-color: #334155;
  color: #d1d5db;
}

.modal-close:active {
  transform: scale(0.95);
}

.modal-body {
  margin-bottom: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body p {
  color: #d1d5db;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
}

.modal-footer .btn {
  min-width: 100px;
}

.modal-body .form-group {
  margin-bottom: 1.25rem;
}

.modal-body .form-group:last-child {
  margin-bottom: 0;
}

.modal-body .form-group label {
  display: block;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 0.5rem;
}

.modal-body .form-group input[type="text"],
.modal-body .form-group input[type="date"],
.modal-body .form-group input[type="email"],
.modal-body .form-group textarea,
.modal-body .form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #475569;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
  background-color: #0f172a;
  color: #e5e7eb;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus,
.modal-body .form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-color: #1e293b;
}

.modal-body .form-group input::placeholder,
.modal-body .form-group textarea::placeholder {
  color: #64748b;
}

.modal-body .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-content.modal-sm {
  max-width: 400px;
}

.modal-content.modal-lg {
  max-width: 800px;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
}

.modal-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: #0f172a;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.modal.active .modal-overlay {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.modal-open {
  overflow: hidden;
}

.modal-content.loading {
  opacity: 0.6;
  pointer-events: none;
}

.modal-content.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #334155;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.modal-enter {
  opacity: 0;
}

.modal-enter-active {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.modal-exit {
  opacity: 1;
}

.modal-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
