/**
 * Subscription Info Modal - Modern Glass-morphism Design
 * Now bullet-proof on short laptop screens (13–15") — no cutoff
 */

/* ====== Viewport & spacing tokens ====== */
:root {
  --sub-safe-pad: clamp(12px, 2.5dvh, 24px);
  --sub-max-w: 600px;
}

/* ====== Bootstrap modal container (overlay) ====== */
.subscription-info-modal .modal-dialog {
  /* Center, but allow overlay to scroll when content is tall */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Use dynamic viewport height, and keep breathing room via modal padding */
  min-height: 100dvh;
  max-width: var(--sub-max-w);
  margin: var(--sub-safe-pad) auto; /* prevents edge-to-edge on short viewports */
  padding: 0; /* Bootstrap sometimes injects; keep clean */
}

/* When Bootstrap adds .modal, let the OVERLAY scroll */
.subscription-info-modal.modal {
  overflow: auto;
  padding: var(--sub-safe-pad);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* ====== Main Modal Content - Glass-morphism Effect ====== */
.subscription-info-content {
  background: rgba(35, 44, 47, 0.85) !important;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(58, 65, 73, 0.3) !important;
  border-radius: 25px !important;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.4),
    0 0 100px rgba(58, 65, 73, 0.15) inset;
  overflow: hidden;
  animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* ⬇️ Key: cap height and make body scrollable inside */
  width: min(100%, var(--sub-max-w));
  max-height: calc(100dvh - (var(--sub-safe-pad) * 2));
  display: grid;
  grid-template-rows: auto 1fr auto; /* header | scroll-body | footer */
}

/* ====== Header Section ====== */
.subscription-info-header {
  padding: 25px 25px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  position: relative;
}

/* Close Button — stays reachable even when body scrolls */
.subscription-info-close {
  position: sticky; /* pins within header area as body scrolls */
  top: 10px;
  margin-left: auto;
  z-index: 2;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.subscription-info-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}
.subscription-info-close:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 65, 73, 0.3);
}

/* Status Badge - Floating Element */
.subscription-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(58, 65, 73, 0.6) 0%, rgba(58, 65, 73, 0.4) 100%);
  border: 1px solid rgba(58, 65, 73, 0.5);
  border-radius: 50px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 5px 15px rgba(58, 65, 73, 0.2);
  animation: floatBadge 3s ease-in-out infinite;
}
.subscription-status-badge i {
  color: #ffd700;
  font-size: 1.1rem;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
  animation: rotateCrown 4s ease-in-out infinite;
}

/* ====== Scrollable Body Section ====== */
.subscription-info-body {
  /* ⬇️ Critical: this is the ONLY scroll area */
  overflow: auto;
  min-height: 0; /* allows shrinking inside grid */
  padding: 30px;
  text-align: center;
}

/* Success Icon - Animated */
.subscription-success-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 25px;
}
.subscription-success-icon i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 8px rgba(74, 222, 128, 0.3));
  z-index: 2;
  animation: checkBounce 0.6s ease-out;
}
.success-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.3) 0%, transparent 70%);
  animation: successPulse 2s ease-out infinite;
}

/* Title and Subtitle */
.subscription-info-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subscription-info-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 30px;
  line-height: 1.5;
}

/* Features Grid - Glass Cards */
.subscription-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 30px 0;
}
.feature-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(58, 65, 73, 0.2);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: default;
}
.feature-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(58, 65, 73, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.feature-icon {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, rgba(58, 65, 73, 0.3) 0%, rgba(58, 65, 73, 0.2) 100%);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.feature-icon i {
  font-size: 1.3rem;
  background: linear-gradient(135deg, #3a414c 0%, #36454F 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.feature-text { flex: 1; text-align: left; }
.feature-text strong {
  display: block;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 3px;
  font-weight: 600;
}
.feature-text span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.3;
}

/* Status Info - Subtle Indicator */
.subscription-status-info {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(58, 65, 73, 0.2);
  border-radius: 50px;
}
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  position: relative;
}
.status-indicator.active {
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
  animation: statusGlow 2s ease-in-out infinite;
}
.status-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

/* ====== Footer Section (fixed area) ====== */
.subscription-info-footer {
  padding: 20px 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.1);
}

/* Translucent Buttons */
.btn-translucent {
  flex: 1;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-translucent:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}
.btn-translucent:active { transform: translateY(0); }

.btn-manage {
  background: linear-gradient(135deg, rgba(58, 65, 73, 0.4) 0%, rgba(58, 65, 73, 0.3) 100%);
  border-color: rgba(58, 65, 73, 0.5);
}
.btn-manage:hover {
  background: linear-gradient(135deg, rgba(58, 65, 73, 0.5) 0%, rgba(58, 65, 73, 0.4) 100%);
  border-color: rgba(58, 65, 73, 0.7);
}

/* ====== Animations (unchanged) ====== */
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.9) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@keyframes rotateCrown {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-5deg); }
  75%      { transform: rotate(5deg); }
}
@keyframes checkBounce {
  0%   { transform: translate(-50%, -50%) scale(0); }
  50%  { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes successPulse {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes statusGlow {
  0%,100% { box-shadow: 0 0 10px rgba(74, 222, 128, 0.5); }
  50%     { box-shadow: 0 0 20px rgba(74, 222, 128, 0.8); }
}

/* ====== Backdrop Enhancement ====== */
.subscription-info-modal.modal.fade { backdrop-filter: blur(5px); }
.subscription-info-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

/* ====== Responsive Design (width-based) ====== */
@media (max-width: 576px) {
  .subscription-info-modal .modal-dialog {
    margin: var(--sub-safe-pad);
    max-width: calc(100% - (var(--sub-safe-pad) * 2));
  }
  .subscription-features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .subscription-info-title { font-size: 1.6rem; }
  .subscription-info-subtitle { font-size: 1rem; }
  .subscription-info-footer { flex-direction: column; }
  .btn-translucent { width: 100%; }
}

/* ====== Height-aware compaction (short laptops) ====== */
@media (max-height: 820px) {
  .subscription-info-header { padding: 20px 20px 0; }
  .subscription-info-title { font-size: 1.8rem; }
  .subscription-info-body { padding: 24px; }
  .subscription-features-grid { gap: 12px; margin: 22px 0; }
}

@media (max-height: 700px) {
  .subscription-info-title { font-size: 1.6rem; }
  .subscription-info-subtitle { font-size: 0.98rem; margin-bottom: 20px; }
  .subscription-info-body { padding: 18px; }
  .feature-card { padding: 16px; border-radius: 14px; }
  .subscription-info-footer { padding: 16px 18px; }
}

/* ====== High contrast mode support ====== */
@media (prefers-contrast: high) {
  .subscription-info-content { border: 2px solid rgba(255, 255, 255, 0.5); }
  .feature-card { border: 1px solid rgba(255, 255, 255, 0.3); }
}

/* ====== Reduced motion support ====== */
@media (prefers-reduced-motion: reduce) {
  .subscription-info-content,
  .feature-card,
  .btn-translucent,
  .subscription-info-close,
  .subscription-status-badge {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }
}
