.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  width: 90%;
  max-width: 480px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  line-height: 1;
  color: #a0aec0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #4a5568;
  background-color: #f7fafc;
}

.modal-content {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.modal-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background-size: contain;
  background-repeat: no-repeat;
}

.modal-message {
  flex-grow: 1;
  font-size: 16px;
  line-height: 1.5;
  color: #4a5568;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-info .modal-icon {
  color: #3182ce;
}

.modal-icon-info {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%233182ce' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");
}

.modal-success .modal-icon {
  color: #38a169;
}

.modal-icon-success {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%2338a169' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.modal-error .modal-icon {
  color: #e53e3e;
}

.modal-icon-error {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23e53e3e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

.modal-confirm .modal-icon {
  color: #4c51bf;
}

.modal-icon-confirm {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%234c51bf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");
}

.modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  padding: 10px 18px;
  font-size: 15px;
  border-radius: 12px;
  transition: all 0.2s ease;
  text-decoration: none;
  letter-spacing: 0.01em;
  min-width: 100px;
  border: none;
}

.modal .btn-info {
  background-color: #3182ce;
  color: white;
  box-shadow: 0 1px 3px rgba(49, 130, 206, 0.2);
}

.modal .btn-info:hover {
  background-color: #2b6cb0;
  box-shadow: 0 2px 4px rgba(49, 130, 206, 0.3);
}

.modal .btn-success {
  background-color: #38a169;
  color: white;
  box-shadow: 0 1px 3px rgba(56, 161, 105, 0.2);
}

.modal .btn-success:hover {
  background-color: #2f855a;
  box-shadow: 0 2px 4px rgba(56, 161, 105, 0.3);
}

.modal .btn-error {
  background-color: #e53e3e;
  color: white;
  box-shadow: 0 1px 3px rgba(229, 62, 62, 0.2);
}

.modal .btn-error:hover {
  background-color: #c53030;
  box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

.modal .btn-confirm {
  background-color: #4c51bf;
  color: white;
  box-shadow: 0 1px 3px rgba(76, 81, 191, 0.2);
}

.modal .btn-confirm:hover {
  background-color: #434190;
  box-shadow: 0 2px 4px rgba(76, 81, 191, 0.3);
}

.modal .btn-secondary {
  background-color: #f7fafc;
  color: #4a5568;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.modal .btn-secondary:hover {
  background-color: #edf2f7;
  color: #2d3748;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 576px) {
  .modal {
    width: 95%;
    max-width: none;
    border-radius: 12px;
  }
  
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  
  .modal-footer .btn {
    width: 100%;
    padding: 12px;
  }
}

.modal-overlay:focus {
  outline: none;
}

.modal-close:focus,
.modal .btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}
