/* User Profile Simple - Light Theme (matching app.html) */
:root {
  --primary: #1D3557;
  --accent: #E63946;
  --bg: #F1FAEE;
  --text: #333;
  --soft: #A8DADC;
  --bg-primary: #F1FAEE;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #333;
  --text-secondary: #666;
  --accent-primary: #1D3557;
  --accent-secondary: #E63946;
  --accent-warning: #ffa726;
  --accent-success: #66bb6a;
  --accent-error: #ef5350;
  --border-color: #e0e0e0;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Back Button */
.back-button {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 30px;
  padding: 10px 0;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.back-button:hover {
  color: var(--accent-secondary);
  transform: translateX(-5px);
}

/* Profile Header Card */
.profile-header-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  text-align: center;
}

.profile-user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.profile-user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 20px rgba(29, 53, 87, 0.3);
}

.profile-user-details h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.profile-user-details p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Account Link Actions */
.account-link-actions {
  margin: 20px 0 30px 0;
  text-align: center;
}

.connect-account-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  min-width: 200px;
  justify-content: center;
}

.connect-account-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(29, 53, 87, 0.4);
}

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

/* Content Grid */
.profile-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* Profile Cards */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-content {
  padding: 24px;
}

/* Subscription Card */
.subscription-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.plan-badge {
  background: var(--accent-warning);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  width: fit-content;
}

.plan-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.plan-value {
  color: var(--text-primary);
  font-weight: 500;
}

.upgrade-btn-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.upgrade-btn-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(29, 53, 87, 0.4);
}

.unsubscribe-btn-card {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  margin-top: 12px;
}

.unsubscribe-btn-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
  background: linear-gradient(135deg, #5a6268, #343a40);
}

/* Settings Card */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setting-icon {
  font-size: 18px;
}

.setting-label {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

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

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
}

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

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

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

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

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

/* Usage Card */
.usage-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.usage-value {
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
}

/* Activity Card */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.activity-item:hover {
  background: #404040;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border-color);
}

.activity-details {
  flex: 1;
}

.activity-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .profile-container {
    padding: 16px;
  }
  
  .profile-content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .profile-header-card {
    padding: 24px;
  }
  
  .profile-user-avatar {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
  
  .profile-user-details h2 {
    font-size: 24px;
  }
  
  .card-content {
    padding: 20px;
  }
}

/* Loading State */
body.loading {
  cursor: wait;
}

body.loading .profile-card {
  opacity: 0.7;
  pointer-events: none;
}

body.loading .profile-user-avatar {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Chart Settings Styles */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.setting-item:hover {
  background: var(--bg-primary);
  border-color: var(--accent-primary);
}

.setting-info {
  flex: 1;
}

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

.setting-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.toggle-switch.active {
  background: var(--accent-primary);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: left 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active::after {
  left: 24px;
}

/* Special styling for signal settings */
#bullishSignalSetting,
#bearishSignalSetting {
  border-left: 4px solid var(--accent-primary);
  background: rgba(29, 53, 87, 0.05);
}

#bullishSignalSetting:hover,
#bearishSignalSetting:hover {
  background: rgba(29, 53, 87, 0.1);
}

/* Hide specific cards from the user profile */
.profile-card:has(.card-header h3:contains("⚙️ Settings")),
.profile-card:has(.card-header h3:contains("📊 Usage Today")),
.profile-card:has(.card-header h3:contains("🕐 Recent Activity")),
.profile-card:has(.card-header h3:contains("📊 Chart Display Settings")) {
  display: none;
}

/* Alternative approach using nth-child (more reliable across browsers) */
.profile-content-grid .profile-card:nth-child(2), /* Settings Card */
.profile-content-grid .profile-card:nth-child(3), /* Usage Today Card */
.profile-content-grid .profile-card:nth-child(4), /* Recent Activity Card */
.profile-content-grid .profile-card:nth-child(5)  /* Chart Display Settings Card */ {
  display: none;
}

