/* 
  Tailwind UI Modal Custom Implementation
  Mimics 'Centered with wide buttons' & 'Centered with single action' from tailwindcss.com
*/

/* Backdrop */
.tw-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  opacity: 0;
  visibility: hidden;
  z-index: 9999;
  pointer-events: none;
}

.tw-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Wrapper */
.tw-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  visibility: hidden;
}

.tw-modal-wrapper.is-open {
  pointer-events: auto;
  visibility: visible;
}

/* Force hide all descendants when not open */
.tw-modal-wrapper:not(.is-open) * {
  pointer-events: none !important;
}

/* Modal Panel */
.tw-modal-panel {
  position: relative;
  width: 100%;
  max-width: 450px;
  background-color: #ffffff; /* Modal background is now white */
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* Adjusted shadow for light theme */
  text-align: center;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease-out;
}

/* Panel Theme Modifiers */
.tw-theme-orange {
  border: 1px solid var(--color-orange);
}
.tw-theme-green {
  border: 1px solid var(--color-green);
}

.tw-modal-wrapper.is-open .tw-modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Content Area */
.tw-modal-content {
  padding: 24px;
}

/* Modal Icon */
.tw-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 16px;
}

/* Typography */
.tw-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #333333; /* Dark text for white bg */
  margin-bottom: 8px;
}
.tw-modal-desc {
  font-size: 14px;
  color: #666666; /* Subdued dark text */
  line-height: 1.6;
}

/* Action Buttons Area */
.tw-modal-actions {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 480px) {
  .tw-modal-actions--row {
    flex-direction: row;
  }
  .tw-modal-actions--row .tw-btn {
    flex: 1;
  }
}

/* Buttons */
.tw-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  border: none;
}

/* Primary Button */
.tw-btn-primary {
  background-color: var(--color-orange);
  color: #ffffff;
}
.tw-btn-primary:hover {
  filter: brightness(1.1);
}

/* Green variant for Primary Button */
.tw-btn-primary.tw-btn-green {
  background-color: var(--color-green);
  color: #ffffff; /* White text for green background */
}

/* Secondary Button (Cancel) */
.tw-btn-secondary {
  background-color: transparent;
  color: #333333; /* Dark text for white bg */
  border: 1px solid #cccccc; /* Light border */
}
.tw-btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.05); /* Slight dark hover */
}

/* Text Link inside Modal */
.tw-modal-link {
  font-size: 13px;
  color: #666666;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 4px;
  display: inline-block;
}
.tw-modal-link:hover {
  color: #333333;
}
