/* ============================================================
   MR Commerce Suite — Subscription UI Styles
   ============================================================ */

/* Subscription Banner */
.subscription-banner {
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  position: relative;
}

.subscription-banner a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.banner-warning {
  background: #fff3cd;
  color: #856404;
  border-bottom: 1px solid #ffc107;
}

.banner-danger {
  background: #f8d7da;
  color: #721c24;
  border-bottom: 1px solid #dc3545;
}

/* Subscription Card */
.subscription-card {
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.subscription-empty {
  text-align: center;
  padding: 40px;
}

.sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sub-plan-badge {
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sub-status {
  font-weight: 600;
  font-size: 14px;
}

.sub-details {
  margin-bottom: 20px;
}

.sub-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color, #f0f0f0);
}

.sub-label {
  color: var(--text-secondary, #666);
  font-size: 14px;
}

.sub-value {
  font-weight: 600;
  font-size: 14px;
}

.text-danger {
  color: #dc3545 !important;
}

/* Usage Limits */
.sub-usage {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-tertiary, #f8f9fa);
  border-radius: 8px;
}

.sub-usage h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-secondary, #666);
}

.usage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.usage-label {
  width: 80px;
  font-size: 13px;
  color: var(--text-secondary, #666);
}

.usage-value {
  width: 60px;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.usage-bar {
  flex: 1;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Subscription Actions */
.sub-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.plan-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.plan-card.plan-current {
  background: #f0f8ff;
}

.plan-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-price span {
  font-size: 14px;
  color: #666;
  font-weight: 400;
}

.plan-yearly {
  font-size: 12px;
  color: #666;
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  text-align: left;
  font-size: 13px;
}

.plan-features li {
  padding: 4px 0;
  color: #333;
}

.plan-limits {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
  color: #666;
}

/* Billing Table */
.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.billing-table th,
.billing-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.billing-table th {
  font-weight: 600;
  color: var(--text-secondary, #666);
  font-size: 12px;
  text-transform: uppercase;
}

.status-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-paid { background: #d4edda; color: #155724; }
.status-failed { background: #f8d7da; color: #721c24; }
.status-pending { background: #fff3cd; color: #856404; }
.status-refunded { background: #cce5ff; color: #004085; }

/* Read-Only Overlay */
.read-only-overlay {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #dc3545;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin-bottom: 20px;
}

.read-only-message h3 {
  color: #dc3545;
  margin-bottom: 12px;
}

.read-only-message p {
  color: #666;
  margin-bottom: 8px;
}

/* Renewal Actions */
.renewal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* Modal Overlay (fallback) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay .modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
}

.modal-body {
  padding: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .sub-actions {
    flex-direction: column;
  }

  .sub-actions .btn {
    width: 100%;
  }

  .renewal-actions {
    flex-direction: column;
  }
}