/* Manage subscription button styling */
.setting-description {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.setting-action-btn {
  background: #1D3557;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.setting-action-btn:hover {
  background: #14293d;
  transform: translateY(-1px);
}

/* Manage Subscription Button Styling */
.manage-subscription {
  background: linear-gradient(135deg, #666 0%, #888 100%) !important;
  color: white !important;
}

.manage-subscription:hover {
  background: linear-gradient(135deg, #555 0%, #777 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Subscription Management Modal */
.subscription-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.subscription-modal-content {
  background-color: #ffffff;
  margin: 5% auto;
  padding: 0;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

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

.subscription-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px;
  background: linear-gradient(135deg, #1D3557 0%, #E63946 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.subscription-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.subscription-modal-close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 8px;
  transition: opacity 0.2s;
}

.subscription-modal-close:hover {
  opacity: 0.7;
}

.subscription-modal-body {
  padding: 30px;
}

.current-plan {
  margin-bottom: 30px;
}

.current-plan h3 {
  color: #1D3557;
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.plan-description {
  color: #666;
  margin-bottom: 20px;
  font-size: 1rem;
}

.plan-features {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.feature {
  padding: 8px 0;
  color: #1D3557;
  font-weight: 500;
}

.subscription-actions {
  border-top: 1px solid #eee;
  padding-top: 20px;
  margin-bottom: 20px;
}

.subscription-actions h3 {
  color: #1D3557;
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.action-buttons {
  display: grid;
  gap: 12px;
}

.action-buttons button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.downgrade-btn {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white;
}

.downgrade-btn:hover {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  transform: translateY(-1px);
}

.cancel-btn {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
}

.cancel-btn:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: translateY(-1px);
}

.support-btn {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
}

.support-btn:hover {
  background: linear-gradient(135deg, #2980b9 0%, #1f4e79 100%);
  transform: translateY(-1px);
}

.subscription-info {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #1D3557;
}

.subscription-info p {
  margin: 4px 0;
  color: #666;
}

.subscription-info small {
  color: #888;
}

/* Dark mode support */
[data-theme="dark"] .subscription-modal-content {
  background-color: #2c3e50;
  color: #ecf0f1;
}

[data-theme="dark"] .current-plan h3,
[data-theme="dark"] .subscription-actions h3 {
  color: #ecf0f1;
}

[data-theme="dark"] .plan-description {
  color: #bdc3c7;
}

[data-theme="dark"] .feature {
  color: #ecf0f1;
}

[data-theme="dark"] .subscription-actions {
  border-top-color: #34495e;
}

[data-theme="dark"] .subscription-info {
  background: #34495e;
  border-left-color: #3498db;
}

[data-theme="dark"] .subscription-info p {
  color: #bdc3c7;
}

[data-theme="dark"] .subscription-info small {
  color: #95a5a6;
}

/* Admin Tools Styling */
.admin-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 80px;
}

.admin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
  background: linear-gradient(135deg, #c0392b, #a93226);
}

.admin-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#adminResults {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  white-space: pre-wrap;
  word-wrap: break-word;
}

[data-theme="dark"] #adminResults {
  background: #34495e;
  border: 1px solid #4a5f7a;
  color: #ecf0f1;
}

/* Schwab Portfolio Section Styling */
#schwabPortfolioSection {
  background-color: #eef2f7;
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
  border: 1px solid #d1dce5;
}

#schwabPortfolioSection .card-header {
  background: transparent;
  padding: 0 0 16px 0;
  border-bottom: 1px solid #d1dce5;
  margin-bottom: 16px;
}

#schwabPortfolioSection .card-content {
  padding: 0;
}

.schwab-portfolio-container {
  overflow-x: auto;
}

.schwab-portfolio-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.schwab-portfolio-table th {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border: none;
}

.schwab-portfolio-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e9ecef;
  font-size: 14px;
  color: var(--text-primary);
}

.schwab-portfolio-table tbody tr:last-child td {
  border-bottom: none;
}

.schwab-portfolio-table tbody tr:hover {
  background-color: #f8f9fa;
}

.symbol-cell {
  font-weight: 600;
  color: var(--primary);
}

/* Enhanced instrument display styling */
.symbol-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.instrument-badge {
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--background-secondary);
  border: 1px solid var(--border-light);
  min-width: 24px;
  text-align: center;
}

.instrument-badge.stock {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-color: #2196f3;
}

