/* Enhanced quantity selector styling */
.quantity-selector {
  margin-bottom: 1rem;
}

.quantity-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #1f2937;
}

.quantity-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.quantity-btn {
  background-color: #ffffff;
  border: 2px solid #000000;
  color: #000000;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background-color: #000000;
  color: #ffffff;
}

.quantity-input {
  width: 60px;
  text-align: center;
  padding: 6px;
  border: 2px solid #000000;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.total-cost {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
}/* Tarr Billing Modal Styles */

/* Billing Modal Content */
#billing-modal .modal-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Billing Sections */
.billing-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.billing-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.billing-section h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  border-bottom: 2px solid #000000;
  padding-bottom: 0.5rem;
}

/* Dark mode support for billing modal */
body.dark-mode .billing-section h3 {
  color: #ffffff !important;
  border-bottom: 2px solid #ffffff;
}

body.dark-mode .plan-description {
  color: #a0a0a0;
}

body.dark-mode .usage-count {
  color: #a0a0a0;
}

body.dark-mode .usage-label {
  color: #ffffff;
}

body.dark-mode .account-info p {
  color: #e0e0e0;
}

body.dark-mode .account-info strong {
  color: #ffffff;
}

body.dark-mode .action-description {
  color: #a0a0a0;
}

body.dark-mode .paid-minutes {
  color: #e0e0e0;
}

/* Plan Information */
.plan-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  width: fit-content;
  font-size: 0.875rem;
}

.plan-badge.free {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #000000;
}

.plan-badge.paid {
  background-color: transparent;
  color: #374151;
  border: none;
}

.plan-badge.active {
  background-color: transparent;
  color: #374151;
  border: none;
}

.plan-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-status.active {
  background-color: #22c55e;
  color: #000000;
}

.plan-description {
  margin: 0;
  color: #6b7280;
  line-height: 1.5;
  font-size: 0.875rem;
}

/* Usage Items */
.usage-item {
  margin-bottom: 1.5rem;
}

.usage-item:last-child {
  margin-bottom: 0;
}

.usage-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.usage-count {
  font-size: 0.75rem;
  color: #6b7280;
  font-family: 'IBM Plex Mono', monospace;
}

.usage-bar {
  height: 8px;
  background-color: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background-color: #000000;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.usage-fill.warning {
  background-color: #666666;
}

.usage-fill.full {
  background-color: #000000;
}

.paid-minutes {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #000000;
  font-weight: 500;
}

/* Enhanced action items with better visual hierarchy */
.action-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 2px solid #000000;
  border-radius: 0.5rem;
  background-color: #ffffff;
  transition: all 0.2s ease;
}

.action-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.action-item:last-child {
  margin-bottom: 0;
}

.action-description {
  margin: 0.5rem 0 0 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}

/* Modal Buttons - Black and White Only */
.modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid #000000;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background-color: #ffffff;
  color: #000000;
}

.modal-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #666666;
  color: #666666;
}

.modal-btn:hover:not(:disabled) {
  background-color: #000000;
  color: #ffffff;
}

.modal-btn.upgrade-btn {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
}

.modal-btn.upgrade-btn:hover:not(:disabled) {
  background-color: #ffffff;
  color: #000000;
  border-color: #000000;
}

.modal-btn.credits-btn {
  background-color: #ffffff;
  color: #000000;
  border-color: #000000;
}

.modal-btn.credits-btn:hover:not(:disabled) {
  background-color: #000000;
  color: #ffffff;
}

.modal-btn.logout-btn {
  background-color: #ffffff;
  color: #000000;
  border-color: #000000;
}

.modal-btn.logout-btn:hover:not(:disabled) {
  background-color: #000000;
  color: #ffffff;
}

/* Account Information */
.account-info {
  margin-bottom: 1rem;
}

.account-info p {
  margin: 0.5rem 0;
  color: #374151;
  font-size: 0.875rem;
}

.account-info strong {
  color: #1f2937;
}

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

/* Billing Modal Loading Spinner */
.billing-loading-spinner {
  width: 32px !important;
  height: 32px !important;
  border: 3px solid rgba(0, 0, 0, 0.1) !important;
  border-top: 3px solid #000000 !important;
  border-radius: 50% !important;
  animation: billingSpinnerRotate 1s linear infinite !important;
  margin: 0 auto 1rem auto !important;
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
  /* Force hardware acceleration for smooth animation */
  will-change: transform !important;
  /* Ensure no other properties interfere with animation */
  background: transparent !important;
}

body.dark-mode .billing-loading-spinner {
  border: 3px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 3px solid #ffffff !important;
}

#billing-loading {
  text-align: center;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

#billing-loading .billing-loading-spinner {
  margin: 0 auto 1.5rem auto;
}

#billing-loading p {
  margin: 0;
  color: #000000;
  font-size: 0.9rem;
  font-family: 'IBM Plex Mono', monospace;
}

body.dark-mode #billing-loading p {
  color: #ffffff;
}

@keyframes billingSpinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
  text-align: center;
  color: #dc2626;
  padding: 1rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
}

.error-message p {
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Usage Tracker Styles */
#usage-indicator {
  user-select: none;
}

#usage-indicator:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 640px) {
  #billing-modal .modal-content {
    max-width: 95vw;
    margin: 1rem;
    max-height: 85vh;
  }
  
  .plan-badge {
    font-size: 0.75rem;
  }
  
  .usage-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .account-actions {
    flex-direction: column;
  }
  
  .modal-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
  }
  
  .action-description {
    font-size: 0.7rem;
  }
  
  /* Adjust usage indicator for mobile */
  #usage-indicator {
    top: 10px;
    left: 10px;
    padding: 6px 10px;
    font-size: 11px;
  }
  
  #usage-indicator .usage-icon {
    font-size: 14px;
  }
  
  #usage-indicator #usage-stt {
    font-size: 10px;
  }
  
  #usage-indicator #usage-plan {
    font-size: 9px;
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Ensure modal shows properly */
.modal.active {
  display: flex !important;
}
