/**
 * W2W Popup Manager - Styles
 * 
 * Modern, accessible popup styling with smooth animations
 */

/* Overlay */
.w2w-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Showing state - display flex but still invisible */
.w2w-popup-overlay.w2w-popup--showing {
  display: flex !important;
}

/* Visible state - fade in */
.w2w-popup-overlay.w2w-popup--visible {
  opacity: 1;
}

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

/* Container */
.w2w-popup-container {
  background: #1b1d29;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 90%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

/* Container animation when visible */
.w2w-popup-overlay.w2w-popup--visible .w2w-popup-container {
  transform: scale(1);
}

/* Size variants */
.w2w-popup--small {
  width: 100%;
  max-width: 400px;
}

.w2w-popup--medium {
  width: 100%;
  max-width: 600px;
}

.w2w-popup--large {
  width: 100%;
  max-width: 900px;
}

/* Content wrapper */
.w2w-popup-content {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

/* Close button */
button.w2w-popup-close {
  position: absolute;
  top: 0px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  z-index: 10;
}

button.w2w-popup-close span:before {
  content: "\f112";
  transition: opacity 0.15s ease;
  font-family: "woodmart-font";
  font-size: 17.6px;
}

button.w2w-popup-close:hover {
  background: transparent;
  color: rgb(255 255 255 / 70%);
}

/* Header */
.w2w-popup-header {
  padding: 25px 50px 20px 25px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.w2w-popup-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

/* Body */
.w2w-popup-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

.w2w-popup-body p:first-child {
  margin-top: 0;
}

.w2w-popup-body p:last-child {
  margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .w2w-popup-overlay {
    padding: 10px;
  }

  .w2w-popup-container {
    max-width: 100%;
    max-height: 95vh;
  }

  .w2w-popup--small,
  .w2w-popup--medium,
  .w2w-popup--large {
    max-width: 100%;
  }

  .w2w-popup-header {
    padding: 20px 45px 15px 20px;
  }

  .w2w-popup-title {
    font-size: 20px;
  }

  .w2w-popup-body {
    padding: 20px;
  }

  .w2w-popup-close {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .w2w-popup-overlay,
  .w2w-popup-container,
  .w2w-popup-close {
    transition: none;
  }
}

/* Print styles */
@media print {
  .w2w-popup-overlay {
    display: none !important;
  }
}

/* Custom scrollbar for popup body */
.w2w-popup-body::-webkit-scrollbar {
  width: 8px;
}

.w2w-popup-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.w2w-popup-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.w2w-popup-body::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Additional utility classes for content styling */
.w2w-popup-body .button,
.w2w-popup-body .btn {
  margin-top: 15px;
}

.w2w-popup-body ul,
.w2w-popup-body ol {
  padding-left: 20px;
}

.w2w-popup-body a {
  color: #007bff;
  text-decoration: underline;
}

.w2w-popup-body a:hover {
  color: #0056b3;
}

.w2w-popup-body strong {
  font-weight: 600;
}

/* Alert/warning style variant (can be added via custom classes) */
.w2w-popup-body.w2w-popup-body--warning {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
}

.w2w-popup-body.w2w-popup-body--error {
  background: #f8d7da;
  border-left: 4px solid #dc3545;
}

.w2w-popup-body.w2w-popup-body--info {
  background: #d1ecf1;
  border-left: 4px solid #17a2b8;
}

.w2w-popup-body.w2w-popup-body--success {
  background: #d4edda;
  border-left: 4px solid #28a745;
}
