/*
 * Subscription System Styles
 * Styles for subscription plans, management, and billing
 */

/* ========================================
   SUBSCRIPTION PLANS PAGE
   ======================================== */

/* Section Styling */
.subscription-section,
.credits-section {
  margin: 20px 0;
}

.section-title {
  text-align: center;
  font-size: 32px;
  /*margin: 3rem 0 1rem 0;*/
  color: #333;
}

.section-subtitle {
  text-align: center;
  color: #666;
  font-size: 18px;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.credits-section {
  padding-top: 3rem;
  border-top: 2px solid #e0e0e0;
}

/* Billing Period Toggle */
.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 30px 0;
}

.toggle-btn {
  padding: 12px 30px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.toggle-btn:hover {
  border-color: #cf5127;
  color: #cf5127;
}

.toggle-btn.active {
  background: #cf5127;
  border-color: #cf5127;
  color: white;
}

.badge-save {
  background: #4caf50;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin-left: 5px;
}

.plan-section {
  margin: 30px 0;
}

/* Alert Messages */
.alert {
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 5px;
  border-left: 4px solid;
}

.alert-info {
  background-color: #e3f2fd;
  border-color: #2196f3;
  color: #0d47a1;
}

.alert-success {
  background-color: #e8f5e9;
  border-color: #4caf50;
  color: #1b5e20;
}

.alert-warning {
  background-color: #fff3e0;
  border-color: #ff9800;
  color: #e65100;
}

.alert-error {
  background-color: #ffebee;
  border-color: #f44336;
  color: #b71c1c;
}

.messages-container {
  margin: 20px 0;
}

.small-button {
  padding: 8px 16px;
  font-size: 14px;
  margin-left: 10px;
}

.btn-secondary {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}


/* ========================================
   MANAGE SUBSCRIPTION PAGE
   ======================================== */

/* Subscription Card */
.subscription-card {
  background: #fff;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.card-header h2 {
  margin: 0;
  font-size: 24px;
}

/* Status Badges */
.status-badge {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-active,
.status-trialing {
  background-color: #4caf50;
  color: white;
}

.status-past_due,
.status-unpaid {
  background-color: #ff9800;
  color: white;
}

.status-canceled,
.status-incomplete_expired {
  background-color: #f44336;
  color: white;
}

/* Subscription Details */
.subscription-details {
  margin: 20px 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: #666;
  font-weight: 500;
}

.detail-value {
  font-weight: 600;
  text-align: right;
}

.text-warning {
  color: #ff9800;
}

/* Action Buttons */
.subscription-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.button-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

.button-secondary:hover {
  background-color: #5a6268;
}

.button-outline {
  background-color: transparent;
  border: 2px solid #cf5127;
  color: #cf5127;
}

.button-outline:hover {
  background-color: #cf5127;
  color: white;
}

.button-danger {
  background-color: #f44336;
  border-color: #f44336;
}

.button-danger:hover {
  background-color: #d32f2f;
}

/* Payment History */
.payment-history {
  margin-top: 30px;
}

.payment-history h2 {
  margin-bottom: 20px;
}

.payments-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

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

.payments-table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

.payments-table tr:hover {
  background-color: #f9f9f9;
}

.payment-status {
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
}

.payment-succeeded {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.payment-pending {
  background-color: #fff3e0;
  color: #ef6c00;
}

.payment-failed {
  background-color: #ffebee;
  color: #c62828;
}

.no-payments,
.no-subscription {
  text-align: center;
  padding: 40px 0;
  font-size: 16px;
  color: #666;
}

/* Cancel Confirmation Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #ddd;
}

.modal-header h2 {
  margin: 0;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 25px;
}

.cancel-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.cancel-option {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 15px;
  text-align: center;
}

.cancel-option h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.cancel-option p {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}


/* ========================================
   USER NAVIGATION
   ======================================== */

.user-navigation {
  background: linear-gradient(135deg, #ff8a65 0%, #cf5127 100%);
  color: white;
  padding: 20px 0 0 0;
  margin-bottom: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-nav-wrapper {
  display: flex;
  flex-direction: column;
}

.user-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 15px 0;
  margin-bottom: 15px;
}

.user-greeting {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: white;
}

.user-credits-display {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.credits-icon {
  font-size: 20px;
}

.credits-value {
  font-size: 24px;
  font-weight: 700;
  color: white;
}

.credits-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-nav-menu {
  margin: 0;
}

.user-menu-items {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  flex-wrap: wrap;
}

.user-menu-item {
  flex: 1;
  min-width: 150px;
}

.user-menu-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  background: rgba(255, 255, 255, 0.05);
}

.user-menu-item a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.user-menu-item.active a {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-bottom-color: white;
  font-weight: 600;
}

.user-menu-item i {
  font-size: 18px;
}


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet and below */
@media (max-width: 1024px) {
  .user-menu-item a {
    padding: 12px 15px;
    font-size: 14px;
  }

  .user-menu-item i {
    font-size: 16px;
  }
}

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

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

  .subscription-actions .button {
    width: 100%;
  }

  .user-nav-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .user-greeting {
    font-size: 20px;
  }

  .user-credits-display {
    align-self: stretch;
    justify-content: center;
  }

  .user-menu-items {
    flex-direction: column;
    gap: 0;
  }

  .user-menu-item {
    width: 100%;
    min-width: auto;
  }

  .user-menu-item a {
    justify-content: flex-start;
    padding: 12px 15px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .user-menu-item a span {
    display: inline;
  }
}

/* ========================================
   PRICING PAGE ENHANCEMENTS
   Overrides and additions to improve visual appearance of pricing cards
   ======================================== */

/*!* Layout for pricing cards *!*/
/*#monthly-subscription-plans,*/
/*#annual-subscription-plans,*/
/*.pricing {*/
/*  display: grid;*/
/*  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));*/
/*  gap: 20px;*/
/*  align-items: start;*/
/*  margin: 20px 0 40px 0;*/
/*}*/

.card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.07);
  border: 1px solid rgba(15, 23, 42, 0.04);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.10);
  border-color: rgba(15, 23, 42, 0.06);
}

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

.plan {
  font-weight: 700;
  font-size: 18px;
  color: #111827;
}

.badge-popular {
  background: linear-gradient(90deg, #ff8a65, #cf5127);
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(207,81,39,0.14);
}

.price {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  margin: 8px 0 4px 0;
}

.price span {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-left: 6px;
}

.credits {
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 12px;
}

.features {
  margin-top: 8px;
  color: #374151;
}

.features ul {
  padding-left: 18px;
  margin: 6px 0 14px 0;
}

.features li {
  margin: 8px 0;
  font-size: 14px;
}

.features li strong {
  color: #111827;
}

.cta {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.btn.btn-primary,
.button-outline {
  background: #cf5127;
  color: #fff;
  box-shadow: 0 6px 14px rgba(207,81,39,0.12);
}

.btn.btn-primary:hover,
.button-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(207,81,39,0.16);
}

.btn.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  box-shadow: none;
}

.btn[disabled],
.btn.btn-secondary[disabled],
.btn.btn-secondary.disabled,
.btn.btn-secondary[aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Small badge for save and promos */
.badge-save {
  display: inline-block;
  background: #10b981;
  color: white;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* Make annual plans visually distinct when visible */
.plan-section#annual-subscription-plans .card {
  border: 1px solid rgba(16, 185, 129, 0.06);
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .price {
    font-size: 24px;
  }

  .card {
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .billing-toggle {
    gap: 6px;
    padding: 0 10px;
  }

  .toggle-btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  #monthly-subscription-plans,
  #annual-subscription-plans {
    grid-template-columns: 1fr;
  }
}

/* subtle link style in features */
.features a {
  color: #cf5127;
  text-decoration: underline;
}

/* accessibility: focus styles for keyboard users */
.toggle-btn:focus,
.btn:focus,
.user-menu-item a:focus {
  outline: 3px solid rgba(207,81,39,0.18);
  outline-offset: 3px;
}
