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

/* Better touch handling for mobile */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  scroll-behavior: smooth;
}

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1e1e1e;
  --bg-card: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent-primary: #404040;
  --accent-hover: #525252;
  --success: #525252;
  --danger: #525252;
  --border-color: #262626;
  --border-hover: #404040;
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-elevated: rgba(0, 0, 0, 0.8);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
  letter-spacing: 0.01em;
  padding-top: 70px;
}

/* Top Navigation Bar */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-container {
  max-width: 100%;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1;
}

.navbar-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Hide navbar-menu since we now use sidebar for navigation */
.navbar-menu {
  display: none;
}

.navbar-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  white-space: nowrap;
  position: relative;
}

.navbar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.navbar-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Left Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 70px;
  left: 0;
  width: 220px;
  height: calc(100vh - 70px);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 900;
  overflow-y: auto;
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  text-align: left;
  width: 100%;
  position: relative;
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-link:hover svg {
  opacity: 1;
}

.sidebar-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-link[data-premium="true"]::after {
  content: "⭐";
  font-size: 0.7rem;
  margin-left: auto;
  opacity: 0.7;
}

/* Hide premium stars when user is premium */
body.is-premium .sidebar-link[data-premium="true"]::after {
  display: none;
}

/* Sidebar Groups and Subtabs */
.sidebar-group {
  margin-bottom: 4px;
}

.sidebar-subtabs {
  display: none;
  flex-direction: column;
  padding-left: 32px;
  margin-top: 2px;
  margin-bottom: 8px;
}

.sidebar-group:has(.sidebar-link.active) .sidebar-subtabs {
  display: flex;
}

.sidebar-subtab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  text-align: left;
  width: 100%;
  position: relative;
}

.sidebar-subtab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-subtab.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-subtab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--text-primary);
  border-radius: 1px;
}

/* Sidebar Settings Section (visible on mobile/tablet) */
.sidebar-settings {
  display: none;
  padding: 0.5rem 1rem 1rem;
  margin-top: auto;
}

.sidebar-divider {
  height: 1px;
  background: var(--bg-tertiary);
  margin: 0.5rem 0 1rem;
}

.sidebar-settings-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.sidebar-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sidebar-setting-item label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sidebar-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  min-width: 100px;
  transition: all 0.2s;
}

.sidebar-select:hover {
  border-color: var(--text-muted);
}

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

.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.sidebar-settings-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.sidebar-settings-btn svg {
  flex-shrink: 0;
}

/* Sidebar User Section */
.sidebar-user-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.sidebar-user-info .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-user-info .user-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-info .user-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.sidebar-user-info .user-badge.premium {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-login-btn {
  background: var(--accent-primary);
  color: #fff;
}

.sidebar-login-btn:hover {
  background: var(--accent-hover);
}

.sidebar-logout-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

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

.sidebar-upgrade-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.sidebar-upgrade-btn:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

/* Show sidebar settings on tablet/mobile */
@media (max-width: 1024px) {
  .sidebar-settings {
    display: block;
  }
}

/* Main content wrapper - shifts content for sidebar */
.main-content-wrapper {
  margin-left: 220px;
  min-height: calc(100vh - 70px);
  transition: margin-left 0.3s ease;
}

/* Sidebar responsive behavior */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content-wrapper {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    top: 56px;
    height: calc(100vh - 56px);
  }
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 899;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    top: 56px;
  }
}

.navbar-link[data-premium="true"]::after,
button[data-premium="true"]::after {
  content: "⭐";
  font-size: 0.7rem;
  margin-left: 4px;
  opacity: 0.7;
}

/* Hide premium stars when user is premium */
body.is-premium .navbar-link[data-premium="true"]::after,
body.is-premium button[data-premium="true"]::after {
  display: none;
}

.locked-btn {
  opacity: 0.6;
  cursor: not-allowed;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 1;
  min-width: 0;
}

/* Auto-refresh Status Indicator */
.auto-refresh-status {
  display: flex;
  align-items: center;
}

.refresh-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.9rem;
}

.refresh-indicator.refreshing {
  animation: spin 1s linear infinite;
}

.refresh-indicator.active {
  color: #10b981;
}

.refresh-indicator.inactive {
  color: var(--text-muted);
}

.refresh-text {
  margin-left: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

  to {
    transform: rotate(360deg);
  }
}

/* Sync Status Indicator */
.sync-status {
  display: flex;
  align-items: center;
}

.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sync-indicator:hover {
  border-color: var(--border-hover);
}

.sync-icon {
  font-size: 1rem;
}

.sync-text {
  color: var(--text-secondary);
  font-weight: 500;
}

.sync-indicator.syncing .sync-icon {
  animation: syncPulse 1.5s ease-in-out infinite;
}

.sync-indicator.syncing .sync-text {
  color: #3b82f6;
}

.sync-indicator.synced .sync-text {
  color: #10b981;
}

.sync-indicator.sync-error .sync-text {
  color: #ef4444;
}

@keyframes syncPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.navbar-item select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.navbar-item select:hover {
  border-color: var(--border-hover);
}

.navbar-item select:focus {
  border-color: var(--text-primary);
}

.navbar-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* SVG Icon Styles */
.navbar-icon-btn svg,
.mobile-menu-toggle svg {
  transition: all 0.2s ease;
}

.sync-icon svg {
  width: 16px;
  height: 16px;
}

.cache-status-icon svg,
.guest-mode-icon svg {
  stroke: currentColor;
}

.edit-btn svg {
  stroke: currentColor;
}

.metric-icon svg {
  stroke: currentColor;
  opacity: 0.7;
}

