/* Monetization & Authentication UI Styles */

/* Auth Section in Sidebar */
.auth-section {
  margin-bottom: 1rem;
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sign-out-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sign-out-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* Login Modal */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10003;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-modal.modal-visible {
  opacity: 1;
}

.login-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.login-modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 90vw;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.login-modal-header h2 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.5rem;
}

.login-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.login-methods {
  padding: 2rem;
}

.oauth-providers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.oauth-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.oauth-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.oauth-btn:active {
  transform: translateY(0);
}

.provider-icon {
  font-size: 1.2rem;
}

.provider-text {
  flex: 1;
  text-align: center;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.divider-text {
  margin: 0 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.login-input {
  padding: 0.875rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(74,144,226,0.1);
}

.login-input::placeholder {
  color: var(--text-light);
}

.email-login-btn {
  padding: 0.875rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.email-login-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.email-login-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
}

.login-benefits {
  background: var(--bg-primary);
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-light);
}

.login-benefits h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.benefits-list li {
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-footer {
  padding: 1rem 2rem 2rem;
  text-align: center;
}

.privacy-note {
  margin: 0;
  color: var(--text-light);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Upgrade Modal */
.upgrade-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.upgrade-modal.modal-visible {
  opacity: 1;
}

.upgrade-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.upgrade-modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 95vw;
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.upgrade-modal-header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-dark) 100%);
  color: white;
  position: relative;
}

.upgrade-modal-header h2 {
  margin: 0;
  font-size: 1.75rem;
}

.upgrade-tabs {
  display: flex;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
}

.upgrade-tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
}

.upgrade-tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: var(--bg-secondary);
}

.upgrade-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.upgrade-tab-content {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
  display: none;
}

.upgrade-tab-content.active {
  display: block;
}

/* Billing Toggle */
.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
}

.billing-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.billing-option input[type="radio"] {
  margin: 0;
}

.billing-option label {
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.savings-badge {
  background: #10b981;
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Subscription Tiers */
.subscription-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tier-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tier-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-4px);
  box-shadow: var(--shadow-heavy);
}

.tier-card.selected {
  border-color: var(--accent-blue);
  background: rgba(74,144,226,0.05);
}

.tier-card.current-tier {
  border-color: #10b981;
  background: rgba(16,185,129,0.05);
}

.tier-card.popular-tier {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.05);
}

.popular-badge {
  position: absolute;
  top: -1px;
  right: 1rem;
  background: #f59e0b;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.current-badge {
  position: absolute;
  top: -1px;
  right: 1rem;
  background: #10b981;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tier-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.tier-header h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.5rem;
}

.tier-price {
  margin-bottom: 0.5rem;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-blue);
}

.price-period {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

.annual-savings {
  color: #10b981;
  font-size: 0.9rem;
  font-weight: 600;
}

.tier-features {
  margin-bottom: 1.5rem;
}

.feature-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.feature-item:last-child {
  border-bottom: none;
}

.feature-name {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.feature-value {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.feature-item.included .feature-value {
  color: #10b981;
}

.feature-item.not-included .feature-value {
  color: var(--text-light);
}

.tier-action {
  text-align: center;
}

.tier-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.tier-btn.current {
  background: #10b981;
  cursor: default;
}

.tier-btn.current:hover {
  background: #10b981;
  transform: none;
}

/* Add-ons Grid */
.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.addon-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.addon-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.addon-card.selected {
  border-color: var(--accent-blue);
  background: rgba(74,144,226,0.05);
}

.addon-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.addon-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.addon-price {
  color: var(--accent-blue);
  font-size: 1.25rem;
  font-weight: 700;
}

.addon-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 1.5rem 0;
}

.addon-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.addon-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* Modal Footer */
.upgrade-modal-footer {
  padding: 2rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-providers {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.payment-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.payment-provider {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.payment-provider:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.upgrade-actions {
  display: flex;
  gap: 1rem;
}

.upgrade-btn {
  padding: 0.875rem 1.5rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 150px;
}

.upgrade-btn:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.upgrade-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
}

/* Animations */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Theme-specific styles for new themes */
.theme-crimson-gamer {
  /* Enhanced shadows and glows for gamer theme */
}

.theme-crimson-gamer .tier-card.popular-tier,
.theme-crimson-gamer .addon-card:hover {
  box-shadow: 0 8px 32px rgba(220,38,38,0.3);
}

.theme-dark-purple-tech {
  /* Neon accents for tech theme */
}

.theme-dark-purple-tech .upgrade-modal-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

.theme-dark-purple-tech .tier-card.popular-tier,
.theme-dark-purple-tech .addon-card:hover {
  box-shadow: 0 8px 32px rgba(139,92,246,0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
  .upgrade-modal-content {
    width: 95vw;
    max-height: 95vh;
  }
  
  .subscription-tiers {
    grid-template-columns: 1fr;
  }
  
  .addons-grid {
    grid-template-columns: 1fr;
  }
  
  .upgrade-modal-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .payment-providers {
    justify-content: center;
  }
  
  .upgrade-actions {
    justify-content: stretch;
  }
  
  .upgrade-btn {
    flex: 1;
  }
  
  .billing-toggle {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}