.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-secondary, #1a1f2a);
  margin: 5% auto;
  padding: 0;
  border: 1px solid var(--border-color, #2a3344);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 25px;
  background: linear-gradient(135deg, var(--accent, #6aa0ff) 0%, rgba(106, 160, 255, 0.8) 100%);
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: white;
  font-size: 1.4rem;
  font-weight: 600;
}

.modal-close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
  transition: transform 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
  transform: rotate(90deg);
}

.modal-body {
  padding: 25px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary, #0e141f);
  border: 1px solid var(--border-color, #2a3344);
  border-radius: 8px;
  color: var(--text-primary, #ffffff);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: var(--accent, #6aa0ff);
  box-shadow: 0 0 0 3px rgba(106, 160, 255, 0.1);
}

.modal-body textarea {
  min-height: 80px;
  resize: vertical;
}

.modal-body .grid-double {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.modal-body .grid-single {
  display: grid;
  gap: 15px;
}

.modal-footer {
  padding: 20px 25px;
  background: var(--bg-primary, #0e141f);
  border-top: 1px solid var(--border-color, #2a3344);
  border-radius: 0 0 12px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-footer button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-footer .save-btn {
  background: var(--accent, #6aa0ff);
  color: white;
}

.modal-footer .save-btn:hover {
  background: #5890ef;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(106, 160, 255, 0.3);
}

.modal-footer .delete-btn {
  background: #ff4444;
  color: white;
}

.modal-footer .delete-btn:hover {
  background: #e63939;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

.modal-footer .cancel-btn {
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  border: 1px solid var(--border-color, #2a3344);
}

.modal-footer .cancel-btn:hover {
  background: var(--bg-secondary, #1a1f2a);
  color: var(--text-primary, #ffffff);
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 2% auto;
  }
  
  .modal-body .grid-double {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    max-height: 70vh;
  }
}