.navbar-user {
  display: flex;
  align-items: center;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.mobile-menu-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.mobile-menu-overlay.active {
  display: block;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu .navbar-link {
  display: block;
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
}

.mobile-menu .navbar-link:last-of-type {
  border-bottom: none;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0;
}

.mobile-menu-user-section {
  padding: 16px 20px;
}

.mobile-menu-user-section .mobile-signin-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.mobile-menu-user-section .mobile-signin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mobile-menu-user-section .mobile-user-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu-user-section .mobile-user-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-user-section .mobile-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.mobile-menu-user-section .mobile-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.mobile-menu-user-section .mobile-badge.premium {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.mobile-menu-user-section .mobile-badge.free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.mobile-menu-user-section .mobile-user-actions {
  display: flex;
  gap: 10px;
}

.mobile-menu-user-section .mobile-user-actions button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-user-section .mobile-upgrade-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.mobile-menu-user-section .mobile-logout-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Responsive navbar */
@media (max-width: 1024px) {
  .navbar-menu {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .navbar-logo h1 {
    font-size: 1rem;
  }

  /* Hide sync status on tablets */
  .sync-status {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .top-navbar {
    height: 56px;
  }

  body {
    padding-top: 56px;
  }

  .mobile-menu,
  .mobile-menu-overlay {
    top: 56px;
  }

  .navbar-container {
    padding: 0 10px;
  }

  .navbar-left {
    gap: 8px;
  }

  .navbar-logo h1 {
    font-size: 0.9rem;
  }

  /* Show only user info on mobile - other controls hidden */
  .navbar-right {
    display: flex !important;
  }

  /* Hide these items on mobile - they're in the sidebar now */
  .navbar-right .sync-status,
  .navbar-right .profile-selector-compact,
  .navbar-right .currency-selector-compact,
  .navbar-right #manageProfilesBtn,
  .navbar-right #userInfoContainer {
    display: none !important;
  }

  .main-content-wrapper .container {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .navbar-logo h1 {
    font-size: 0;
  }

  .navbar-logo h1 img {
    display: block;
  }

  .navbar-logo h1 a {
    font-size: 0;
  }

  .navbar-logo h1 a img {
    height: 24px !important;
  }

  .navbar-container {
    padding: 0 6px;
  }

  .navbar-right {
    gap: 4px;
  }
}

/* Extra small screens - 360px and below */
@media (max-width: 360px) {
  .navbar-right {
    gap: 2px;
  }
}

/* Main content wrapper - shifts content for sidebar */
.main-content-wrapper .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* User Info Styles */
#userInfoContainer .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

#userInfoContainer .username {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

#userInfoContainer .upgrade-btn,
#userInfoContainer .manage-btn,
#userInfoContainer .logout-btn {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

#userInfoContainer .upgrade-btn {
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
}

#userInfoContainer .upgrade-btn:hover {
  background: var(--text-secondary);
}

#userInfoContainer .manage-btn,
#userInfoContainer .logout-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

#userInfoContainer .manage-btn:hover,
#userInfoContainer .logout-btn:hover {
  background: var(--bg-primary);
}

.profile-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-selector label {
  color: var(--text-secondary);
  font-weight: 500;
}

.profile-selector select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-selector select:hover {
  border-color: var(--border-hover);
}

.profile-selector select:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.manage-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.manage-btn:active {
  transform: scale(0.98);
}

.currency-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.currency-selector label {
  color: var(--text-secondary);
  font-weight: 500;
}

.currency-selector select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.currency-selector select:hover {
  border-color: var(--border-hover);
}

.currency-selector select:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

/* Tab Content */
.tab-content-wrapper {
  position: relative;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Balance Section */
.balance-section {
  margin-bottom: 30px;
}

.balance-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%), var(--bg-secondary);
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  border: 1px solid rgba(102, 126, 234, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.balance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
}

.balance-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  font-weight: 500;
}

.balance-amount {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.balance-changes-container {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.balance-change-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.change-period {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-change {
  font-size: 1rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.balance-change.positive {
  color: #10b981;
}

.balance-change.negative {
  color: #ef4444;
}

/* Chart Section */
.chart-section {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.3s ease;
}

.chart-section:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

.chart-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.timeframe-buttons {
  display: flex;
  gap: 10px;
}

.timeframe-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.timeframe-btn:hover {
  background: var(--accent-primary);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.timeframe-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chart-container {
  position: relative;
  height: 400px;
}

/* Trades Section */
.connections-section,
.trades-section,
.all-trades-section,
.holdings-section,
.trade-history-section {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.3s ease;
}

.connections-section:hover,
.trades-section:hover,
.all-trades-section:hover,
.holdings-section:hover,
.trade-history-section:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

.connections-header h2 {
  font-size: 1.5rem;
}

.connection-buttons {
  display: flex;
  gap: 10px;
}

.connections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.connections-column h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

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

.connection-item {
  background: var(--bg-tertiary);
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.connection-item:hover {
  border-color: rgba(102, 126, 234, 0.3);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.connection-info {
  flex: 1;
}

.connection-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-badge {
  font-size: 1.2rem;
}

.connection-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-address {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
}

.visibility-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.visibility-toggle:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.visibility-toggle svg {
  width: 16px;
  height: 16px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.status-indicator.loading {
  background: #f59e0b;
}

.status-indicator.error {
  background: var(--danger);
}

.no-connections {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px;
  font-size: 0.95rem;
}

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

.holdings-header {
  margin-bottom: 20px;
}

.holdings-header h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

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

.holdings-subtitle a {
  color: var(--accent);
  text-decoration: none;
}

.holdings-subtitle a:hover {
  text-decoration: underline;
}

.trades-header h2,
.all-trades-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.holdings-list,
.trades-list {
  display: grid;
  gap: 15px;
}

.holding-item,
.trade-item {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto 40px auto;
  align-items: center;
  gap: 20px;
  transition: all 0.2s ease;
}

.holding-item:hover,
.trade-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.holding-crypto,
.trade-crypto {
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: capitalize;
}

.holding-amount,
.trade-amount {
  color: var(--text-secondary);
}

.holding-value,
.trade-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.trade-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.trade-type {
  padding: 4px 12px;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trade-type.buy {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.trade-type.sell {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.trade-source {
  font-size: 1.2rem;
  text-align: center;
  cursor: help;
}

.delete-btn {
  background: var(--text-secondary);
  color: var(--bg-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.delete-btn:hover {
  background: var(--text-primary);
}

.delete-btn:active {
  transform: scale(0.98);
}

.no-trades {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
  font-size: 1.1rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 0.95rem;
  min-height: 44px;
  /* Minimum touch target size for mobile */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--accent-primary);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

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

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
  border: 1px solid var(--border-color);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
}

.modal-header h2 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-content form,
.modal-content>div:not(.modal-header) {
  padding: 2rem;
}
}

.close {
  color: var(--text-secondary);
  font-size: 2rem;
  font-weight: 400;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: none;
  border: none;
}

.close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  transform: scale(1.1);
}

.close:active {
  transform: scale(1);
}

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

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: var(--bg-card);
}

/* Prevent zoom on iOS when focusing inputs */
@media screen and (max-width: 768px) {

  .form-group input,
  .form-group select {
    font-size: 16px;
    /* Prevents auto-zoom on iOS */
  }
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Validation error styling */
.validation-error {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.form-group input.error,
.form-group select.error {
  border-color: #ef4444;
}

.form-group input:invalid {
  border-color: var(--border-color);
  /* Don't show red until submission */
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.form-actions button {
  flex: 1;
}

.alert-box {
  background: var(--bg-tertiary);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid rgba(239, 68, 68, 0.5);
}

.alert-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.alert-box ul {
  margin-left: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.alert-box ul li {
  margin-bottom: 4px;
}

/* API Setup Links */
.api-setup-links {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
}

.api-setup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

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

.setup-prompt {
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  font-size: 0.95rem;
}

.setup-link-container {
  display: flex;
  justify-content: center;
}

.setup-link {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 0.95rem;
}

.setup-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  text-decoration: none;
}

/* Wide modal for exchange guide */
.modal-content.wide-modal {
  max-width: 800px;
}

/* Source badges */
.source-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.source-badge.manual {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.source-badge.wallet {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.source-badge.exchange {
  background: var(--text-muted);
  color: var(--bg-primary);
}

/* Profile badge for ALL profile view */
.profile-badge {
  display: inline;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-color);
  opacity: 0.85;
}

/* Analytics Section */
.analytics-section {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.3s ease;
}

.analytics-section:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.analytics-header {
  margin-bottom: 25px;
}

.analytics-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

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

.analytics-card {
  background: var(--bg-tertiary);
  padding: 1.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.analytics-card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.analytics-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pie-chart-container {
  max-width: 400px;
  margin: 0 auto 20px;
  height: 300px;
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: 2px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 0;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.legend-label {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.legend-token {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-percentage {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Performance Analytics Section */
.performance-section {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.3s ease;
}

.performance-section:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.performance-header {
  margin-bottom: 1.5rem;
}

.performance-header h2 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.performance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.perf-card {
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
}

.perf-card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.perf-card-header {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

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

.perf-card-body {
  padding: 20px;
}

.perf-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.perf-stat:last-child {
  border-bottom: none;
}

.perf-stat.highlight {
  padding: 15px 10px;
  background: var(--bg-card);
  border-radius: 2px;
  margin: 5px -10px;
  border: none;
}

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

.perf-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.perf-value.positive {
  color: var(--text-primary);
}

.perf-value.negative {
  color: var(--text-secondary);
}

.roi-display,
.volatility-display {
  text-align: center;
  padding: 20px 0;
}

.roi-value,
.volatility-value {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.roi-value.positive {
  color: var(--text-primary);
}

.roi-value.negative {
  color: var(--text-secondary);
}

.roi-label,
.volatility-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.volatility-indicator {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 2px;
  font-weight: 500;
  font-size: 0.85rem;
  margin-top: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.volatility-indicator.low {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.volatility-indicator.medium {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.volatility-indicator.high {
  background: var(--text-muted);
  color: var(--bg-primary);
}

.performance-tables {
  display: grid;
  gap: 20px;
}

.perf-table-card {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.perf-table-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.2rem;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) var(--bg-tertiary);
}

.table-container::-webkit-scrollbar {
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 0;
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 0;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-primary);
}

#tokenPerformanceTable {
  width: 100%;
  border-collapse: collapse;
}

#tokenPerformanceTable th {
  text-align: left;
  padding: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.05em;
}

#tokenPerformanceTable td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

#tokenPerformanceTable tbody tr:hover {
  background: var(--bg-secondary);
}

#tokenPerformanceTable .token-name {
  font-weight: 600;
  text-transform: capitalize;
}

#tokenPerformanceTable .positive {
  color: var(--text-primary);
}

#tokenPerformanceTable .negative {
  color: var(--text-secondary);
}

#tokenPerformanceTable .no-data {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px;
}

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

.performers-col h4 {
  margin: 0 0 15px 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.performers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.performer-name {
  font-weight: 600;
  text-transform: capitalize;
}

.performer-roi {
  font-weight: 600;
  font-size: 1.1rem;
}

.performer-roi.positive {
  color: var(--text-primary);
}

.performer-roi.negative {
  color: var(--text-secondary);
}

.performers-list .no-data {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px;
}

/* Portfolio Metrics Section */
.metrics-section {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 1px 3px var(--shadow);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.metrics-header {
  margin-bottom: 25px;
}

.metrics-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.metrics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  display: flex;
  gap: 15px;
  align-items: center;
}

.metric-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.metric-content {
  flex: 1;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.metric-help {
  cursor: help;
  opacity: 0.6;
  font-size: 0.8rem;
  margin-left: 4px;
  transition: opacity 0.2s;
}

.metric-help:hover {
  opacity: 1;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.metric-value.low {
  color: var(--text-secondary);
}

.metric-value.medium {
  color: var(--text-secondary);
}

.metric-value.high {
  color: var(--text-primary);
}

.metric-description {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.metrics-detailed {
  display: grid;
  gap: 20px;
}

.metrics-detail-card {
  background: var(--bg-tertiary);
  padding: 25px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.metrics-detail-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.2rem;
}

.correlation-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) var(--bg-tertiary);
}

.correlation-container::-webkit-scrollbar {
  height: 8px;
}

.correlation-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 0;
}

.correlation-container::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 0;
}

.correlation-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-primary);
}

.correlation-matrix {
  display: grid;
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  min-width: 300px;
}

.correlation-row {
  display: grid;
  gap: 1px;
}

.correlation-cell {
  background: var(--bg-secondary);
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  min-width: 80px;
}

.correlation-cell.header {
  background: var(--bg-tertiary);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.correlation-cell.value {
  font-weight: 600;
}

.correlation-cell.strong-positive {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.correlation-cell.positive {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.correlation-cell.neutral {
  background: var(--text-muted);
  color: var(--bg-primary);
}

.correlation-cell.negative {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.correlation-cell.strong-negative {
  background: var(--bg-card);
  color: var(--text-muted);
}

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

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--text-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.suggestion-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow);
}

.suggestion-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.suggestion-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.suggestion-action {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.suggestion-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.suggestion-progress {
  margin-top: 12px;
}

.suggestion-progress-bar {
  position: relative;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: visible;
}

.suggestion-progress-current {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.suggestion-progress-target {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  background: var(--text-primary);
  border-radius: 2px;
  transform: translateX(-50%);
}

.suggestion-progress-target::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-primary);
}

.suggestion-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Suggestion type-specific styles */
.suggestion-critical {
  animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.85;
  }
}

/* Financial Tracking Section */
.financial-section {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow);
  margin-bottom: 30px;
}

.financial-header {
  margin-bottom: 25px;
}

.financial-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.financial-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.fin-card {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.fin-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.fin-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fin-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.fin-stat:last-child {
  border-bottom: none;
}

.fin-stat.highlight {
  padding: 15px 10px;
  background: var(--bg-card);
  border-radius: 2px;
  margin: 5px -10px;
  border: none;
}

.fin-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.edit-btn:hover {
  background: var(--bg-secondary);
  opacity: 1;
  transform: scale(1.1);
}

.form-help {
  display: block;
  margin-top: 5px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.fin-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.fin-value.positive {
  color: var(--text-primary);
}

.fin-value.negative {
  color: var(--text-secondary);
}

.financial-tables {
  display: grid;
  gap: 20px;
}

.fin-table-card {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.fin-table-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.2rem;
}

#avgPriceTable {
  width: 100%;
  border-collapse: collapse;
}

#avgPriceTable th {
  text-align: left;
  padding: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.05em;
}

#avgPriceTable td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

#avgPriceTable tbody tr:hover {
  background: var(--bg-secondary);
}

#avgPriceTable .token-name {
  font-weight: 600;
  text-transform: capitalize;
}

#avgPriceTable .positive {
  color: var(--text-primary);
}

#avgPriceTable .negative {
  color: var(--text-secondary);
}

.tax-report {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tax-year-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tax-year-selector label {
  color: var(--text-secondary);
  font-weight: 500;
}

.tax-year-selector select {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.tax-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tax-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.tax-stat:last-of-type {
  border-bottom: none;
}

.tax-stat.highlight {
  padding: 15px 10px;
  background: var(--bg-card);
  border-radius: 2px;
  margin: 10px -10px;
  border: none;
}

.tax-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.tax-value {
  font-weight: 600;
  font-size: 1.2rem;
}

.tax-value.positive {
  color: var(--text-primary);
}

.tax-value.negative {
  color: var(--text-secondary);
}

.tax-notice {
  padding: 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Advanced Charts Section */
.advanced-charts-section {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 1px 3px var(--shadow);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.advanced-charts-header {
  margin-bottom: 25px;
}

.advanced-charts-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 20px;
}

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

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card-header {
  padding: 15px 20px;
  background: rgba(59, 130, 246, 0.1);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.token-selector {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.benchmark-toggles {
  display: flex;
  gap: 15px;
}

.benchmark-toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
}

.benchmark-toggles input[type="checkbox"] {
  cursor: pointer;
}

.chart-card-body {
  padding: 20px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-card-body canvas {
  max-height: 350px;
}

.treemap-container {
  width: 100%;
  min-height: 300px;
  position: relative;
}

.treemap-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.treemap-item:hover {
  border-color: var(--accent-primary);
  transform: scale(1.02);
  z-index: 10;
}

.treemap-label {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: capitalize;
  text-align: center;
  margin-bottom: 5px;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.treemap-value {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.treemap-percentage {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Market Intelligence Section */
.market-intelligence-section {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow);
  margin-bottom: 30px;
}

.market-header {
  margin-bottom: 25px;
}

.market-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.market-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.market-card {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.market-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.1rem;
}

.dominance-chart {
  margin-bottom: 20px;
}

.dominance-chart canvas {
  max-height: 200px;
}

.dominance-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dominance-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.dominance-stat:last-child {
  border-bottom: none;
}

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

.dominance-value {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent-primary);
}

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

.fng-gauge {
  text-align: center;
}

.fng-value {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.fng-label {
  font-size: 1.2rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fng-bar {
  width: 100%;
  height: 12px;
  background: linear-gradient(to right, var(--text-muted), var(--text-secondary), var(--text-primary));
  border-radius: 2px;
  position: relative;
}

.fng-indicator {
  position: absolute;
  top: -4px;
  width: 20px;
  height: 20px;
  background: var(--text-primary);
  border: 3px solid var(--bg-tertiary);
  border-radius: 50%;
  transition: left 0.5s ease;
}

.market-cap-chart canvas {
  max-height: 200px;
}

.market-cap-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.cap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cap-color {
  width: 16px;
  height: 16px;
  border-radius: 0;
  border: 1px solid var(--border-color);
}

.cap-color.large {
  background: var(--text-primary);
}

.cap-color.mid {
  background: var(--text-secondary);
}

.cap-color.small {
  background: var(--text-muted);
}

.market-tables {
  display: grid;
  gap: 20px;
}

.market-table-card {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.market-table-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.2rem;
}

.sector-breakdown {
  margin-bottom: 20px;
}

.sector-breakdown canvas {
  max-height: 250px;
}

.sector-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.sector-name {
  font-weight: 600;
  text-transform: capitalize;
}

.sector-allocation {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sector-percentage {
  font-weight: 600;
  color: var(--accent-primary);
}

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

.movers-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.mover-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.mover-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-primary);
}

.mover-tab:hover {
  color: var(--text-primary);
}

.movers-content {
  position: relative;
}

.movers-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.movers-list.active {
  display: flex;
}

.mover-item {
  display: grid;
  grid-template-columns: 40px 1fr 100px 100px;
  gap: 15px;
  align-items: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.mover-item:hover {
  border-color: var(--accent-primary);
  transform: translateX(5px);
}

.mover-rank {
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.mover-info {
  display: flex;
  flex-direction: column;
}

.mover-name {
  font-weight: 600;
  font-size: 1rem;
}

.mover-symbol {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.mover-price {
  font-weight: 600;
  text-align: right;
}

.mover-change {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: right;
}

.mover-change.positive {
  color: var(--success);
}

.mover-change.negative {
  color: var(--danger);
}

/* Responsive Design */

/* Tablet and Below */
@media (max-width: 1024px) {
  .container {
    padding: 0 15px;
  }

  .connections-grid {
    grid-template-columns: 1fr;
  }

  .performers-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card.wide {
    grid-column: 1;
  }
}

/* Mobile Landscape and Portrait */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  /* Header */
  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  header h1 {
    font-size: 1.5rem;
    text-align: center;
  }

  .header-controls {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .currency-selector,
  .profile-selector {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .currency-selector select,
  .profile-selector select {
    width: 100%;
  }

  #userInfoContainer .user-info {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  #userInfoContainer .upgrade-btn,
  #userInfoContainer .manage-btn,
  #userInfoContainer .logout-btn {
    width: 100%;
    padding: 10px 16px;
  }

  /* Dashboard Tabs */
  .dashboard-tabs {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  /* Balance Section */
  .balance-card {
    padding: 25px 20px;
  }

  .balance-amount {
    font-size: 2rem;
  }

  .balance-changes-container {
    gap: 12px;
  }

  .balance-change-item {
    gap: 2px;
  }

  .change-period {
    font-size: 0.7rem;
  }

  .balance-change {
    font-size: 0.9rem;
  }

  /* Charts */
  .chart-section,
  .connections-section,
  .trades-section,
  .all-trades-section,
  .holdings-section,
  .trade-history-section,
  .trade-performance-section,
  .analytics-section,
  .performance-section,
  .metrics-section,
  .financial-section {
    padding: 20px 15px;
  }

  .chart-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .chart-header h2 {
    font-size: 1.3rem;
    text-align: center;
  }

  .timeframe-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .timeframe-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .chart-container {
    height: 300px;
  }

  /* Connections */
  .connections-header {
    flex-direction: column;
    gap: 15px;
  }

  .connections-grid {
    grid-template-columns: 1fr;
  }

  .connection-buttons {
    flex-direction: column;
    width: 100%;
  }

  .connection-buttons button {
    width: 100%;
  }

  .connection-item {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .connection-address-row {
    justify-content: center;
  }

  .connection-address {
    font-size: 0.75rem;
    word-break: break-all;
  }

  /* Holdings and Trades */
  .holding-item,
  .trade-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
  }

  .holding-crypto,
  .trade-crypto {
    font-size: 1rem;
  }

  .holding-value,
  .trade-value {
    font-size: 1rem;
  }

  /* Analytics */
  .pie-chart-container {
    height: 250px;
    max-width: 100%;
  }

  .chart-legend {
    grid-template-columns: 1fr;
  }

  .legend-item {
    padding: 10px;
  }

  /* Performance */
  .performers-grid {
    grid-template-columns: 1fr;
  }

  .performance-cards {
    grid-template-columns: 1fr;
  }

  .roi-value,
  .volatility-value {
    font-size: 2rem;
  }

  /* Tables */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #tokenPerformanceTable th,
  #tokenPerformanceTable td {
    padding: 8px;
    font-size: 0.85rem;
  }

  /* Metrics */
  .metrics-cards {
    grid-template-columns: 1fr;
  }

  .metric-card {
    flex-direction: row;
    padding: 15px;
  }

  .metric-icon {
    font-size: 2rem;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  /* Financial */
  .financial-cards {
    grid-template-columns: 1fr;
  }

  /* Goals */
  .goals-header {
    flex-direction: column;
    gap: 15px;
  }

  .goals-stats {
    grid-template-columns: 1fr;
  }

  .goals-container {
    grid-template-columns: 1fr;
  }

  .goal-card {
    padding: 20px;
  }

  .goal-body {
    grid-template-columns: 1fr;
  }

  .goal-actions {
    flex-direction: column;
  }

  .complete-goal-btn,
  .delete-goal-btn {
    width: 100%;
  }

  /* Alerts */
  .alerts-header {
    flex-direction: column;
    gap: 15px;
  }

  .alerts-stats {
    grid-template-columns: 1fr;
  }

  .alerts-container {
    grid-template-columns: 1fr;
  }

  .alert-card {
    padding: 20px;
  }

  .alert-thresholds,
  .alert-details {
    grid-template-columns: 1fr;
  }

  .alert-actions {
    flex-direction: column;
  }

  .btn-small {
    width: 100%;
  }

  /* Market Intelligence */
  .market-cards {
    grid-template-columns: 1fr;
  }

  .mover-item {
    grid-template-columns: 30px 1fr 80px;
    gap: 10px;
    padding: 10px;
  }

  .mover-price {
    display: none;
  }

  .mover-name {
    font-size: 0.9rem;
  }

  /* Profile Management */
  .profile-input-group {
    flex-direction: column;
  }

  .profile-input-group button {
    width: 100%;
  }

  .profile-item {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .profile-actions {
    width: 100%;
    flex-direction: column;
  }

  .profile-actions button {
    width: 100%;
  }

  /* Modals */
  .modal-content {
    width: 95%;
    max-width: none;
    margin: 20px auto;
    padding: 20px;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .modal-body {
    max-height: calc(100vh - 200px);
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .form-group {
    width: 100%;
  }

  /* Footer */
  .app-footer {
    padding: 20px 15px;
    margin-top: 40px;
  }

  .disclaimer {
    font-size: 12px;
    padding: 12px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  body {
    padding: 8px;
  }

  header {
    padding: 12px;
  }

  header h1 {
    font-size: 1.3rem;
  }

  .balance-card {
    padding: 20px 15px;
  }

  .balance-amount {
    font-size: 1.75rem;
  }

  .balance-changes-container {
    gap: 8px;
  }

  .balance-change-item {
    gap: 2px;
  }

  .change-period {
    font-size: 0.65rem;
  }

  .balance-change {
    font-size: 0.85rem;
  }

  .chart-section,
  .connections-section,
  .trades-section,
  .all-trades-section,
  .holdings-section,
  .trade-history-section,
  .trade-performance-section,
  .analytics-section,
  .performance-section,
  .metrics-section,
  .financial-section {
    padding: 15px 10px;
  }

  .chart-header h2,
  .connections-header h2,
  .trades-header h2,
  .holdings-header h2,
  .analytics-header h2,
  .performance-header h2,
  .metrics-header h2,
  .financial-header h2,
  .goals-header h2,
  .alerts-header h2 {
    font-size: 1.2rem;
  }

  .timeframe-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .chart-container {
    height: 250px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 44px;
    /* Better touch target */
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 0.9rem;
    min-height: 44px;
    /* Better touch target */
  }

  .goal-card,
  .alert-card {
    padding: 15px;
  }

  .goal-title,
  .alert-symbol {
    font-size: 1.1rem;
  }

  .modal-content {
    width: 98%;
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .metric-value {
    font-size: 1.3rem;
  }

  .roi-value,
  .volatility-value {
    font-size: 1.75rem;
  }
}

/* Cache Status Banner */
.cache-status-banner {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 4px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px var(--shadow);
  animation: slideDown 0.3s ease-out;
  border: 1px solid var(--border-color);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cache-status-icon {
  font-size: 1.2rem;
  margin-right: 12px;
}

.cache-status-text {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
}

.cache-status-close {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cache-status-close:hover {
  background: var(--accent-primary);
}

/* Guest Mode Banner */
.guest-mode-banner {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  animation: slideDown 0.3s ease-out;
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.guest-mode-icon {
  font-size: 1.2rem;
  color: #667eea;
  flex-shrink: 0;
}

.guest-mode-text {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
}

.guest-mode-signin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.guest-mode-signin:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.guest-mode-close {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

/* Mobile responsive guest banner */
@media (max-width: 600px) {
  .guest-mode-banner {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }

  .guest-mode-icon {
    display: none;
  }

  .guest-mode-text {
    font-size: 0.85rem;
    flex-basis: calc(100% - 40px);
  }

  .guest-mode-signin {
    padding: 10px 24px;
    font-size: 14px;
    flex-grow: 1;
    order: 3;
  }

  .guest-mode-close {
    order: 2;
  }
}

.guest-mode-close:hover {
  background: var(--accent-primary);
}

/* Goals Tab Styles */
.goals-section {
  padding: 20px;
}

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

.goals-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.goals-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 1px 3px var(--shadow);
  border: 1px solid var(--border-color);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.goals-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.goal-card {
  background: var(--bg-secondary);
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 1px 3px var(--shadow);
  border-left: 2px solid var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-color);
  border-left-width: 2px;
  border-left-color: var(--text-primary);
}

.goal-card:hover {
  border-left-color: var(--text-primary);
  background: var(--bg-card);
}

.goal-card.goal-completed {
  border-left-color: var(--text-secondary);
  opacity: 0.85;
}

.goal-card.goal-expired {
  border-left-color: var(--text-muted);
  opacity: 0.85;
}

.goal-card.goal-urgent {
  border-left-color: var(--text-primary);
  animation: none;
}

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

.goal-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  margin-right: 12px;
}

.goal-status {
  background: var(--bg-tertiary);
  padding: 6px 12px;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.goal-completed .goal-status {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.goal-expired .goal-status {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.goal-urgent .goal-status {
  background: var(--text-muted);
  color: var(--bg-primary);
}

.goal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.goal-target,
.goal-current,
.goal-remaining,
.goal-deadline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.goal-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.goal-value.positive {
  color: var(--text-primary);
}

.goal-progress {
  margin-bottom: 20px;
}

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

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

.progress-percentage {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: none;
  border: 1px solid var(--border-color);
}

.progress-fill {
  height: 100%;
  border-radius: 0;
  transition: width 0.5s ease, background-color 0.3s ease;
  background: var(--text-primary);
}

.progress-fill.low {
  background: var(--text-muted);
}

.progress-fill.medium {
  background: var(--text-secondary);
}

.progress-fill.high {
  background: var(--text-primary);
}

.progress-fill.complete {
  background: var(--text-primary);
}

.goal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.complete-goal-btn,
.delete-goal-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.complete-goal-btn {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.complete-goal-btn:hover {
  background: var(--text-secondary);
}

.delete-goal-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.delete-goal-btn:hover {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

/* Price Alerts Tab Styles */
.alerts-section {
  padding: 20px;
}

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

.alerts-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.alerts-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.alerts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.alert-card {
  background: var(--bg-secondary);
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 1px 3px var(--shadow);
  border-left: 2px solid var(--text-primary);
  transition: all 0.2s;
  border: 1px solid var(--border-color);
  border-left-width: 2px;
  border-left-color: var(--text-primary);
}

.alert-card:hover {
  border-left-color: var(--text-primary);
  background: var(--bg-card);
}

.alert-card.inactive {
  border-left-color: var(--text-secondary);
  opacity: 0.7;
}

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

.alert-crypto {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-symbol {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.alert-crypto-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.alert-status {
  background: var(--bg-tertiary);
  padding: 6px 12px;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.alert-status.active {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.alert-status.inactive {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.alert-body {
  margin-bottom: 20px;
}

.alert-thresholds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.threshold-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  border: 1px solid var(--border-color);
}

.threshold-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.threshold-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.alert-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.alert-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.alert-last-triggered {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.alert-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-small {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-small.btn-danger {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-small.btn-danger:hover {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

/* Profile Management Styles */
.profile-management {
  padding: 10px 0;
}

.profile-input-group {
  display: flex;
  gap: 10px;
}

.profile-input-group input {
  flex: 1;
}

.profile-input-group button {
  flex-shrink: 0;
}

.profile-list-section {
  margin-top: 30px;
}

.profile-list {
  margin-top: 15px;
  max-height: 400px;
  overflow-y: auto;
}

.profile-limit-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 15px;
}

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

.profile-limit-warning {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 4px;
}

.profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.profile-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.profile-name {
  font-weight: 600;
  color: var(--text-primary);
}

.profile-actions {
  display: flex;
  gap: 10px;
}

.profile-readonly {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

.profile-default {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 12px;
  background: var(--bg-card);
  border-radius: 2px;
  border: 1px solid var(--border-color);
}

.btn-warning {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

/* Footer Styles */
.app-footer {
  margin-top: 60px;
  padding: 30px 20px;
  background: var(--bg-secondary);
  border-radius: 4px;
  box-shadow: 0 1px 3px var(--shadow);
  border: 1px solid var(--border-color);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.disclaimer {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 15px;
  padding: 15px;
  background: var(--bg-tertiary);
  border-left: 2px solid var(--border-hover);
  border-radius: 2px;
}

.disclaimer strong {
  color: #fb923c;
  font-weight: 600;
}

.api-attribution {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin: 15px 0;
  padding: 8px;
}

.api-attribution a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.api-attribution a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.legal-links {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin: 12px 0;
  padding: 8px;
}

.legal-links a {
  color: #4a9eff;
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.2s;
}

.legal-links a:hover {
  color: #60b0ff;
  text-decoration: underline;
}

.copyright {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

/* Theme Toggle Styles */
.theme-toggle {
  display: flex;
  align-items: center;
}

.theme-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  background: var(--bg-primary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.theme-icon {
  display: block;
  line-height: 1;
}

/* Export/Import Dropdown Styles */
.trades-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow);
  min-width: 220px;
  z-index: 1000;
  padding: 8px 0;
}

.dropdown-menu.show {
  display: block;
  animation: slideDown 0.2s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
}

.dropdown-divider {
  margin: 8px 0;
  border: none;
  border-top: 1px solid var(--border-color);
}

/* Per-Holding Profit/Loss Display */
.holding-pl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.holding-pl-amount {
  font-weight: 600;
  font-size: 14px;
}

.holding-pl-percent {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.holding-pl.positive .holding-pl-amount,
.holding-pl.positive .holding-pl-percent {
  color: var(--success);
}

.holding-pl.negative .holding-pl-amount,
.holding-pl.negative .holding-pl-percent {
  color: var(--danger);
}

.holding-pl.positive .holding-pl-percent {
  background: rgba(16, 185, 129, 0.1);
}

.holding-pl.negative .holding-pl-percent {
  background: rgba(239, 68, 68, 0.1);
}

/* Import File Input (Hidden) */
#importFileInput {
  display: none;
}

/* Light Theme Adjustments */
body[data-theme="light"] {
  background: linear-gradient(135deg, #ffffff 0%, #f7f9fc 100%);
}

body[data-theme="light"] .loading-overlay {
  background: rgba(255, 255, 255, 0.95);
}

body[data-theme="light"] .loading-spinner {
  border-color: rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
}

/* Notification Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.notification {
  animation: slideIn 0.3s ease;
}

/* ================================
   SETTINGS MODAL STYLES
   ================================ */

.wide-modal .modal-content {
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
}

.settings-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

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

.settings-tab.active {
  color: var(--text-primary);
  border-bottom-color: #3b82f6;
}

/* Settings Tab Content */
.settings-tab-content {
  display: none;
  padding: 0 24px 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

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

/* Notification Channels Grid */
.notification-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.notification-settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.notification-preferences-section {
  grid-column: 1 / -1;
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.settings-section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section-body.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.settings-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

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

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-group small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-group small a {
  color: #3b82f6;
  text-decoration: none;
}

.form-group small a:hover {
  text-decoration: underline;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  align-self: flex-start;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  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-color: #ef4444;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
  background-color: #22c55e;
}

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

/* Notification Matrix Table */
.notification-matrix-wrapper {
  overflow-x: auto;
}

.notification-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

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

.notification-matrix th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  font-size: 0.9rem;
}

.notification-matrix td {
  color: var(--text-secondary);
}

.notification-matrix tr:last-child td {
  border-bottom: none;
}

.notification-matrix input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.notification-matrix input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.notification-matrix td:has(input:disabled) {
  opacity: 0.5;
  background-color: rgba(128, 128, 128, 0.1);
}

/* Settings Actions */
.settings-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  justify-content: flex-end;
  margin-top: auto;
}

/* Sharing Settings Styles */
.sharing-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sharing-settings-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-link-active-compact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-link-active-compact .share-url-container {
  display: flex;
  gap: 8px;
}

.share-link-active-compact .share-url-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.share-link-active-compact .copy-btn {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-link-active-compact .copy-btn.copied {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.share-link-actions-compact {
  display: flex;
  gap: 8px;
}

.share-link-inactive-compact {
  text-align: center;
  padding: 16px;
}

.share-link-inactive-compact p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.premium-required-card.compact {
  text-align: center;
  padding: 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.premium-required-card.compact .premium-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.premium-required-card.compact h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.premium-required-card.compact p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.settings-section.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .wide-modal .modal-content {
    max-width: 95%;
    margin: 20px auto;
  }

  .settings-tabs {
    padding: 0 16px;
    overflow-x: auto;
  }

  .settings-tab {
    padding: 10px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .settings-tab-content {
    padding: 0 16px 16px;
    max-height: calc(90vh - 120px);
  }

  .notification-channels-grid {
    grid-template-columns: 1fr;
  }

  .notification-matrix {
    font-size: 0.85rem;
  }

  .notification-matrix th,
  .notification-matrix td {
    padding: 8px 4px;
  }

  .notification-matrix th:first-child,
  .notification-matrix td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-tertiary);
    z-index: 1;
  }

  .settings-actions {
    flex-direction: column;
  }

  .settings-actions button {
    width: 100%;
  }
}

/* ========================
   Tag Management Styles
   ======================== */
.tag-input-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  align-items: center;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-chip:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.tag-chip .tag-remove {
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
}

.tag-create-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tag-create-group input[type="text"] {
  flex: 1;
}

.tag-create-group input[type="color"] {
  width: 50px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-tertiary);
  cursor: pointer;
}

.tags-list-section {
  margin-top: 20px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 100px;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  color: white;
  font-size: 0.9rem;
}

.tag-item .tag-delete {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.tag-item .tag-delete:hover {
  opacity: 1;
}

.tag-selection-section {
  margin-top: 20px;
}

.tag-selection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.tag-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.tag-checkbox-item:hover {
  background: var(--bg-tertiary);
}

.tag-checkbox-item.selected {
  border-color: var(--accent-hover);
}

.tag-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ========================
   Exchange Performance Chart
   ======================== */
.exchange-performance-section {
  margin-top: 30px;
  padding: 25px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.exchange-performance-section .chart-container {
  position: relative;
  height: 300px;
  margin-top: 20px;
}

/* ========================
   Trade Performance List
   ======================== */
.trade-performance-section {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.3s ease;
}

.trade-performance-section:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-header h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.trade-perf-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.trade-perf-select {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.trade-perf-select:hover {
  border-color: var(--border-hover);
}

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

.trade-perf-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s;
}

.trade-perf-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.trade-perf-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trade-perf-rank {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-secondary);
  min-width: 30px;
}

.trade-perf-crypto {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trade-perf-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.trade-perf-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.trade-perf-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.trade-perf-amount {
  text-align: right;
}

.trade-perf-quantity {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.trade-perf-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.trade-perf-change {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 100px;
}

.trade-perf-gain {
  font-size: 1.1rem;
  font-weight: bold;
}

.trade-perf-gain.positive {
  color: #10b981;
}

.trade-perf-gain.negative {
  color: #ef4444;
}

.trade-perf-percent {
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.trade-perf-percent.positive {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.trade-perf-percent.negative {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

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

@media (max-width: 768px) {
  .tag-create-group {
    flex-direction: column;
  }

  .tag-create-group input[type="text"],
  .tag-create-group input[type="color"],
  .tag-create-group button {
    width: 100%;
  }

  .trade-perf-controls {
    width: 100%;
  }

  .trade-perf-select {
    flex: 1;
  }

  .trade-perf-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .trade-perf-right {
    width: 100%;
    justify-content: space-between;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ================================
   COMPREHENSIVE LIGHT MODE STYLES
   ================================ */

body[data-theme="light"] {
  background: linear-gradient(135deg, #ffffff 0%, #f7f9fc 100%);
}

/* Navigation Bar Light Mode */
body[data-theme="light"] .top-navbar {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .navbar-link {
  color: var(--text-secondary);
}

body[data-theme="light"] .navbar-link:hover,
body[data-theme="light"] .navbar-link.active {
  color: var(--text-primary);
  background: var(--hover-bg);
}

body[data-theme="light"] .navbar-icon-btn {
  color: var(--text-secondary);
  background: var(--hover-bg);
}

body[data-theme="light"] .navbar-icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Mobile Menu Light Mode */
body[data-theme="light"] .mobile-menu {
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
}

body[data-theme="light"] .mobile-menu-overlay {
  background: rgba(0, 0, 0, 0.3);
}

/* Cards and Sections Light Mode */
body[data-theme="light"] .balance-card,
body[data-theme="light"] .stat-card,
body[data-theme="light"] .metric-card,
body[data-theme="light"] .perf-card,
body[data-theme="light"] .fin-card,
body[data-theme="light"] .chart-card,
body[data-theme="light"] .goal-card,
body[data-theme="light"] .alert-card,
body[data-theme="light"] .connection-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px var(--shadow);
}

body[data-theme="light"] .holding-item,
body[data-theme="light"] .trade-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .holding-item:hover,
body[data-theme="light"] .trade-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Modals Light Mode */
body[data-theme="light"] .modal {
  background: rgba(0, 0, 0, 0.5);
}

body[data-theme="light"] .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .modal-header {
  border-bottom: 1px solid var(--border-color);
}

/* Form Elements Light Mode */
body[data-theme="light"] input[type="text"],
body[data-theme="light"] input[type="email"],
body[data-theme="light"] input[type="password"],
body[data-theme="light"] input[type="number"],
body[data-theme="light"] input[type="date"],
body[data-theme="light"] input[type="color"],
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

body[data-theme="light"] input:focus,
body[data-theme="light"] select:focus,
body[data-theme="light"] textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons Light Mode */
body[data-theme="light"] .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .btn-secondary:hover {
  background: var(--hover-bg);
  border-color: var(--border-hover);
}

/* Tables Light Mode */
body[data-theme="light"] table {
  background: var(--bg-card);
}

body[data-theme="light"] thead {
  background: var(--bg-tertiary);
  border-bottom: 2px solid var(--border-color);
}

body[data-theme="light"] tbody tr {
  border-bottom: 1px solid var(--border-color);
}

body[data-theme="light"] tbody tr:hover {
  background: var(--hover-bg);
}

/* Chart Containers Light Mode */
body[data-theme="light"] .chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* Dropdowns Light Mode */
body[data-theme="light"] .dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px var(--shadow);
}

body[data-theme="light"] .dropdown-item {
  color: var(--text-primary);
}

body[data-theme="light"] .dropdown-item:hover {
  background: var(--hover-bg);
}

body[data-theme="light"] .dropdown-divider {
  border-top: 1px solid var(--border-color);
}

/* Banners Light Mode */
body[data-theme="light"] .cache-status-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fbbf24;
  color: #92400e;
}

body[data-theme="light"] .guest-mode-banner {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #3b82f6;
  color: #1e3a8a;
}

/* Settings Modal Light Mode */
body[data-theme="light"] .settings-tabs {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

body[data-theme="light"] .settings-tab {
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
}

body[data-theme="light"] .settings-tab:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

body[data-theme="light"] .settings-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: transparent;
}

body[data-theme="light"] .settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .settings-section-header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

/* Notification Matrix Light Mode */
body[data-theme="light"] .notification-matrix {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .notification-matrix thead {
  background: var(--bg-tertiary);
}

body[data-theme="light"] .notification-matrix th,
body[data-theme="light"] .notification-matrix td {
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .notification-matrix tbody tr:hover {
  background: var(--hover-bg);
}

/* Profile List Light Mode */
body[data-theme="light"] .profile-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .profile-item.active {
  background: var(--hover-bg);
  border-color: var(--accent-primary);
}

/* Tag Management Light Mode */
body[data-theme="light"] .tag-badge {
  border: 1px solid rgba(0, 0, 0, 0.1);
  filter: brightness(0.95);
}

body[data-theme="light"] .tag-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* Correlation Matrix Light Mode */
body[data-theme="light"] .correlation-cell {
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .correlation-cell[data-value="strong-positive"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

body[data-theme="light"] .correlation-cell[data-value="positive"] {
  background: #d1fae5;
  color: #065f46;
}

body[data-theme="light"] .correlation-cell[data-value="neutral"] {
  background: #f3f4f6;
  color: #374151;
}

body[data-theme="light"] .correlation-cell[data-value="negative"] {
  background: #fee2e2;
  color: #991b1b;
}

body[data-theme="light"] .correlation-cell[data-value="strong-negative"] {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

/* Suggestions Light Mode */
body[data-theme="light"] .suggestion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .suggestion-critical {
  background: #fef2f2;
  border-left-color: #ef4444;
}

body[data-theme="light"] .suggestion-warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

body[data-theme="light"] .suggestion-opportunity {
  background: #ecfdf5;
  border-left-color: #10b981;
}

body[data-theme="light"] .suggestion-suggestion {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

body[data-theme="light"] .suggestion-cleanup {
  background: #f9fafb;
  border-left-color: #9ca3af;
}

body[data-theme="light"] .suggestion-info {
  background: #f3f4f6;
  border-left-color: #6b7280;
}

body[data-theme="light"] .suggestion-success {
  background: #ecfdf5;
  border-left-color: #10b981;
}

body[data-theme="light"] .suggestion-progress-bar {
  background: #e5e7eb;
}

body[data-theme="light"] .suggestion-progress-target {
  background: #374151;
}

body[data-theme="light"] .suggestion-progress-target::after {
  border-top-color: #374151;
}

/* Performance Cards Light Mode */
body[data-theme="light"] .performer-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* Treemap Light Mode */
body[data-theme="light"] .treemap-item {
  border: 2px solid white;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Footer Light Mode */
body[data-theme="light"] .app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* Loading Overlay Light Mode */
body[data-theme="light"] .loading-overlay {
  background: rgba(255, 255, 255, 0.95);
}

body[data-theme="light"] .loading-spinner {
  border-color: rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
}

body[data-theme="light"] .loading-text {
  color: var(--text-primary);
}

/* Scrollbar Light Mode */
body[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

body[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: var(--border-hover);
}

body[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Hover States for Interactive Elements */
body[data-theme="light"] .holding-actions button:hover,
body[data-theme="light"] .trade-actions button:hover,
body[data-theme="light"] .wallet-actions button:hover,
body[data-theme="light"] .exchange-actions button:hover {
  background: var(--hover-bg);
}

/* Alert Box Light Mode */
body[data-theme="light"] .alert-box {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
}

/* Form Help Text Light Mode */
body[data-theme="light"] .form-help,
body[data-theme="light"] small {
  color: var(--text-muted);
}

/* Toggle Switch Light Mode */
body[data-theme="light"] .toggle-slider {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] input:checked+.toggle-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* API Setup Links Light Mode */
body[data-theme="light"] .api-setup-links {
  background: #dbeafe;
  border: 1px solid #3b82f6;
}

body[data-theme="light"] .setup-link {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

body[data-theme="light"] .setup-link:hover {
  background: var(--hover-bg);
  border-color: var(--accent-primary);
}

/* Chart Legend Light Mode */
body[data-theme="light"] .chart-legend-item {
  color: var(--text-primary);
}

/* Balance Changes Light Mode */
body[data-theme="light"] .balance-change-item {
  color: var(--text-secondary);
}

/* No Data Messages Light Mode */
body[data-theme="light"] .no-data,
body[data-theme="light"] .no-trades,
body[data-theme="light"] .no-connections {
  color: var(--text-muted);
}

/* Section Headers Light Mode */
body[data-theme="light"] .section-header h2,
body[data-theme="light"] .chart-header h2,
body[data-theme="light"] .trades-header h2 {
  color: var(--text-primary);
}

/* Metric Values Light Mode */
body[data-theme="light"] .metric-value,
body[data-theme="light"] .stat-value,
body[data-theme="light"] .balance-amount {
  color: var(--text-primary);
}

/* Links Light Mode */
body[data-theme="light"] a {
  color: var(--accent-primary);
}

body[data-theme="light"] a:hover {
  color: var(--accent-hover);
}

/* Close Buttons Light Mode */
body[data-theme="light"] .close,
body[data-theme="light"] .cache-status-close,
body[data-theme="light"] .guest-mode-close {
  color: var(--text-secondary);
}

body[data-theme="light"] .close:hover,
body[data-theme="light"] .cache-status-close:hover,
body[data-theme="light"] .guest-mode-close:hover {
  color: var(--text-primary);
}

/* Trade Performance Light Mode */
body[data-theme="light"] .trade-perf-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .trade-perf-item:hover {
  background: var(--hover-bg);
  border-color: var(--border-hover);
}

/* Currency Selector Light Mode */
body[data-theme="light"] .currency-selector-compact select,
body[data-theme="light"] .profile-selector-compact select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* Timeframe Buttons Light Mode */
body[data-theme="light"] .timeframe-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

body[data-theme="light"] .timeframe-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

body[data-theme="light"] .timeframe-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* =====================================================
   PORTFOLIO SHARING STYLES
   ===================================================== */

/* Share Tab Container */
.share-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.share-header {
  margin-bottom: 32px;
}

.share-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.share-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* Share Sections */
.share-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.share-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-section h3 svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

/* Share Link Section */
.share-link-section {
  text-align: center;
}

.share-link-section.has-link {
  text-align: left;
}

.no-link-message {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.share-url-container {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.share-url-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

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

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

.btn-copy,
.btn-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover,
.btn-open:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.btn-copy svg,
.btn-open svg {
  width: 18px;
  height: 18px;
}

/* Share Actions */
.share-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-actions.has-link {
  justify-content: flex-start;
}

.btn-generate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-generate svg {
  width: 18px;
  height: 18px;
}

.btn-revoke {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-revoke:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-revoke svg {
  width: 16px;
  height: 16px;
}

/* Visibility Settings Section */
.visibility-settings-section {
  display: grid;
  gap: 16px;
}

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

.visibility-option:hover {
  border-color: var(--border-hover);
}

.visibility-option-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.visibility-option-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.visibility-option-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Share Toggle Switch (larger version) */
.share-toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
}

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

.share-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: 0.3s;
  border-radius: 30px;
}

.share-toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: 0.3s;
  border-radius: 50%;
}

.share-toggle input:checked+.share-toggle-slider {
  background-color: #22c55e;
  border-color: #22c55e;
}

.share-toggle input:checked+.share-toggle-slider:before {
  transform: translateX(26px);
  background-color: white;
}

/* Share Info Grid */
.share-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.share-info-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.share-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  color: #3b82f6;
  flex-shrink: 0;
}

.share-info-icon svg {
  width: 20px;
  height: 20px;
}

.share-info-content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.share-info-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Premium Required Card */
.premium-required-card {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.premium-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 50%;
  color: white;
}

.premium-icon svg {
  width: 40px;
  height: 40px;
}

.premium-required-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.premium-required-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.premium-benefits {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto 32px;
  text-align: left;
}

.premium-benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.premium-benefit svg {
  width: 20px;
  height: 20px;
  color: #22c55e;
  flex-shrink: 0;
}

.premium-benefit span {
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Share Content Grid - New Consistent Layout */
.share-tab-section {
  padding: 0;
}

.share-content-grid {
  display: grid;
  gap: 24px;
}

.share-main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

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

.share-main-card .card-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.share-main-card .card-header h3 svg {
  color: var(--accent-primary);
}

.share-main-card .card-body {
  padding: 24px;
}

/* Share Link Active State */
.share-link-active .share-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.share-link-active .share-url-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.share-link-active .share-url-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.share-link-active .btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-link-active .btn-icon:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.share-link-active .share-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.share-link-active .share-btn-row .btn-secondary,
.share-link-active .share-btn-row .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.875rem;
}

.share-info-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.share-info-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-primary);
}

/* Share Link Empty State */
.share-link-empty {
  text-align: center;
  padding: 32px 16px;
}

.share-link-empty .empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--bg-secondary);
  border-radius: 50%;
  color: var(--text-muted);
}

.share-link-empty p {
  color: var(--text-secondary);
  margin: 0 0 20px;
  font-size: 0.95rem;
}

/* Share Info Cards */
.share-info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: border-color 0.2s ease;
}

.info-card:hover {
  border-color: var(--accent-primary);
}

.info-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.info-card-content h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.info-card-content p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Premium Feature Card (for non-premium users) */
.premium-feature-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.premium-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
  border-radius: 50%;
  color: white;
}

.premium-feature-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.premium-feature-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.premium-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 auto 32px;
  max-width: 280px;
  text-align: left;
}

.premium-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.premium-feature-list li svg {
  color: #22c55e;
  flex-shrink: 0;
}

.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border: none;
  border-radius: 8px;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
}

.btn-upgrade svg {
  width: 20px;
  height: 20px;
}

/* Share Toast Notifications */
.share-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  animation: slideInRight 0.3s ease;
}

.share-toast.success {
  border-color: #22c55e;
}

.share-toast.error {
  border-color: #ef4444;
}

.share-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.share-toast.success .share-toast-icon {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.share-toast.error .share-toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.share-toast-icon svg {
  width: 18px;
  height: 18px;
}

.share-toast-message {
  color: var(--text-primary);
  font-size: 0.95rem;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Share Loading State */
.share-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 16px;
}

.share-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.share-loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Share Statistics */
.share-stats {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.share-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.share-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.share-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Share Mobile Responsive */
@media (max-width: 768px) {
  .share-container {
    padding: 16px;
  }

  .share-section {
    padding: 16px;
  }

  .share-url-container {
    flex-direction: column;
  }

  .share-url-actions {
    justify-content: stretch;
  }

  .btn-copy,
  .btn-open {
    flex: 1;
  }

  .share-actions {
    flex-direction: column;
  }

  .share-actions .btn-generate,
  .share-actions .btn-revoke {
    width: 100%;
    justify-content: center;
  }

  .visibility-option {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .share-info-grid {
    grid-template-columns: 1fr;
  }

  .premium-required-card {
    padding: 32px 16px;
  }

  .share-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .share-stats {
    flex-direction: column;
    gap: 12px;
  }
}

/* Share Light Mode */
body[data-theme="light"] .share-section {
  background: var(--bg-card);
  border-color: var(--border-color);
}

body[data-theme="light"] .share-url-input {
  background: white;
  border-color: var(--border-color);
  color: var(--text-primary);
}

body[data-theme="light"] .visibility-option {
  background: white;
  border-color: var(--border-color);
}

body[data-theme="light"] .share-info-card {
  background: white;
  border-color: var(--border-color);
}

body[data-theme="light"] .premium-required-card {
  background: linear-gradient(135deg, white 0%, #f9fafb 100%);
}

body[data-theme="light"] .premium-benefit {
  background: #f9fafb;
}

body[data-theme="light"] .share-toast {
  background: white;
  border-color: var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .share-toggle-slider {
  background-color: #e5e7eb;
  border-color: #d1d5db;
}

body[data-theme="light"] .share-toggle-slider:before {
  background-color: white;
}