/* Region Selector Modal */
.zurimed-region-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
}

.zurimed-region-modal.is-active {
  display: flex;
}

.zurimed-region-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.zurimed-region-modal__content {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: 12px;
  padding: 3rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zurimed-region-modal__content.shake {
  animation: modalShake 0.5s ease-out;
}

@keyframes modalShake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.zurimed-region-modal__header {
  text-align: center;
  margin-bottom: 2rem;
}

.zurimed-region-modal__header h2 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  color: #1a1a1a;
}

.zurimed-region-modal__header p {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

.zurimed-region-modal__regions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 600px) {
  .zurimed-region-modal__regions {
    grid-template-columns: 1fr;
  }
}

.zurimed-region-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.zurimed-region-button:hover {
  border-color: #0066cc;
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.zurimed-region-button:active {
  transform: translateY(0);
}

.zurimed-region-button.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.zurimed-region-button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid #0066cc;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.zurimed-region-button__flag {
  font-size: 4rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.zurimed-region-button__content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: #1a1a1a;
}

.zurimed-region-button__content p {
  margin: 0;
  font-size: 0.875rem;
  color: #666;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.zurimed-region-modal__notice {
  margin: 0;
  font-size: 0.75rem;
  color: #999;
  line-height: 1.5;
}

/* Prevent body scroll when modal is open */
body.region-modal-open {
  overflow: hidden;
}

/* ============================================
   Toast Notification
   ============================================ */

.zurimed-region-toast {
  position: fixed;
  top: calc(128px + var(--wp-admin--admin-bar--height, 0px));
  right: 20px;
  z-index: 999998;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 1rem 1.5rem;
  max-width: 400px;
  width: 90%;
  opacity: 0;
  transform: translateX(450px);
  transition: all 0.3s ease-out;
  border-left: 4px solid #0066cc;
}

.zurimed-region-toast.is-scrolled {
  top: calc(20px + var(--wp-admin--admin-bar--height, 0px));
}

.zurimed-region-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.zurimed-region-toast.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.zurimed-region-toast__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.zurimed-region-toast__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.zurimed-region-toast__text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.zurimed-region-toast__text strong {
  color: #1a1a1a;
  font-size: 0.9375rem;
  font-weight: 600;
}

.zurimed-region-toast__text span {
  color: #666;
}

.zurimed-region-toast__actions {
  display: flex;
  gap: 0.5rem;
}

.zurimed-region-toast__button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}

.zurimed-region-toast__button--primary {
  background: #0066cc;
  color: white;
}

.zurimed-region-toast__button--primary:hover {
  background: #0052a3;
}

.zurimed-region-toast__button--secondary {
  background: #f5f5f5;
  color: #666;
}

.zurimed-region-toast__button--secondary:hover {
  background: #e8e8e8;
  color: #333;
}

.zurimed-region-toast__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0.25rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.zurimed-region-toast__close:hover {
  color: #333;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .zurimed-region-toast {
    /* Start below header when at top of page */
    top: calc(100px + var(--wp-admin--admin-bar--height, 0px));
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    transform: translateY(-100px);
  }

  /* Move to fixed top position when scrolled down */
  .zurimed-region-toast.is-scrolled {
    top: 10px;
  }

  .zurimed-region-toast.is-visible {
    transform: translateY(0);
  }

  .zurimed-region-toast__actions {
    flex-direction: column;
  }

  .zurimed-region-toast__button {
    width: 100%;
  }
}
