/* Enhanced Alert Dialog System */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.dialog-overlay.show {
  opacity: 1;
  visibility: visible;
}

.dialog-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  margin: 20px;
  transform: translateY(-20px) scale(0.95);
  transition: all 0.3s ease;
}

.dialog-overlay.show .dialog-container {
  transform: translateY(0) scale(1);
}

.dialog-header {
  padding: 24px 24px 0 24px;
  text-align: center;
}

.dialog-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.dialog-icon.success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.dialog-icon.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.dialog-icon.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.dialog-icon.info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.dialog-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.dialog-message {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 24px;
}

.dialog-actions {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.dialog-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.dialog-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.dialog-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.dialog-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.dialog-btn-secondary:hover {
  background: #e5e7eb;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  max-width: 400px;
}

.toast {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(100%);
  transition: all 0.3s ease;
  border-left: 4px solid;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left-color: #10b981;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.info {
  border-left-color: #3b82f6;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

.toast-icon.success {
  background: #10b981;
}

.toast-icon.error {
  background: #ef4444;
}

.toast-icon.warning {
  background: #f59e0b;
}

.toast-icon.info {
  background: #3b82f6;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
  margin-bottom: 4px;
}

.toast-message {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex: 0 0 auto;
}

.toast-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Loading Dialog */
.loading-dialog .dialog-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  position: relative;
  overflow: hidden;
}

.loading-dialog .dialog-icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Extra Small Screens (480px and below) */
@media (max-width: 480px) {
  .dialog-overlay {
    padding: 1rem;
  }

  .dialog-container {
    margin: 0;
    max-width: 100%;
    width: calc(100% - 1rem);
    border-radius: 12px;
  }

  .dialog-header {
    padding: 1.25rem 1rem 0 1rem;
  }

  .dialog-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin: 0 auto 12px;
  }

  .dialog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .dialog-message {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 1.25rem;
    padding: 0 0.5rem;
  }

  .dialog-actions {
    padding: 0 1rem 1.25rem;
    flex-direction: column;
    gap: 8px;
  }

  .dialog-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    min-height: 40px;
  }

  .toast-container {
    right: 8px;
    left: 8px;
    top: 12px;
    max-width: calc(100% - 16px);
  }

  .toast {
    margin-bottom: 8px;
    padding: 12px;
    border-radius: 8px;
    gap: 8px;
  }

  .toast-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .toast-content {
    min-width: 0;
  }

  .toast-title {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .toast-message {
    font-size: 11px;
    line-height: 1.3;
  }

  .toast-close {
    padding: 0;
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
    font-size: 0.8rem;
    line-height: 1;
  }
}

/* Small Screens (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .dialog-container {
    margin: 12px;
    max-width: 100%;
    width: calc(100% - 24px);
    border-radius: 14px;
  }

  .dialog-header {
    padding: 20px 18px 0 18px;
  }

  .dialog-icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
    margin: 0 auto 14px;
  }

  .dialog-title {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 7px;
  }

  .dialog-message {
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 18px;
  }

  .dialog-actions {
    padding: 0 18px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .dialog-btn {
    width: 100%;
    padding: 11px 20px;
    font-size: 14px;
    min-height: 42px;
  }

  .toast-container {
    right: 12px;
    left: 12px;
    top: 16px;
    max-width: calc(100% - 24px);
  }

  .toast {
    margin-bottom: 10px;
    padding: 13px;
    border-radius: 10px;
    gap: 10px;
  }

  .toast-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .toast-title {
    font-size: 13px;
    margin-bottom: 3px;
  }

  .toast-message {
    font-size: 12px;
    line-height: 1.35;
  }

  .toast-close {
    padding: 0;
    min-width: 26px;
    min-height: 26px;
    width: 26px;
    height: 26px;
    margin: 0;
    flex-shrink: 0;
    font-size: 0.9rem;
    line-height: 1;
  }
}

/* Medium Screens (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .dialog-container {
    margin: 16px;
    max-width: 420px;
    width: calc(100% - 32px);
    border-radius: 15px;
  }

  .dialog-header {
    padding: 22px 22px 0 22px;
  }

  .dialog-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
    margin: 0 auto 15px;
  }

  .dialog-title {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 8px;
  }

  .dialog-message {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  .dialog-actions {
    padding: 0 22px 22px;
    flex-direction: row;
    gap: 12px;
  }

  .dialog-btn {
    flex: 1;
    padding: 11px 22px;
    font-size: 14px;
    min-height: 42px;
  }

  .toast-container {
    right: 16px;
    left: auto;
    top: 20px;
    max-width: 400px;
  }

  .toast {
    margin-bottom: 11px;
    padding: 14px;
    border-radius: 11px;
    gap: 11px;
  }

  .toast-icon {
    width: 31px;
    height: 31px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .toast-title {
    font-size: 13px;
    margin-bottom: 3px;
  }

  .toast-message {
    font-size: 12px;
    line-height: 1.4;
  }

  .toast-close {
    padding: 0;
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    margin: 0;
    flex-shrink: 0;
    line-height: 1;
  }
}

/* Large Screens (1025px and above) */
@media (min-width: 1025px) {
  .dialog-container {
    margin: 20px;
    max-width: 450px;
    width: calc(100% - 40px);
  }

  .dialog-header {
    padding: 24px 24px 0 24px;
  }

  .dialog-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
    margin: 0 auto 16px;
  }

  .dialog-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
  }

  .dialog-message {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
  }

  .dialog-actions {
    padding: 0 24px 24px;
    flex-direction: row;
    gap: 12px;
  }

  .dialog-btn {
    padding: 12px 24px;
    font-size: 14px;
    min-height: 44px;
  }

  .toast-container {
    right: 20px;
    left: auto;
    top: 20px;
    max-width: 400px;
  }

  .toast {
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 12px;
    gap: 12px;
  }

  .toast-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .toast-title {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .toast-message {
    font-size: 13px;
    line-height: 1.4;
  }

  .toast-close {
    padding: 0;
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    margin: 0;
    flex-shrink: 0;
  }
}
