/* Payment Modal Styles */
.payment-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.payment-modal-overlay.active {
  display: block;
  opacity: 1;
}

.payment-modal {
  position: fixed;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  border-radius: 16px;
  width: 850px;
  height: 690px;
  z-index: 1002;
  display: none;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Dark theme background */
:root[data-theme="dark"] .payment-modal {
  background: #040404;
  border: 1px solid #1f1f1f;
}

:root[data-theme="dark"] .payment-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(0, 123, 255, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 70%, rgba(138, 43, 226, 0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 90%, rgba(255, 140, 0, 0.03) 0%, transparent 35%);
  pointer-events: none;
  z-index: 0;
}

:root[data-theme="dark"] .payment-modal-header,
:root[data-theme="dark"] .payment-modal-body {
  position: relative;
  z-index: 1;
}

/* Light theme background */
:root[data-theme="light"] .payment-modal {
  background: #fff;
}

.payment-modal.active {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.payment-modal-header {
  position: sticky;
  top: 0;
  padding: 24px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
  border-radius: 16px 16px 0 0;
  position: relative;
}

/* Dark theme header */
:root[data-theme="dark"] .payment-modal-header {
  background: #04040400;
}

/* Light theme header */
:root[data-theme="light"] .payment-modal-header {
  background: #fff;
}

.payment-modal-title-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

:root[data-theme="light"] .payment-modal-title {
  color: #000;
}

.payment-modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.payment-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding-left: 8px;
  padding-right: 8px;
  display: flex;
  margin-top: -6px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.payment-modal-close:hover {
  background-color: var(--hover-bg);
}

.payment-modal-close .close-icon {
  font-size: 24px;
}

:root[data-theme="dark"] .payment-modal-close .close-icon {
  color: #fff;
}

:root[data-theme="light"] .payment-modal-close .close-icon {
  color: #1c58e5;
}

.payment-modal-body {
  padding: 32px 40px 40px;
  height: calc(100% - 88px);
  overflow-y: auto;
  overflow-x: hidden;
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.payment-modal-body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Payment Content */
.payment-content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  max-width: 100%;
  margin: 0;
}

/* Features List (Left Side) */
.payment-features {
  padding-right: 20px;
  border-right: 1px solid var(--border-color);
}

.features-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

:root[data-theme="light"] .features-title {
  color: #000;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-primary);
}

.feature-icon {
  font-size: 20px;
  color: #10b981;
  flex-shrink: 0;
}

/* Payment Options (Right Side) */
.payment-options {
  display: flex;
  flex-direction: column;
}

/* Period Section */
.payment-section {
  margin-bottom: 32px;
}

.payment-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

:root[data-theme="light"] .payment-section-title {
  color: #000;
}

.period-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.period-option {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.period-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.period-option-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--text-primary);
}

.period-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-name {
  font-weight: 500;
  color: var(--text-primary);
}

.period-price {
  font-weight: 600;
  font-size: 20px;
  color: var(--text-primary);
  align-self: flex-start;
}

.period-option input[type="radio"]:checked + .period-option-content {
  border: 1px solid #007bff;
  background: rgba(0, 123, 255, 0.08);
}

:root[data-theme="light"] .period-option input[type="radio"]:checked + .period-option-content {
  background: rgba(0, 123, 255, 0.1);
}

.period-option:hover .period-option-content {
  border-color: #007bff;
}

.period-discount {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Payment Method Section */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-method {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.payment-method input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-method-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  transition: all 0.2s ease;
}

.payment-method input[type="radio"]:checked + .payment-method-content {
  border-color: #007bff;
  background: rgba(0, 123, 255, 0.06);
}

:root[data-theme="light"] .payment-method input[type="radio"]:checked + .payment-method-content {
  background: rgba(0, 123, 255, 0.08);
}

.payment-method:hover .payment-method-content {
  border-color: #007bff;
  opacity: 0.9;
}

.payment-method-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-method-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

:root[data-theme="light"] .payment-method-name {
  color: #000;
}

.payment-method-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

/* Crypto Icons */
.crypto-icons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

.crypto-icon {
  width: 20px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.crypto-icon:hover {
  transform: scale(1.1);
}

/* Total Price Section */
.payment-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 24px;
  margin-bottom: 16px;
}

.total-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

:root[data-theme="light"] .total-label {
  color: #000;
}

.total-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

:root[data-theme="light"] .total-price {
  color: #000;
}

.payment-method-icons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.payment-icon {
  height: 24px;
  border-radius: 4px;
}

/* Payment Button */
.payment-button {
  width: 100%;
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #007bff;
  color: white;
  margin-top: 8px;
}

.payment-button:hover {
  background: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 123, 255, 0.3);
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .payment-modal {
    width: 100%;
    height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }

  .payment-modal.active {
    transform: none;
  }

  .payment-modal-header {
    border-radius: 0;
    padding: 20px 16px;
  }

  .payment-modal-body {
    padding: 24px 16px 20px;
    height: calc(100% - 80px);
  }

  .payment-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .payment-features {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 20px;
  }

  .period-selector {
    grid-template-columns: 1fr;
  }
}

/* Dark Theme Overrides */
:root[data-theme="dark"] {
  --payment-modal-bg: #1a1a1a;
}

/* Light Theme Overrides */
:root[data-theme="light"] {
  --payment-modal-bg: #ffffff;
}

/* Tablet-specific: compact modal for laptops */
@media (min-width: 769px) and (max-width: 1400px) {
  .payment-modal {
    width: 680px;
    height: auto;
    max-height: 92vh;
    top: 50%;
  }

  .payment-modal-header {
    padding: 14px 20px;
  }

  .payment-modal-title {
    font-size: 18px;
  }

  .payment-modal-subtitle {
    font-size: 12px;
  }

  .payment-modal-body {
    padding: 14px 20px 18px;
    height: auto;
    overflow: visible;
  }

  .payment-content {
    gap: 20px;
  }

  .payment-features {
    padding-right: 18px;
  }

  .features-title {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .features-list {
    gap: 14px;
  }

  .feature-item {
    font-size: 13px;
    gap: 2px;
  }

  .feature-icon {
    font-size: 16px;
  }

  /* Right side - Payment options */
  .payment-options {
    gap: 0;
  }

  .payment-section {
    margin-bottom: 12px;
  }

  .payment-section-title {
    font-size: 11px;
    margin-bottom: 8px;
    letter-spacing: 0.03em;
  }

  .period-selector {
    gap: 10px;
  }

  .period-option-content {
    padding: 10px 12px;
    gap: 3px;
  }

  .period-name {
    font-size: 12px;
    white-space: nowrap;
  }

  .period-info {
    gap: 6px;
  }

  .period-price {
    font-size: 14px;
  }

  .period-discount {
    font-size: 9px;
    padding: 2px 5px;
  }

  /* Payment method section */
  .payment-method-content {
    padding: 12px 14px;
    gap: 8px;
  }

  .payment-method-name {
    font-size: 13px;
  }

  .payment-method-description {
    font-size: 11px;
  }

  .crypto-icons {
    gap: 6px;
    margin-top: 4px;
  }

  .crypto-icon {
    width: 18px;
    height: 24px;
  }

  /* Total section */
  .payment-total {
    padding: 12px 0;
    margin-top: 12px;
    margin-bottom: 10px;
  }

  .total-label {
    font-size: 13px;
  }

  .total-price {
    font-size: 18px;
  }

  /* Pay button */
  .payment-button {
    padding: 12px 20px;
    font-size: 14px;
    margin-top: 8px;
    border-radius: 10px;
  }
}
