/* SaaS-specific styles - Dark Theme Compatible */
.plan-badge {
  margin-top: 15px;
  padding: 10px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-affiliate) 100%);
  border-radius: var(--radius-sm);
  text-align: center;
  color: white;
  box-shadow: var(--shadow-sm);
}

.plan-name {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.usage-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin: 8px 0 4px 0;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: var(--accent-success);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.plan-indicator {
  background: var(--accent-primary);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 10px;
}

.nav-count {
  background: var(--accent-danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

/* Auth page specific body styling - Dark Theme */
body.auth-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.login-container {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border-color);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-affiliate) 100%);
  color: white;
  margin-top: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.alert {
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: rgba(255, 77, 106, 0.1);
  border: 1px solid var(--accent-danger);
  color: var(--accent-danger);
}

.alert-success {
  background: rgba(45, 212, 160, 0.1);
  border: 1px solid var(--accent-success);
  color: var(--accent-success);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  text-decoration: underline;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1 {
  color: var(--text-primary);
  font-size: 28px;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.btn-full {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-affiliate) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-full:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
}

.auth-footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.plan-selection {
  margin: 20px 0;
}

.plan-selection h4 {
  margin-bottom: 15px;
  color: var(--text-primary);
}

.plan-info {
  background: var(--bg-tertiary);
  padding: 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-features li {
  padding: 4px 0;
  color: var(--text-secondary);
}

.plan-features li::before {
  content: "✓ ";
  color: var(--accent-success);
  font-weight: bold;
}

/* Dashboard specific styles - Dark Theme */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 20px 20px 0 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 15px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.action-btn:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.action-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.action-label {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.stat-icon {
  font-size: 24px;
}

.stat-info {
  flex: 1;
}

.stat-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-total {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.recent-posts {
  max-height: 300px;
  overflow-y: auto;
}

.post-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.post-status {
  font-size: 16px;
  margin-top: 2px;
}

.post-content {
  flex: 1;
}

.post-text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.post-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state p {
  margin-bottom: 15px;
}

.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(255, 77, 106, 0.1);
  border: 1px solid var(--accent-danger);
  color: var(--accent-danger);
}

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

.alert-content {
  flex: 1;
}

.alert-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.current-plan {
  text-align: center;
  margin-bottom: 15px;
}

.plan-name {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-affiliate) 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.usage-stats {
  margin: 15px 0;
}

.usage-item {
  margin-bottom: 12px;
}

.usage-label {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.usage-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}

.upgrade-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-affiliate) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

/* Accounts page styles */
.accounts-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-mini-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 140px;
}

.stat-mini-account.stat-success {
  border-color: var(--accent-success);
  background: rgba(45, 212, 160, 0.05);
}

.stat-mini-account.stat-warning {
  border-color: var(--accent-warning);
  background: rgba(245, 166, 35, 0.05);
}

.stat-mini-account.stat-danger {
  border-color: var(--accent-danger);
  background: rgba(255, 77, 106, 0.05);
}

.stat-mini-account.stat-muted {
  border-color: var(--text-muted);
  background: rgba(152, 152, 176, 0.05);
}

.stat-mini-icon {
  font-size: 20px;
}

.stat-mini-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-mini-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.usage-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
}

.usage-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-text {
  font-size: 14px;
  color: var(--text-primary);
}

.usage-limit-warning {
  font-size: 12px;
  color: var(--accent-warning);
  margin-top: 4px;
}

.usage-limit-warning a {
  color: var(--accent-primary);
  text-decoration: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-note {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(124, 106, 255, 0.05);
  border: 1px solid rgba(124, 106, 255, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

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

.note-content {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}

.note-content strong {
  color: var(--text-primary);
}

.note-content ol {
  margin: 8px 0 0 16px;
  padding: 0;
}

.note-content li {
  margin: 4px 0;
}

.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.account-item:hover {
  border-color: var(--border-glow);
}

.account-item.expired {
  border-color: var(--accent-danger);
  background: rgba(255, 77, 106, 0.05);
}

.account-item.expiring {
  border-color: var(--accent-warning);
  background: rgba(245, 166, 35, 0.05);
}

.account-item.active {
  border-color: var(--accent-success);
  background: rgba(45, 212, 160, 0.05);
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
}

.account-info {
  flex: 1;
}

.account-username {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.account-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.account-status {
  flex-shrink: 0;
}

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

.status-active {
  background: rgba(45, 212, 160, 0.2);
  color: var(--accent-success);
}

.status-expired {
  background: rgba(255, 77, 106, 0.2);
  color: var(--accent-danger);
}

.status-expiring {
  background: rgba(245, 166, 35, 0.2);
  color: var(--accent-warning);
}

.status-inactive {
  background: rgba(152, 152, 176, 0.2);
  color: var(--text-muted);
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refresh {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-info);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-refresh:hover {
  background: rgba(56, 189, 248, 0.2);
}

.btn-delete {
  background: rgba(255, 77, 106, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(255, 77, 106, 0.3);
}

.btn-delete:hover {
  background: rgba(255, 77, 106, 0.2);
}

.action-icon {
  font-size: 12px;
}

.btn-icon {
  margin-right: 6px;
}

/* Create Post page styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .form-group:nth-child(3),
.form-grid .btn-right-container {
  grid-column: 1 / -1;
}

.theme-display {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-style: italic;
}

.btn-glow {
  box-shadow: 0 0 20px rgba(124, 106, 255, 0.3);
}

.btn-glow:hover {
  box-shadow: 0 0 30px rgba(124, 106, 255, 0.5);
}

.btn-loader {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 6px;
}

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

.preview-content {
  margin-bottom: 24px;
}

.preview-main-post,
.preview-comment {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.preview-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.preview-user {
  flex: 1;
}

.preview-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.preview-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.preview-text {
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.preview-actions {
  display: flex;
  align-items: end;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.preview-actions .form-group {
  flex: 1;
  margin-bottom: 0;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-success) 0%, #22c55e 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(45, 212, 160, 0.3);
}

/* Queue page styles */
.queue-stats-dashboard {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card-queue {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 160px;
}

.stat-card-queue.stat-success {
  border-color: var(--accent-success);
  background: rgba(45, 212, 160, 0.05);
}

.stat-card-queue.stat-info {
  border-color: var(--accent-info);
  background: rgba(56, 189, 248, 0.05);
}

.queue-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.queue-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.queue-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.queue-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.tab-content {
  display: none;
}

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

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.account-info-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.account-info-content {
  display: flex;
  gap: 24px;
}

.account-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.queue-item:hover {
  border-color: var(--border-glow);
}

.queue-item-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.queue-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.queue-info {
  flex: 1;
}

.queue-account {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.queue-topic {
  color: var(--text-primary);
  margin: 4px 0;
}

.queue-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.queue-status {
  color: var(--accent-warning);
}

.queue-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.queue-content {
  padding: 0 16px 16px 16px;
  border-top: 1px solid var(--border-color);
}

.content-preview {
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  margin-top: 12px;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.setting-info {
  flex: 1;
}

.setting-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.setting-control {
  flex-shrink: 0;
  margin-left: 16px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--text-muted);
  transition: var(--transition);
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: var(--transition);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: var(--accent-primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

/* Queue controls */
.queue-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  width: 200px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
}

.bulk-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.queue-checkbox {
  margin-right: 12px;
}

.queue-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.btn-post {
  background: rgba(45, 212, 160, 0.1);
  color: var(--accent-success);
  border: 1px solid rgba(45, 212, 160, 0.3);
}

.btn-post:hover {
  background: rgba(45, 212, 160, 0.2);
}

.queue-status {
  color: var(--accent-warning);
  font-size: 12px;
}

/* Autopilot page styles */
.autopilot-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-mini-autopilot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 140px;
}

.stat-mini-autopilot.stat-success {
  border-color: var(--accent-success);
  background: rgba(45, 212, 160, 0.05);
}

.stat-mini-autopilot.stat-info {
  border-color: var(--accent-info);
  background: rgba(56, 189, 248, 0.05);
}

.stat-mini-autopilot.stat-muted {
  border-color: var(--text-muted);
  background: rgba(152, 152, 176, 0.05);
}

.theme-display-box {
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
}

.theme-display-box #selected-theme {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.theme-display-box #selected-theme-desc {
  color: var(--text-secondary);
  font-size: 14px;
}

.autopilot-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.autopilot-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: var(--transition);
}

.autopilot-item:hover {
  border-color: var(--border-glow);
}

.autopilot-item.active {
  border-color: var(--accent-success);
  background: rgba(45, 212, 160, 0.05);
}

.autopilot-item.inactive {
  border-color: var(--text-muted);
  background: rgba(152, 152, 176, 0.05);
}

.autopilot-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.autopilot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.autopilot-info {
  flex: 1;
}

.autopilot-account {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.autopilot-schedule {
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 14px;
}

.autopilot-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.autopilot-status {
  flex-shrink: 0;
  margin-right: 16px;
}

.autopilot-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-toggle {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-info);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-toggle:hover {
  background: rgba(56, 189, 248, 0.2);
}

.btn-edit {
  background: rgba(245, 166, 35, 0.1);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.btn-edit:hover {
  background: rgba(245, 166, 35, 0.2);
}

.autopilot-topics {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.topic-tag {
  background: var(--accent-primary);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  cursor: pointer;
  width: 44px;
  height: 24px;
  background: var(--text-muted);
  transition: var(--transition);
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: var(--transition);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: var(--accent-primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  color: var(--text-primary);
  font-weight: 500;
}

/* History page styles */
.table-wrapper {
  overflow-x: auto;
  margin: -20px;
  padding: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  color: var(--text-primary);
  font-size: 14px;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.topic-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-cell {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.action-buttons {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(45, 212, 160, 0.2);
  color: var(--accent-success);
}

.badge-pending {
  background: rgba(245, 166, 35, 0.2);
  color: var(--accent-warning);
}

.badge-failed {
  background: rgba(255, 77, 106, 0.2);
  color: var(--accent-danger);
}

.badge-queued {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-info);
}

.badge-scheduled {
  background: rgba(124, 106, 255, 0.2);
  color: var(--accent-primary);
}

.badge-type-organic {
  background: rgba(45, 212, 160, 0.2);
  color: var(--accent-success);
}

.badge-type-scheduled {
  background: rgba(124, 106, 255, 0.2);
  color: var(--accent-primary);
}

.card-footer {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

.btn-danger {
  background: rgba(255, 77, 106, 0.1);
  border: 1px solid var(--accent-danger);
  color: var(--accent-danger);
}

.btn-danger:hover {
  background: rgba(255, 77, 106, 0.2);
}

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

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h4 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: 14px;
}

.content-box {
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.comment-item strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.comment-item p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.info-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
}

/* Product page styles */
.product-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 140px;
}

.stat-card-product.stat-success {
  border-color: var(--accent-success);
  background: rgba(45, 212, 160, 0.05);
}

.stat-card-product.stat-info {
  border-color: var(--accent-info);
  background: rgba(56, 189, 248, 0.05);
}

.product-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.product-form-grid .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}

.product-form-grid .form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
}

.product-form-grid .form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.form-group textarea {
  resize: vertical;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: var(--transition);
}

.product-item:hover {
  border-color: var(--border-glow);
}

.product-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.product-info {
  flex: 1;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.product-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.product-link {
  margin-top: 8px;
}

.affiliate-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 12px;
  word-break: break-all;
}

.affiliate-link:hover {
  text-decoration: underline;
}

.product-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-generate {
  background: rgba(124, 106, 255, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(124, 106, 255, 0.3);
}

.btn-generate:hover {
  background: rgba(124, 106, 255, 0.2);
}

.generate-form {
  margin-bottom: 24px;
}

.selected-product {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
}

.variations-result {
  margin-top: 24px;
}

.variations-result h4 {
  color: var(--text-primary);
  margin-bottom: 16px;
}

.variations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.variation-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

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

.variation-header strong {
  color: var(--text-primary);
  font-size: 14px;
}

.variation-content {
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  font-size: 14px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-success) 0%, #22c55e 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(45, 212, 160, 0.3);
}

/* Product cards grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.product-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.product-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  margin-right: 12px;
}

.product-card-actions {
  display: flex;
  gap: 4px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.btn-icon:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
}

.btn-icon.btn-generate:hover {
  background: rgba(124, 106, 255, 0.1);
  border-color: var(--accent-primary);
}

.btn-icon.btn-edit:hover {
  background: rgba(245, 166, 35, 0.1);
  border-color: var(--accent-warning);
}

.btn-icon.btn-delete:hover {
  background: rgba(255, 77, 106, 0.1);
  border-color: var(--accent-danger);
}

.product-card-body {
  padding: 16px;
}

.product-card-body .product-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  font-size: 14px;
}

.product-card-body .affiliate-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 12px;
  word-break: break-all;
}

.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.product-date {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.product-status.active {
  background: rgba(45, 212, 160, 0.2);
  color: var(--accent-success);
}

/* Progress bar */
.progress-container {
  text-align: center;
  padding: 40px 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-affiliate));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

#progress-text {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* Variations result */
.variations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.variations-header h4 {
  color: var(--text-primary);
  margin: 0;
}

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

.variations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
}

.variation-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.variation-card .variation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.variation-number {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
}

.variation-card .variation-actions {
  display: flex;
  gap: 4px;
}

.variation-card .variation-actions .btn-icon {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.variation-card .variation-content {
  padding: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  font-size: 13px;
}

/* Range input styling */
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
}
/* Autopilot Specific Styles */
.autopilot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.autopilot-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(124, 106, 255, 0.1);
}

.autopilot-card.autopilot-active {
  border-color: var(--success-color);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(34, 197, 94, 0.05) 100%);
}

.autopilot-card.autopilot-inactive {
  opacity: 0.7;
  border-color: var(--border-muted);
}

.autopilot-header {
  margin-bottom: 16px;
}

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

.autopilot-username {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.autopilot-theme {
  margin-bottom: 12px;
}

.theme-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.autopilot-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ap-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.ap-stat-value {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-primary);
  margin-bottom: 2px;
}

.ap-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.autopilot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-right-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.badge-muted {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .autopilot-stats {
    gap: 16px;
  }
  
  .ap-stat {
    min-width: 60px;
  }
  
  .autopilot-actions {
    justify-content: center;
    margin-top: 16px;
  }
  
  .autopilot-stats-row {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .toggle-switch {
    scale: 0.9;
  }
}
/* Toggle Switch Alignment Fix */
.toggle-switch {
  vertical-align: middle !important;
}

.toggle-slider {
  flex-shrink: 0 !important;
}

.autopilot-actions > div {
  display: flex !important;
  align-items: center !important;
}

.autopilot-actions {
  align-items: center !important;
}
