.unified-popup-overlay {
  position: fixed;
  inset: 0;
  top: var(--navbar-height);
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: unified-overlay-appear 0.2s ease-out;
}

@keyframes unified-overlay-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.unified-popup {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - var(--navbar-height) - 32px);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: unified-popup-appear 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes unified-popup-appear {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.unified-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #fafafa, #ffffff);
  flex-shrink: 0;
}

.unified-popup-header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.unified-popup-header-text h3 {
  margin: 0;
  font-family: "Bio Sans Bold", Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.unified-popup-header-text p {
  margin: 4px 0 0 0;
  font-family: "Bio Sans Regular", Arial, sans-serif;
  font-size: 14px;
  color: #6b7280;
}

.unified-popup-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unified-popup-close-btn,
.unified-popup-delete-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.unified-popup-close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.unified-popup-delete-btn {
  color: #ef4444;
}

.unified-popup-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.unified-popup-close-btn svg,
.unified-popup-delete-btn svg {
  width: 20px;
  height: 20px;
}

.unified-popup-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.unified-popup-content::-webkit-scrollbar {
  width: 8px;
}

.unified-popup-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.unified-popup-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.unified-popup-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.unified-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
  flex-shrink: 0;
}

.unified-popup-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: "Bio Sans Bold", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.unified-popup-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.unified-popup-btn-cancel {
  background: #6b7280;
  color: #ffffff;
}

.unified-popup-btn-cancel:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.unified-popup-btn-action {
  background: #22c55e;
  color: #ffffff;
}

.unified-popup-btn-action:hover:not(:disabled) {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.unified-popup-form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.unified-popup-form-section:last-child {
  margin-bottom: 0;
}

.unified-popup-label {
  display: block;
  font-family: "Bio Sans Bold", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}

.unified-popup-input,
.unified-popup-select,
.unified-popup-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-family: "Bio Sans Regular", Arial, sans-serif;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.unified-popup-input:focus,
.unified-popup-select:focus,
.unified-popup-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.unified-popup-input::placeholder {
  color: #9ca3af;
}

.unified-popup-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

@media (max-width: 640px) {
  .unified-popup {
    margin: 8px;
    max-width: calc(100vw - 16px);
  }

  .unified-popup-header {
    padding: 20px;
  }

  .unified-popup-header-content {
    gap: 12px;
  }

  .unified-popup-header-text h3 {
    font-size: 18px;
  }

  .unified-popup-content {
    padding: 20px;
    gap: 20px;
  }

  .unified-popup-footer {
    padding: 20px;
    flex-direction: column;
  }

  .unified-popup-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .unified-popup-header {
    padding: 16px;
  }

  .unified-popup-content {
    padding: 16px;
    gap: 16px;
  }

  .unified-popup-footer {
    padding: 16px;
  }
}

.alz-zone-alerts-page .unified-popup-overlay {
  top: var(--app-navbar-height);
}

.alz-zone-alerts-page .unified-popup {
  max-height: calc(100vh - var(--app-navbar-height) - 32px);
}

.group-zones-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.group-zones-list::-webkit-scrollbar {
  width: 5px;
}

.group-zones-list::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.group-zones-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.group-zones-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.group-zone-tag {
  padding: 9px 16px;
  border-radius: 24px;
  background: #dc2626;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.unified-popup-content .redraw-section {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.unified-popup-content .redraw-description {
  margin: 0 0 12px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.unified-popup-content .redraw-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  color: #f59e0b;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.unified-popup-content .redraw-btn:hover {
  background: #f59e0b;
  color: #ffffff;
  transform: translateY(-1px);
}

.unified-popup-content .drawing-method-selection {
  text-align: center;
}

.unified-popup-content .drawing-method-selection p {
  margin: 0 0 16px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 14px;
  color: #6b7280;
}

.unified-popup-content .drawing-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.unified-popup-content .method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  color: #1f2937;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.unified-popup-content .method-btn:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
}

.unified-popup-compact {
  max-width: 420px;
}

.unified-popup-compact .unified-popup-header {
  padding: 20px;
}

.unified-popup-compact .unified-popup-content {
  padding: 20px;
}

.unified-popup-compact .unified-popup-footer {
  padding: 20px;
}
.unified-select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.unified-popup-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  padding: 10px 40px 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #111827;

  cursor: pointer;
  transition: all 0.2s ease;
}

.unified-popup-select:hover:not(:disabled) {
  background-color: #f3f4f6;
}

.unified-popup-select:focus {
  outline: none;
  border-color: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.3);
}

.unified-popup-select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.unified-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border-right: 2px solid #374151;
  border-bottom: 2px solid #374151;
  pointer-events: none;
}
