/* ==========================================================================
   TSF Subscriptions — Complete Styles
   ========================================================================== */

/* ---------- Shared buttons ---------- */

.tsf-btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
}

.tsf-btn-sm { padding: 4px 10px; font-size: 0.8em; }
.tsf-btn-lg { padding: 12px 24px; font-size: 1em; }

.tsf-btn-primary { background: #820a02; color: #fff; }
.tsf-btn-primary:hover { background: #6a0802; color: #fff; }
.tsf-btn-secondary { background: #e0e0e0; color: #333; }
.tsf-btn-secondary:hover { background: #ccc; color: #333; }
.tsf-btn-disabled { display: inline-block; padding: 10px 24px; background: #ccc; color: #888; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: not-allowed; text-decoration: none; }
.tsf-trial-disabled { opacity: 0.6; }
.tsf-tier-too-small { opacity: 0.4; cursor: not-allowed; }
.tsf-btn-remove { background: #e74c3c; color: #fff; }
.tsf-btn-remove:hover { background: #c0392b; color: #fff; }

.tsf-sublist-remove-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tsf-sublist-remove-btn:hover { background: #c0392b; }
.tsf-sublist-remove-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tsf-btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- Shared badges ---------- */

.tsf-plan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
}

.tsf-plan-basic { background: #3498db; color: #fff; }
.tsf-plan-deluxe { background: #8e44ad; color: #fff; }

.tsf-trial-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #f39c12;
  color: #fff;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 700;
}

.tsf-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 700;
}

.tsf-status-active { background: #eafaf1; color: #27ae60; }
.tsf-status-cancelling { background: #fef5e7; color: #e67e22; }
.tsf-status-past-due { background: #fef9e7; color: #f39c12; }

/* ---------- Cutoff notices ---------- */

.tsf-cutoff-notice {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  margin-bottom: 15px;
}

.tsf-cutoff-open { background: #eafaf1; border-left: 4px solid #27ae60; color: #1e7e34; }
.tsf-cutoff-closed { background: #fef9e7; border-left: 4px solid #f39c12; color: #856404; }

/* ---------- Empty section ---------- */

.tsf-empty-section {
  padding: 20px;
  text-align: center;
  color: #999;
  background: #f8f9fa;
  border-radius: 6px;
}

.tsf-section-desc {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 15px;
}

.tsf-manage-link {
  float: right;
  font-size: 0.85em;
}

.tsf-muted { color: #999; }

/* ==========================================================================
   My Watchlist page — two-column layout
   ========================================================================== */

.tsf-watchlist-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.tsf-watchlist-col h2 {
  margin-top: 0;
  margin-bottom: 5px;
}

/* Watchlist cards (left column) */

.tsf-watchlist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tsf-watchlist-card {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 10px 14px;
  background: #fff;
}

.tsf-watchlist-portfolio {
  border-color: #8e44ad;
  background: #faf5fc;
}

.tsf-watchlist-card-meta {
  font-size: 0.8em;
  color: #888;
  margin-top: 2px;
}

.tsf-watchlist-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tsf-watchlist-ticker {
  font-weight: 700;
  font-size: 1.1em;
  color: #333;
  text-decoration: none;
}

.tsf-watchlist-ticker:hover { color: #0e7c6b; }

.tsf-watchlist-config {
  font-size: 0.8em;
  color: #888;
}

.tsf-watchlist-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* Subscription list cards (right column) */

.tsf-sub-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tsf-tier-count {
  font-weight: 600;
  color: #555;
}

.tsf-sublist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tsf-sublist-card {
  border: 1px solid #0e7c6b;
  border-radius: 6px;
  padding: 10px 14px;
  background: #f0faf8;
}

.tsf-sublist-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tsf-sublist-ticker {
  font-weight: 700;
  font-size: 1.1em;
  color: #333;
  text-decoration: none;
}

.tsf-sublist-ticker:hover { color: #0e7c6b; }

.tsf-sublist-card-config {
  font-size: 0.85em;
  color: #666;
  margin: 4px 0 8px;
}

/* Cart CTA */

.tsf-cart-cta {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.tsf-cart-cta h3 {
  margin: 0 0 8px;
}

.tsf-cart-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Tier overflow */

.tsf-tier-overflow {
  margin-top: 15px;
  padding: 12px;
  background: #fdecea;
  border-left: 4px solid #e74c3c;
  border-radius: 0 6px 6px 0;
}

/* Pending changes */

.tsf-pending-heading {
  margin-top: 20px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
}

.tsf-pending-list { font-size: 0.9em; }

.tsf-pending-item {
  padding: 6px 10px;
  background: #fef9e7;
  border-left: 3px solid #f39c12;
  margin-bottom: 4px;
  border-radius: 0 4px 4px 0;
}

/* Edit form (inline) */

.tsf-edit-form {
  padding: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-top: 8px;
}

.tsf-edit-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.tsf-control-group label {
  display: block;
  font-size: 0.75em;
  color: #666;
  margin-bottom: 3px;
}

.tsf-edit-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   My Subscription page
   ========================================================================== */

.tsf-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tsf-sub-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
}

.tsf-sub-card h2 {
  margin: 0 0 15px;
  font-size: 1.1em;
  color: #333;
}

.tsf-sub-plan-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.tsf-sub-details { margin-bottom: 15px; }

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

.tsf-sub-label { color: #888; font-size: 0.9em; }

.tsf-sub-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.tsf-sub-note {
  font-size: 0.8em;
  color: #999;
  margin-top: 8px;
}

/* Quick links */

.tsf-sub-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tsf-sub-link {
  display: block;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.tsf-sub-link:hover { border-color: #0e7c6b; }
.tsf-sub-link-title { display: block; font-weight: 700; color: #333; }
.tsf-sub-link-desc { display: block; font-size: 0.8em; color: #999; margin-top: 2px; }

.tsf-no-subscription-page {
  text-align: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.tsf-subscription-cta {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

/* ==========================================================================
   Pricing page
   ========================================================================== */

.tsf-pricing-page { max-width: 900px; margin: 0 auto; }

.tsf-pricing-intro { text-align: center; margin-bottom: 30px; }

.tsf-trial-callout {
  text-align: center;
  padding: 20px;
  background: #fef9e7;
  border: 2px solid #f39c12;
  border-radius: 8px;
  margin-bottom: 30px;
}

.tsf-trial-callout h3 { margin: 0 0 8px; }

.tsf-pricing-table-wrapper { overflow-x: auto; margin-bottom: 30px; }

.tsf-pricing-table {
  width: 100%;
  border-collapse: collapse;
}

.tsf-pricing-table th,
.tsf-pricing-table td {
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.tsf-pricing-table th {
  background: #333;
  color: #fff;
  font-size: 0.85em;
}

.tsf-pricing-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.tsf-plan-feature-col {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 6px;
}

.tsf-pricing-cta { text-align: center; }

/* ==========================================================================
   Checkout page
   ========================================================================== */

.tsf-checkout-page { max-width: 700px; margin: 0 auto; }

.tsf-checkout-notice,
.tsf-checkout-cart-info {
  padding: 12px 16px;
  background: #eafaf1;
  border-left: 4px solid #27ae60;
  border-radius: 0 6px 6px 0;
  margin-bottom: 20px;
}

.tsf-checkout-trial {
  text-align: center;
  padding: 20px;
  background: #fef9e7;
  border: 2px solid #f39c12;
  border-radius: 8px;
  margin-bottom: 20px;
}

.tsf-checkout-trial h3 { margin: 0 0 8px; }

.tsf-checkout-divider {
  text-align: center;
  margin: 20px 0;
  color: #999;
  font-size: 0.9em;
  position: relative;
}

.tsf-checkout-divider::before,
.tsf-checkout-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #e0e0e0;
}

.tsf-checkout-divider::before { left: 0; }
.tsf-checkout-divider::after { right: 0; }

.tsf-checkout-section {
  margin-bottom: 25px;
}

.tsf-checkout-section h3 {
  margin: 0 0 10px;
  font-size: 1em;
  color: #555;
}

.tsf-plan-selector {
  display: flex;
  gap: 15px;
}

.tsf-plan-option {
  flex: 1;
  display: block;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}

.tsf-plan-option:has(input:checked) {
  border-color: #0e7c6b;
  background: #f0faf8;
}

.tsf-plan-option input { display: none; }
.tsf-plan-option-label { display: block; font-weight: 700; font-size: 1.1em; }
.tsf-plan-option-desc { display: block; font-size: 0.8em; color: #888; margin-top: 4px; }

.tsf-tier-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tsf-tier-option {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
}

.tsf-tier-option:has(input:checked) {
  border-color: #0e7c6b;
  background: #f0faf8;
}

.tsf-tier-option input { display: none; }
.tsf-tier-label { font-weight: 600; min-width: 100px; }
.tsf-tier-price { color: #555; }
.tsf-tier-recommended {
  margin-left: auto;
  font-size: 0.75em;
  font-weight: 700;
  color: #f39c12;
  text-transform: uppercase;
}

.tsf-tier-suggested { border-color: #f39c12; }

.tsf-checkout-summary { margin-bottom: 15px; }
.tsf-checkout-total { font-weight: 700; font-size: 1.1em; }

/* ==========================================================================
   Downloads page
   ========================================================================== */

.tsf-downloads-table {
  width: 100%;
  border-collapse: collapse;
}

.tsf-downloads-table th,
.tsf-downloads-table td {
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.tsf-downloads-table th {
  background: #333;
  color: #fff;
  font-size: 0.85em;
}

/* ==========================================================================
   Add to Watchlist button
   ========================================================================== */

.tsf-add-to-list-btn.tsf-added,
.tsf-add-all-btn.tsf-added {
  background: #27ae60;
  color: #fff;
}

.tsf-add-portfolio-btn.tsf-added {
  background: #27ae60;
  color: #fff;
}

.tsf-add-portfolio-btn {
  font-size: 0.9em;
}

.tsf-add-login-prompt {
  padding: 10px 14px;
  background: #f8f9fa;
  border-left: 4px solid #3498db;
  border-radius: 0 4px 4px 0;
  font-size: 0.9em;
  margin: 10px 0;
}

.tsf-watchlist-wrapper { margin: 10px 0; }

.tsf-view-watchlist-link {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.85em;
  color: #0e7c6b;
  text-decoration: none;
}
.tsf-view-watchlist-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Coming soon / admin-only gate
   ========================================================================== */

.tsf-coming-soon {
  padding: 24px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  margin: 20px 0;
}

.tsf-coming-soon h3 {
  margin-top: 0;
  color: #555;
}

.tsf-coming-soon-note {
  font-size: 0.9em;
  color: #888;
  margin-bottom: 10px;
}

/* ==========================================================================
   Downloads / Bonus badge
   ========================================================================== */

.tsf-delivery-bonus {
  background: #fdf8e8;
}

.tsf-badge-bonus {
  display: inline-block;
  background: #f39c12;
  color: #fff;
  font-size: 0.75em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* ==========================================================================
   Admin
   ========================================================================== */

.tsf-admin-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.tsf-admin-stat {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 6px;
  text-align: center;
  flex: 1;
}

.tsf-admin-stat-value {
  display: block;
  font-size: 2em;
  font-weight: 700;
  color: #333;
}

.tsf-admin-stat-label {
  display: block;
  font-size: 0.85em;
  color: #888;
  margin-top: 4px;
}

/* ==========================================================================
   Portfolio cards in subscription list
   ========================================================================== */

.tsf-sublist-portfolio {
  border-color: #8e44ad;
  background: #faf5fc;
}

.tsf-type-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
  margin-right: 4px;
}

.tsf-type-portfolio {
  background: #8e44ad;
  color: #fff;
}

.tsf-sublist-card-meta {
  font-size: 0.8em;
  color: #888;
  margin: 4px 0 8px;
}

/* ==========================================================================
   Deluxe-only tag
   ========================================================================== */

.tsf-deluxe-tag {
  display: inline-block;
  padding: 1px 5px;
  background: #8e44ad;
  color: #fff;
  border-radius: 3px;
  font-size: 0.7em;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

/* Deluxe badge (subscription list cards) */
.tsf-deluxe-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #2c3e50;
  color: #f1c40f;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
}

/* Cancelling notice */
.tsf-cancelling-note {
  color: #e67e22;
  font-weight: 600;
  margin-top: 12px;
}

/* Derived plan note on checkout */
.tsf-plan-derived-note {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Change Plan page */
.tsf-change-plan-current { background: #f8f8f8; padding: 20px; border-radius: 8px; margin-bottom: 24px; }
.tsf-tier-current { border: 2px solid #333 !important; background: #f0f0f0; }
.tsf-proration-table { margin: 12px 0; }
.tsf-proration-table td { padding: 4px 16px 4px 0; }
.tsf-proration-label { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.tsf-change-plan-preview { margin-top: 20px; padding: 20px; background: #fafafa; border-radius: 8px; border: 1px solid #ddd; }
.tsf-change-plan-loading { margin-top: 20px; color: #888; }
.tsf-change-plan-same { margin-top: 20px; color: #888; }

/* ==========================================================================
   Draft / Commit model styles
   ========================================================================== */

/* Persistent notice for active subscribers */
.tsf-sublist-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 0.88em;
  color: #664d03;
  line-height: 1.4;
}

/* Commit control bar — top of subscription list */
.tsf-commit-bar {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.tsf-commit-bar .tsf-sub-status-bar { margin-bottom: 10px; }

.tsf-commit-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 1em;
  margin-bottom: 8px;
}
.tsf-commit-btn:disabled {
  background: #95a5a6;
  cursor: default;
}

.tsf-commit-hint {
  font-size: 0.82em;
  color: #6c757d;
  text-align: center;
}

.tsf-commit-overflow {
  background: #f8d7da;
  color: #721c24;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
}

.tsf-discard-btn {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

/* Draft badge (NEW) */
.tsf-draft-badge {
  display: inline-block;
  background: #17a2b8;
  color: #fff;
  font-size: 0.7em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Removing badge */
.tsf-removing-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 0.7em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Item states */
.tsf-item-draft {
  border-left: 3px solid #17a2b8;
  background: #f0fafc;
}
.tsf-item-removing {
  border-left: 3px solid #e74c3c;
  background: #fdf0ef;
  opacity: 0.7;
}
.tsf-item-removing .tsf-sublist-ticker,
.tsf-item-removing .tsf-sublist-card-config {
  text-decoration: line-through;
  color: #999;
}

/* Undo button style for removing items */
.tsf-item-removing .tsf-sublist-remove-btn {
  background: #27ae60;
}
.tsf-item-removing .tsf-sublist-remove-btn:hover {
  background: #1e8449;
}

/* Trial expired notice */
.tsf-trial-expired-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 0.9em;
  color: #664d03;
}
.tsf-trial-expired-notice .tsf-btn { margin-top: 8px; }

/* Tier overflow */
.tsf-tier-overflow {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 0.9em;
  color: #721c24;
}

/* Pricing page CTA hint */
.tsf-pricing-cta-hint {
  font-size: 0.88em;
  color: #6c757d;
  margin-top: 8px;
  text-align: center;
}

/* ==========================================================================
   My Account dashboard
   ========================================================================== */

.tsf-account-page { max-width: 900px; margin: 0 auto; }

.tsf-account-section {
  margin-bottom: 32px;
}
.tsf-account-section h2 {
  font-size: 1.3em;
  margin-bottom: 12px;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
}

.tsf-account-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tsf-account-detail {
  font-size: 0.9em;
  color: #555;
}

.tsf-account-empty p {
  color: #555;
  margin-bottom: 12px;
}
.tsf-account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tsf-account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.tsf-account-card {
  display: block;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tsf-account-card:hover {
  border-color: #820a02;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-decoration: none;
  color: #333;
}
.tsf-account-card h3 {
  margin: 0 0 6px;
  font-size: 1.1em;
  color: #820a02;
}
.tsf-account-card p {
  margin: 0;
  font-size: 0.88em;
  color: #555;
  line-height: 1.4;
}
.tsf-account-card-stat {
  display: block;
  margin-top: 10px;
  font-size: 0.82em;
  font-weight: 600;
  color: #333;
}

.tsf-account-deliveries {
  margin-bottom: 12px;
}
.tsf-account-delivery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}
.tsf-delivery-date {
  font-weight: 600;
}

.tsf-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tsf-status-active { background: #27ae60; color: #fff; }
.tsf-status-cancelling { background: #e67e22; color: #fff; }

@media (max-width: 600px) {
  .tsf-account-grid { grid-template-columns: 1fr; }
}
