/*
 * PREMIUM MODAL STYLES - FIXED
 * Mobile-optimized, no layout breaking
 */

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== MODAL CONTENT ===== */
.modal-content {
  background: var(--bg-elevated);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  margin: auto;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== CLOSE BUTTON ===== */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.4);
  transform: rotate(90deg);
}

/* ===== MODAL BODY ===== */
.modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ===== MODAL IMAGE ===== */
.modal-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ===== MODAL TEXT ===== */
.modal-text {
  flex: 1;
}

.modal-text h2 {
  color: var(--text-primary);
  font-size: 1.75rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-text p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ===== MODAL FEATURES LIST ===== */
.modal-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.modal-features li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 0.75rem 0;
  padding-left: 2rem;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-features li:last-child {
  border-bottom: none;
}

.modal-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary-blue);
  font-weight: bold;
  font-size: 1.2rem;
}

/* ===== MODAL CTA ===== */
.modal-cta {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-cta .btn {
  flex: 1;
  padding: 1rem;
  text-align: center;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ===== PRICE BOX IN MODAL ===== */
.modal-price {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  margin: 1.5rem 0;
}

.modal-price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.modal-price-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ===== MOBILE & DESKTOP - STACKED LAYOUT ===== */
.modal-body {
  flex-direction: column !important;
  padding: 0 !important;
}

.modal-image {
  width: 100% !important;
  flex: none !important;
  margin-bottom: 0 !important;
  border-radius: 16px 16px 0 0 !important;
  overflow: hidden !important;
}

.modal-image img {
  border-radius: 0 !important;
}

.modal-text {
  width: 100% !important;
  flex: none !important;
  padding: 2rem !important;
}

/* ===== DESKTOP LAYOUT ===== */
@media (min-width: 768px) {
  .modal-text {
    padding: 3rem !important;
  }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 767px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-start;
  }

  .modal-content {
    border-radius: 0;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    max-height: 95vh;
    margin-top: auto;
    width: 100%;
  }

  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }

  .modal-text h2 {
    font-size: 1.5rem;
  }

  .modal-text p {
    font-size: 0.95rem;
  }

  .modal-features li {
    font-size: 0.9rem;
    padding: 0.6rem 0;
    padding-left: 1.75rem;
  }

  .modal-cta {
    flex-direction: column;
  }

  .modal-cta .btn {
    width: 100%;
  }

  .modal-price-amount {
    font-size: 2rem;
  }
}

/* ===== PREVENT BODY SCROLL WHEN MODAL IS OPEN ===== */
body.modal-open {
  overflow: hidden;
}

/* ===== SMOOTH SCROLLING IN MODAL ===== */
.modal-content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ===== ACCESSIBILITY ===== */
.modal-overlay:focus {
  outline: none;
}

.modal-close:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* ===== DARK MODE ADJUSTMENTS ===== */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .modal-close {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-close:hover {
  background: rgba(255, 0, 0, 0.15);
}