.instrument-badge.option {
  background: linear-gradient(135deg, #fff3e0, #ffcc80);
  border-color: #ff9800;
}

.instrument-badge.bond {
  background: linear-gradient(135deg, #f3e5f5, #ce93d8);
  border-color: #9c27b0;
}

.instrument-badge.fund {
  background: linear-gradient(135deg, #e8f5e8, #a5d6a7);
  border-color: #4caf50;
}

.instrument-badge.etf {
  background: linear-gradient(135deg, #e0f2f1, #80cbc4);
  border-color: #009688;
}

.instrument-badge.cash {
  background: linear-gradient(135deg, #f1f8e9, #c5e1a5);
  border-color: #8bc34a;
}

.symbol-text {
  font-size: 14px;
  line-height: 1.2;
}

/* Dark mode support for instrument badges */
[data-theme="dark"] .instrument-badge {
  background: var(--background-tertiary);
  border-color: var(--border-dark);
  color: var(--text-primary);
}

/* New analysis columns styling */
.sentiment-cell,
.trade-level-cell,
.range-cell {
  text-align: center;
  padding: 8px 12px;
}

.sentiment-badge,
.trade-level-badge,
.range-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 70px;
  text-align: center;
}

/* Sentiment badges */
.sentiment-badge.bullish {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  border: 1px solid #28a745;
}

.sentiment-badge.bearish {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  border: 1px solid #dc3545;
}

.sentiment-badge.neutral {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
  border: 1px solid #ffc107;
}

.sentiment-badge.error {
  background: linear-gradient(135deg, #fdcf9b, #f7b267);
  color: #9c4221;
  border: 1px solid #fd7e14;
}

/* Trade level badges */
.trade-level-badge.strong-buy {
  background: linear-gradient(135deg, #d1ecf1, #bee5eb);
  color: #0c5460;
  border: 1px solid #17a2b8;
}

.trade-level-badge.buy {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  border: 1px solid #28a745;
}

.trade-level-badge.hold {
  background: linear-gradient(135deg, #e2e3e5, #d1d3d4);
  color: #383d41;
  border: 1px solid #6c757d;
}

.trade-level-badge.sell {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
  border: 1px solid #ffc107;
}

.trade-level-badge.strong-sell {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  border: 1px solid #dc3545;
}

/* Range badges */
.range-badge.buy-zone {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  border: 1px solid #28a745;
}

.range-badge.sell-zone {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  border: 1px solid #dc3545;
}

.range-badge.neutral-zone {
  background: linear-gradient(135deg, #e2e3e5, #d1d3d4);
  color: #383d41;
  border: 1px solid #6c757d;
}

/* Loading state */
.sentiment-badge.loading,
.trade-level-badge.loading,
.range-badge.loading {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  color: #6c757d;
  border: 1px solid #dee2e6;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Error state */
.trade-level-badge.error,
.range-badge.error {
  background: linear-gradient(135deg, #fdcf9b, #f7b267);
  color: #9c4221;
  border: 1px solid #fd7e14;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Dark mode support for new badges */
[data-theme="dark"] .sentiment-badge,
[data-theme="dark"] .trade-level-badge,
[data-theme="dark"] .range-badge {
  filter: brightness(0.8);
}

[data-theme="dark"] .sentiment-badge.loading,
[data-theme="dark"] .trade-level-badge.loading,
[data-theme="dark"] .range-badge.loading {
  background: linear-gradient(135deg, #343a40, #495057);
  color: #adb5bd;
  border: 1px solid #495057;
}

[data-theme="dark"] .instrument-badge.stock {
  background: rgba(33, 150, 243, 0.2);
  border-color: #2196f3;
}

[data-theme="dark"] .instrument-badge.option {
  background: rgba(255, 152, 0, 0.2);
  border-color: #ff9800;
}

[data-theme="dark"] .instrument-badge.bond {
  background: rgba(156, 39, 176, 0.2);
  border-color: #9c27b0;
}

[data-theme="dark"] .instrument-badge.fund {
  background: rgba(76, 175, 80, 0.2);
  border-color: #4caf50;
}

[data-theme="dark"] .instrument-badge.etf {
  background: rgba(0, 150, 136, 0.2);
  border-color: #009688;
}

[data-theme="dark"] .instrument-badge.cash {
  background: rgba(139, 195, 74, 0.2);
  border-color: #8bc34a;
}

.quantity-cell,
.market-value-cell,
.cost-basis-cell {
  text-align: right;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.market-value-cell {
  color: var(--accent-success);
  font-weight: 500;
}

.cost-basis-cell {
  color: var(--text-secondary);
}

.last-updated-cell {
  color: var(--text-secondary);
  font-size: 13px;
}

/* No holdings message styling */
.no-holdings-message,
.error-message {
  text-align: center;
  padding: 40px 20px;
}

.no-holdings-content,
.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.no-holdings-icon,
.error-icon {
  font-size: 32px;
  opacity: 0.6;
}

.no-holdings-text {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 300px;
  line-height: 1.5;
}

.error-text {
  color: var(--accent-error);
  font-size: 14px;
  max-width: 300px;
  line-height: 1.5;
}

/* Schwab portfolio actions */
.schwab-portfolio-actions {
  margin-top: 16px;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid #d1dce5;
}

.refresh-schwab-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  justify-content: center;
}

.refresh-schwab-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 53, 87, 0.3);
}

.refresh-schwab-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.refresh-schwab-btn.loading {
  background: #95a5a6;
  cursor: wait;
}

.refresh-schwab-btn.loading .refresh-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Refresh feedback styling */
.refresh-feedback {
  display: none;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  animation: fadeIn 0.3s ease-in;
}

.refresh-feedback.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.refresh-feedback.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.refresh-feedback .feedback-icon {
  margin-right: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark mode support for Schwab portfolio */
[data-theme="dark"] #schwabPortfolioSection {
  background-color: #2c3e50;
  border-color: #34495e;
}

[data-theme="dark"] #schwabPortfolioSection .card-header {
  border-bottom-color: #34495e;
}

[data-theme="dark"] .schwab-portfolio-table {
  background: #34495e;
}

[data-theme="dark"] .schwab-portfolio-table td {
  color: #ecf0f1;
  border-bottom-color: #4a5f7a;
}

[data-theme="dark"] .schwab-portfolio-table tbody tr:hover {
  background-color: #3a4e63;
}

[data-theme="dark"] .symbol-cell {
  color: #3498db;
}

[data-theme="dark"] .no-holdings-text,
[data-theme="dark"] .last-updated-cell,
[data-theme="dark"] .cost-basis-cell {
  color: #bdc3c7;
}

[data-theme="dark"] .schwab-portfolio-actions {
  border-top-color: #34495e;
}

/* Dark mode support for refresh feedback */
[data-theme="dark"] .refresh-feedback.success {
  background-color: #1e3a2e;
  color: #a3d9a5;
  border-color: #2d5a3d;
}

[data-theme="dark"] .refresh-feedback.error {
  background-color: #3a1e20;
  color: #f5b7b1;
  border-color: #5a2d2f;
}

/* Responsive design for Schwab table */
@media (max-width: 768px) {
  #schwabPortfolioSection {
    margin-top: 20px;
    padding: 12px;
  }
  
  .schwab-portfolio-table th,
  .schwab-portfolio-table td {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .schwab-portfolio-table th {
    font-size: 12px;
  }
  
  .no-holdings-icon,
  .error-icon {
    font-size: 24px;
  }
  
  .no-holdings-text,
  .error-text {
    font-size: 13px;
  }
}

/* Debug Section Styles */
.debug-section {
  margin-top: 20px;
  border: 2px dashed #ff9800;
  background: #fff3e0;
}

.debug-section .card-header {
  background: #ff9800;
  color: white;
}

.debug-section .card-header h3 {
  color: white;
}

.raw-data-container {
  margin: 15px 0;
}

.raw-data-display {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
  color: #333;
}

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

.debug-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.debug-btn:hover {
  background: #f57c00;
}

.debug-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Dark mode support for debug section */
[data-theme="dark"] .debug-section {
  background: #2c1810;
  border-color: #ff9800;
}

[data-theme="dark"] .raw-data-display {
  background: #1e1e1e;
  border-color: #444;
  color: #e0e0e0;
}

/* Account Selector Styles */
.account-selector {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  min-width: 200px;
  cursor: pointer;
  transition: var(--transition);
}

.account-selector:hover {
  border-color: var(--accent-primary);
}

.account-selector:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(29, 53, 87, 0.1);
}

/* Dark mode support for account selector */
[data-theme="dark"] .account-selector {
  background: #2a2a2a;
  border-color: #555;
  color: #e0e0e0;
}

[data-theme="dark"] .account-selector:hover {
  border-color: var(--accent-primary);
}
