/* ===== MODERN TRADE JOURNAL STYLES ===== */
/* Root variables for theme customization */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #4CAF50 0%, #388e3c 100%);
  --danger-gradient: linear-gradient(135deg, #F44336 0%, #d32f2f 100%);
  --warning-gradient: linear-gradient(135deg, #FFC107 0%, #ff8f00 100%);
  --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --card-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
  --hover-shadow: 0 25px 45px rgba(102, 126, 234, 0.3);
  --border-radius: 15px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== FULL-WIDTH SHORTCODES FOR WORDPRESS THEMES ===== */
/* Override theme restrictions for TradeJournal shortcodes */
.tradejournal-posts,
.trade-summary,
.trading-calendar,
.performance-dashboard,
.pnl-chart,
.equity-curve,
.drawdown-chart,
.portfolio-overview,
.risk-calculators,
.trader-portfolio,
.strategy-gallery,
.trader-directory,
.trading-challenges,
.trader-leaderboards {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Container for full-width display */
.tradejournal-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
}

/* Force full-width for theme compatibility */
.wp-block,
.entry-content .wp-block,
.content-area .wp-block {
  max-width: none !important;
}

.tradejournal-posts,
.trade-summary,
.trading-calendar,
.performance-dashboard,
.pnl-chart,
.equity-curve,
.drawdown-chart,
.portfolio-overview,
.risk-calculators,
.trader-portfolio,
.strategy-gallery,
.trader-directory,
.trading-challenges,
.trader-leaderboards {
  width: 100% !important;
  max-width: 100% !important;
}

/* Override theme containers that might restrict width */
.theme-container,
.content-wrapper,
.page-content,
.main-content,
.site-content,
.content-area {
  max-width: none !important;
}

/* Sahifa theme specific overrides */
body.single .entry,
body.page .entry,
body .entry-content {
  max-width: none !important;
  width: 100% !important;
}

/* Magazine-style theme overrides */
.magazine-layout,
.grid-layout,
.boxed-layout {
  max-width: none !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 25px 45px rgba(0, 0, 0, 0.5);
  }

  .tradejournal-post {
    background: linear-gradient(135deg, #2a2a4e 0%, #1e2a4a 100%);
    color: #e9ecef;
  }

  .trade-summary, .trading-calendar, .performance-dashboard {
    background: linear-gradient(135deg, #2a2a4e 0%, #1e2a4a 100%);
    color: #e9ecef;
  }
}

/* Modern Container Queries and Responsive Grid */
@container (min-width: 1200px) {
  .tradejournal-posts {
    --columns: 4;
  }
}

@container (min-width: 900px) and (max-width: 1199px) {
  .tradejournal-posts {
    --columns: 3;
  }
}

@container (min-width: 600px) and (max-width: 899px) {
  .tradejournal-posts {
    --columns: 2;
  }
}

@container (max-width: 599px) {
  .tradejournal-posts {
    --columns: 1;
  }
}

/* Enhanced Mobile First Approach */
.tradejournal-posts {
  width: 100%;
  margin: 0 auto;
  container-type: inline-size;
  padding: clamp(10px, 4vw, 40px);
  background: var(--background-gradient);
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(var(--columns, 1), 1fr);
  gap: clamp(15px, 3vw, 30px);
}

/* Styles for the trade averages table */
.trade-averages-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: var(--font-primary);
  font-size: clamp(12px, 2.5vw, 16px);
  color: #333;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background: white;
}

.trade-averages-table th,
.trade-averages-table td {
  padding: 10px;
  text-align: center;
  border: 1px solid #ddd;
}

.trade-averages-table th {
  background: var(--primary-gradient);
  font-weight: bold;
  color: white;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.trade-averages-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.trade-averages-table tbody tr:nth-child(odd) {
  background-color: #fff;
}

.trade-averages-table tbody tr:hover {
  background-color: #f1f1f1;
}

/* Responsive styling for mobile devices */
@media (max-width: 768px) {

  .trade-averages-table,
  .trade-averages-table thead,
  .trade-averages-table tbody,
  .trade-averages-table th,
  .trade-averages-table td,
  .trade-averages-table tr {
    display: block;
    width: 100%;
  }

  .trade-averages-table thead tr {
    display: none;
    /* Hide the table header */
  }

  .trade-averages-table tbody tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  }

  .trade-averages-table td {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    text-align: left;
    border: none;
    border-bottom: 1px solid #eee;
  }

  .trade-averages-table td:before {
    content: attr(data-label);
    font-weight: bold;
    flex: 1;
    color: #333;
  }

  .trade-averages-table td:last-child {
    border-bottom: none;
  }
}

/* Responsive table styling */
/* Unified styling for all TradeJournal shortcodes */
.trade-summary,
.trading-calendar,
.performance-dashboard,
.pnl-chart,
.equity-curve,
.drawdown-chart,
.portfolio-overview,
.risk-calculators,
.trader-portfolio,
.strategy-gallery,
.trader-directory,
.trading-challenges,
.trader-leaderboards {
  font-family: var(--font-primary);
  color: #333;
  line-height: 1.6;
  background: var(--background-gradient);
  padding: clamp(20px, 5vw, 40px);
  margin: 20px 0;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

/* Consistent headings for all shortcodes */
.trade-summary h3,
.trading-calendar h3,
.performance-dashboard h3,
.pnl-chart h3,
.equity-curve h3,
.drawdown-chart h3,
.portfolio-overview h3,
.risk-calculators h3,
.trader-portfolio h3,
.strategy-gallery h3,
.trader-directory h3,
.trading-challenges h3,
.trader-leaderboards h3 {
  font-size: clamp(1.5em, 4vw, 2.5em);
  font-weight: 300;
  text-align: center;
  margin: 0 0 30px 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.trade-summary h3::after,
.trading-calendar h3::after,
.performance-dashboard h3::after,
.pnl-chart h3::after,
.equity-curve h3::after,
.drawdown-chart h3::after,
.portfolio-overview h3::after,
.risk-calculators h3::after,
.trader-portfolio h3::after,
.strategy-gallery h3::after,
.trader-directory h3::after,
.trading-challenges h3::after,
.trader-leaderboards h3::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* Consistent tables for all shortcodes */
.trade-summary table,
.trading-calendar table,
.performance-dashboard table,
.portfolio-overview table,
.trader-portfolio table,
.trader-leaderboards table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.trade-summary th,
.trading-calendar th,
.performance-dashboard th,
.portfolio-overview th,
.trader-portfolio th,
.trader-leaderboards th {
  background: var(--primary-gradient);
  color: white;
  padding: 15px 10px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trade-summary td,
.trading-calendar td,
.performance-dashboard td,
.portfolio-overview td,
.trader-portfolio td,
.trader-leaderboards td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f1f1;
  text-align: left;
}

.trade-summary tbody tr:hover,
.trading-calendar tbody tr:hover,
.portfolio-overview tbody tr:hover,
.trader-portfolio tbody tr:hover,
.trader-leaderboards tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

/* Consistent grid layouts */
.strategy-gallery,
.trader-directory,
.trading-challenges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin: 30px 0;
}

.strategy-card,
.trader-card,
.challenge-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.strategy-card:hover,
.trader-card:hover,
.challenge-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 0;
}

.dashboard-header h1 {
  font-size: clamp(2em, 5vw, 3.5em);
  font-weight: 300;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 10px 0;
}

.dashboard-header p {
  font-size: 1.2em;
  color: #6c757d;
  margin: 0;
}

/* Customizable Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.dashboard-widget {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  border: 1px solid rgba(102, 126, 234, 0.1);
  position: relative;
  overflow: hidden;
}

.dashboard-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.dashboard-widget:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

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

.widget-title {
  font-size: 1.4em;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.widget-controls {
  display: flex;
  gap: 10px;
}

.widget-control-btn {
  background: none;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
  color: #6c757d;
}

.widget-control-btn:hover {
  background: #f8f9fa;
  border-color: #667eea;
  color: #667eea;
}

/* Mobile Dashboard Optimization */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 0 10px;
  }

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

  .dashboard-widget {
    padding: 20px;
  }

  .widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .widget-controls {
    align-self: flex-end;
  }
}

/* Modern Trade Summary Styles */
.trade-summary {
    max-width: 600px;
    margin: 30px auto;
    background: var(--background-gradient);
    border-radius: var(--border-radius);
    padding: clamp(20px, 8vw, 40px);
    box-shadow: var(--card-shadow);
    font-family: var(--font-primary);
    position: relative;
}

.trade-summary h3 {
   margin: 0 0 25px 0;
   text-align: center;
   font-size: 1.8em;
   font-weight: 300;
   color: #333;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.trade-summary ul {
   list-style: none;
   padding: 0;
   margin: 0;
   display: grid;
   gap: 15px;
}

.trade-summary li {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 15px 20px;
   background: rgba(255,255,255,0.8);
   border-radius: 10px;
   border: 1px solid rgba(255,255,255,0.6);
   transition: all 0.3s ease;
   box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.trade-summary li:hover {
   transform: translateY(-2px);
   box-shadow: 0 8px 25px rgba(0,0,0,0.15);
   background: rgba(255,255,255,1);
}

.trade-summary li strong {
   display: flex;
   align-items: center;
   gap: 8px;
   font-weight: 600;
   color: #333;
   font-size: 14px;
}

.trade-summary li strong::before {
   content: '📊';
   font-size: 16px;
}

.trade-summary li strong.profitable::before { content: '🟢'; }
.trade-summary li strong.losses::before { content: '🔴'; }
.trade-summary li strong.wins::before { content: '🏆'; }

.trade-summary li span {
   font-weight: 700;
   color: #667eea;
   font-size: 16px;
   background: rgba(102, 126, 234, 0.1);
   padding: 5px 15px;
   border-radius: 20px;
   transition: all 0.3s ease;
}

.trade-summary li:hover span {
   background: rgba(102, 126, 234, 0.2);
   color: #5a67d8;
}

@media (max-width: 768px) {

  .tradejournal-table th,
  .tradejournal-table td {
    display: block;
    /* Stack columns on smaller screens */
    width: 100%;
  }

  .tradejournal-table th {
    display: none;
    /* Hide table headers on small screens */
  }

  .tradejournal-table td:before {
    content: attr(data-label);
    /* Show the table header as a label before the content */
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
  }
}

.tradejournal-thumbnail {
  width: 100px;
  /* Set a fixed width */
  height: auto;
  border-radius: 5px;
  /* Optional: rounded corners */
}

/* Container for the Isotope grid */
.tradejournal-posts {
  width: 100%;
  margin: 0 auto;
  container-type: inline-size;
  /* Enable container query support */
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* ===== MODERN DASHBOARD COMPONENTS ===== */

/* Modern Navigation Header */
.modern-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  padding: 15px 0;
  margin-bottom: 30px;
}

.modern-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.nav-brand {
  font-size: 1.8em;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background: var(--primary-gradient);
  color: white;
  transform: translateY(-2px);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* Enhanced Post Cards with Better Mobile UX */
.tradejournal-post {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: none;
  padding: clamp(15px, 5vw, 30px);
  border-radius: var(--border-radius);
  box-sizing: border-box;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 15px;
  cursor: pointer;
  touch-action: manipulation;
}

.tradejournal-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.tradejournal-post:hover {
  transform: translateY(-8px);
  box-shadow: var(--hover-shadow);
}

/* Touch-friendly interactions for mobile */
@media (hover: none) and (pointer: coarse) {
  .tradejournal-post {
    min-height: 200px;
    padding: 20px;
  }

  .tradejournal-post:active {
    transform: scale(0.98);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
  }
}

/* Featured image full width */
.tradejournal-thumbnail {
  width: 100%;
  height: auto;
  margin-bottom: 15px;
  border-radius: 8px;
}

/* For larger screens (3 columns) */
@container (min-width: 900px) {
  .tradejournal-post {
    width: calc(33.33% - 20px);
    /* 3 columns with space for gutter */
  }
}

/* For medium screens (2 columns) */
@container (min-width: 600px) and (max-width: 899px) {
  .tradejournal-post {
    width: calc(50% - 15px);
    /* 2 columns with space for gutter */
  }
}

/* For smaller screens (1 column) */
@container (max-width: 599px) {
  .tradejournal-post {
    width: 100%;
  }
}

.tradejournal-post {
  cursor: pointer;
  /* Changes the cursor to a hand */
}

/* Center the profit container and style it as a button */
.profit-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border-radius: 5px;
  color: #fff;
  text-align: center;
  margin-top: 10px;
  margin: 10px auto;
  /* Center horizontally */
  max-width: 200px;
  /* Set the max width */
}

.positive-profit {
  background-color: #4caf50;
  /* Green for positive profit */
}

.negative-profit {
  background-color: #f44336;
  /* Red for negative profit */
}

.zero-profit {
  background-color: #ff9800;
  /* Orange for zero profit */
}

.profit-container strong {
  margin-right: 5px;
  /* Adjust the space between PROFIT: and the value */
}

/* Make FooTable always take up 100% width */
.footable,
.footable table {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto;
  /* Center table if needed */
}

.tjwp-post-navigation {
  display: flex;
  justify-content: center;
  gap: 2rem;
  /* Adds space between the links */
  margin: 2rem 0;
  /* Adds vertical spacing around the navigation */
  font-size: 1rem;
  /* Optional: Adjust the font size */
}

.tjwp-post-navigation .nav-previous,
.tjwp-post-navigation .nav-next {
  text-align: center;
}

.tjwp-post-navigation a {
  text-decoration: none;
  color: #0073aa;
  /* Matches WordPress link color */
  transition: color 0.3s ease;
}

.tjwp-post-navigation a:hover {
   color: #005177;
   /* Darker shade for hover effect */
}

/* Modern Trading Calendar Styles */
.trading-calendar {
   max-width: 1000px;
   margin: 40px auto;
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
   background: #fff;
   border-radius: 20px;
   padding: 40px;
   box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.trading-calendar h3 {
   margin: 0 0 40px 0;
   text-align: center;
   font-size: 2.2em;
   font-weight: 300;
   color: #333;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.calendar-grid {
   display: grid;
   grid-template-columns: repeat(7, 1fr);
   gap: 8px;
   background: transparent;
}

.day-header {
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   color: white;
   padding: 18px 10px;
   text-align: center;
   font-weight: 600;
   font-size: 14px;
   text-transform: uppercase;
   letter-spacing: 1px;
   border-radius: 12px;
   box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.day-cell {
   background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
   padding: 15px 8px;
   text-align: center;
   min-height: 80px;
   position: relative;
   border-radius: 12px;
   transition: all 0.3s ease;
   box-shadow: 0 2px 10px rgba(0,0,0,0.08);
   border: 2px solid transparent;
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center;
   gap: 5px;
}

.day-cell:hover {
   transform: translateY(-3px);
   box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.day-cell.empty {
   background: rgba(248, 249, 250, 0.5);
   opacity: 0.6;
}

.day-cell.profitable {
   background: linear-gradient(135deg, #4CAF50 0%, #388e3c 100%);
   color: white;
   box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
   border-color: rgba(76, 175, 80, 0.2);
}

.day-cell.profitable:hover {
   box-shadow: 0 12px 30px rgba(76, 175, 80, 0.4);
}

.day-cell.loss {
   background: linear-gradient(135deg, #F44336 0%, #d32f2f 100%);
   color: white;
   box-shadow: 0 6px 20px rgba(244, 67, 54, 0.3);
   border-color: rgba(244, 67, 54, 0.2);
}

.day-cell.loss:hover {
   box-shadow: 0 12px 30px rgba(244, 67, 54, 0.4);
}

.day-cell.breakeven {
   background: linear-gradient(135deg, #FFC107 0%, #ff8f00 100%);
   color: #333;
   box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
   border-color: rgba(255, 193, 7, 0.2);
}

.day-cell.breakeven:hover {
   box-shadow: 0 12px 30px rgba(255, 193, 7, 0.4);
}

.day-cell.no-trade {
   background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
   color: white;
   box-shadow: 0 6px 20px rgba(158, 158, 158, 0.3);
   border-color: rgba(158, 158, 158, 0.2);
   font-style: italic;
}

.day-cell.no-trade:hover {
   box-shadow: 0 12px 30px rgba(158, 158, 158, 0.4);
}

.day-cell .day-number {
   font-size: 18px;
   font-weight: 700;
   line-height: 1;
   z-index: 2;
   position: relative;
}

.day-cell small {
   display: block;
   font-size: 11px;
   font-weight: 500;
   margin-top: 4px;
   padding: 2px 6px;
   background: rgba(255,255,255,0.2);
   border-radius: 8px;
   z-index: 2;
   position: relative;
}

/* Add hover tooltips with full details */
.day-cell::after {
   content: attr(title);
   position: absolute;
   bottom: -5px;
   left: 50%;
   transform: translateX(-50%);
   background: rgba(0,0,0,0.9);
   color: white;
   padding: 8px 12px;
   border-radius: 8px;
   font-size: 12px;
   font-weight: 500;
   opacity: 0;
   visibility: hidden;
   transition: all 0.3s ease;
   pointer-events: none;
   white-space: nowrap;
   z-index: 10;
}

.day-cell:hover::after {
   opacity: 1;
   visibility: visible;
   bottom: -8px;
}

/* Modern Performance Dashboard Styles */
.performance-dashboard {
   max-width: 1200px;
   margin: 40px auto;
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
   color: #333;
}

.performance-dashboard h3 {
   font-size: 2.5em;
   font-weight: 300;
   text-align: center;
   margin: 0 0 40px 0;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.stats-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 25px;
   margin: 40px 0;
}

.stat-card {
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   padding: 30px 20px;
   border-radius: 20px;
   text-align: center;
   box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
   transition: transform 0.3s ease, box-shadow 0.3s ease;
   border: 2px solid rgba(255,255,255,0.1);
}

.stat-card:hover {
   transform: translateY(-5px);
   box-shadow: 0 25px 45px rgba(102, 126, 234, 0.4);
}

.stat-card h4 {
   margin: 0 0 15px 0;
   font-size: 16px;
   font-weight: 400;
   color: rgba(255,255,255,0.9);
   text-transform: uppercase;
   letter-spacing: 1px;
}

.stat-card span {
   font-size: 2.5em;
   font-weight: 700;
   color: white;
   display: block;
   margin: 0;
   text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Loss cards in red */
.stat-card.worst-loss, .stat-card.average-loss {
   background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
   box-shadow: 0 15px 35px rgba(244, 67, 54, 0.3);
}

.stat-card.worst-loss:hover, .stat-card.average-loss:hover {
   box-shadow: 0 25px 45px rgba(244, 67, 54, 0.4);
}

/* Win cards in green */
.stat-card.best-win, .stat-card.average-win {
   background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
   box-shadow: 0 15px 35px rgba(76, 175, 80, 0.3);
}

.stat-card.best-win:hover, .stat-card.average-win:hover {
   box-shadow: 0 25px 45px rgba(76, 175, 80, 0.4);
}

.setups-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   gap: 25px;
   margin: 40px 0;
}

.setups-grid > div {
   background: #fff;
   border-radius: 15px;
   padding: 25px;
   box-shadow: 0 10px 30px rgba(0,0,0,0.1);
   border: 1px solid #f0f0f0;
}

.setups-grid h4 {
   margin: 0 0 20px 0;
   font-size: 1.4em;
   color: #333;
   border-bottom: none;
   padding-bottom: 0;
   position: relative;
}

.setups-grid h4::after {
   content: '';
   position: absolute;
   bottom: -5px;
   left: 0;
   width: 50px;
   height: 3px;
   background: linear-gradient(90deg, #667eea, #764ba2);
   border-radius: 2px;
}

.setups-grid ul {
   list-style: none;
   padding: 0;
   margin: 0;
}

.setups-grid li {
   padding: 12px 0;
   border-bottom: 1px solid #f5f5f5;
   display: flex;
   justify-content: space-between;
   align-items: center;
   transition: background-color 0.2s ease;
}

.setups-grid li:hover {
   background-color: #f9f9ff;
   border-radius: 8px;
   margin: 0 -10px;
   padding: 12px 10px;
}

.setups-grid li:last-child {
   border-bottom: none;
}

.setups-grid .stat-value {
   font-weight: 700;
   color: #667eea;
   background: rgba(102, 126, 234, 0.1);
   padding: 4px 12px;
   border-radius: 15px;
   font-size: 14px;
}

/* Top instruments section */
.performance-dashboard h4 {
   font-size: 1.8em;
   color: #333;
   text-align: center;
   margin: 50px 0 20px 0;
   position: relative;
}

.performance-dashboard h4::after {
   content: '';
   position: absolute;
   bottom: -10px;
   left: 50%;
   transform: translateX(-50%);
   width: 100px;
   height: 3px;
   background: linear-gradient(90deg, #667eea, #764ba2);
   border-radius: 2px;
}

.performance-dashboard > ul {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 20px;
   list-style: none;
   padding: 0;
   margin: 30px 0;
}

.performance-dashboard > ul li {
   background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
   padding: 20px;
   border-radius: 15px;
   text-align: center;
   box-shadow: 0 5px 15px rgba(0,0,0,0.08);
   transition: transform 0.3s ease, box-shadow 0.3s ease;
   border: 1px solid #dee2e6;
}

.performance-dashboard > ul li:hover {
   transform: translateY(-3px);
   box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.performance-dashboard > ul li strong {
   display: block;
   font-size: 2em;
   margin-bottom: 8px;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.performance-dashboard > ul li span {
   color: #6c757d;
   font-size: 0.9em;
   font-weight: 500;
}

/* PNL Chart Styles - Modern Bar Chart */
.pnl-chart {
   max-width: 1200px;
   margin: 30px auto;
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   border-radius: 20px;
   padding: 30px;
   box-shadow: 0 20px 40px rgba(0,0,0,0.1);
   color: white;
}

.pnl-chart h3 {
   margin: 0 0 30px 0;
   text-align: center;
   font-size: 2em;
   font-weight: 300;
   text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.chart-container {
   display: flex;
   align-items: end;
   justify-content: center;
   gap: 15px;
   height: 350px;
   padding: 40px 20px 60px;
   position: relative;
}

.chart-bar {
   flex: 1;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 10px;
   max-width: 80px;
}

.bar {
   width: 100%;
   max-width: 60px;
   background: linear-gradient(180deg, #4CAF50 0%, #45a049 100%);
   border-radius: 8px 8px 0 0;
   box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
   transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
   cursor: pointer;
   min-height: 5px;
   position: relative;
   overflow: hidden;
}

.bar:hover {
   transform: translateY(-5px);
   box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
}

.bar.loss {
   background: linear-gradient(180deg, #F44336 0%, #d32f2f 100%);
   box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.bar.loss:hover {
   box-shadow: 0 8px 25px rgba(244, 67, 54, 0.5);
}

.bar.zero {
   background: linear-gradient(180deg, #FFC107 0%, #ff8f00 100%);
   box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.bar.zero:hover {
   box-shadow: 0 8px 25px rgba(255, 193, 7, 0.5);
}

.bar::after {
   content: attr(title);
   position: absolute;
   top: -35px;
   left: 50%;
   transform: translateX(-50%);
   background: rgba(0,0,0,0.8);
   color: white;
   padding: 8px 12px;
   border-radius: 6px;
   font-size: 12px;
   font-weight: 500;
   opacity: 0;
   transition: opacity 0.3s;
   pointer-events: none;
   white-space: nowrap;
}

.bar:hover::after {
   opacity: 1;
}

.bar-label {
   font-size: 12px;
   text-align: center;
   font-weight: 500;
   color: rgba(255,255,255,0.9);
   transform: rotate(-45deg);
   white-space: nowrap;
   margin-top: 5px;
}

/* Zero line indicator */
.chart-container::after {
    content: '';
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.6);
    z-index: 1;
}

/* Trade Table Styles */
.tradejournal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
}

.tradejournal-table thead th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 10px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* --- PERFORMANCE DASHBOARD READABILITY + ICON SCALE --- */
.performance-dashboard h3 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.25;
}

.performance-dashboard h4 {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.35;
}

.setups-grid h4 {
  font-size: 1.05rem;
  line-height: 1.35;
}

.setups-grid li,
.setups-grid li span {
  color: #1f2937;
}

body.tjwp-dark-mode .performance-dashboard,
[data-theme="dark"] .performance-dashboard {
  color: #e5e7eb;
}

body.tjwp-dark-mode .setups-grid > div,
[data-theme="dark"] .setups-grid > div,
body.tjwp-dark-mode .performance-dashboard > ul li,
[data-theme="dark"] .performance-dashboard > ul li {
  background: #0f172a;
  border: 1px solid #334155;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.45);
}

body.tjwp-dark-mode .setups-grid h4,
body.tjwp-dark-mode .setups-grid li,
body.tjwp-dark-mode .setups-grid li span,
body.tjwp-dark-mode .performance-dashboard h4,
body.tjwp-dark-mode .performance-dashboard > ul li strong,
[data-theme="dark"] .setups-grid h4,
[data-theme="dark"] .setups-grid li,
[data-theme="dark"] .setups-grid li span,
[data-theme="dark"] .performance-dashboard h4,
[data-theme="dark"] .performance-dashboard > ul li strong {
  color: #e2e8f0;
}

body.tjwp-dark-mode .setups-grid li,
[data-theme="dark"] .setups-grid li {
  border-bottom-color: #334155;
}

body.tjwp-dark-mode .setups-grid li:hover,
[data-theme="dark"] .setups-grid li:hover {
  background: #1e293b;
}

body.tjwp-dark-mode .setups-grid .stat-value,
[data-theme="dark"] .setups-grid .stat-value {
  background: rgba(96, 165, 250, 0.2);
  color: #bfdbfe;
}

.tradejournal-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f1f1;
  text-align: center;
}

.tradejournal-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.trade-row {
  transition: background 0.2s;
}

.trade-row:hover {
  background: rgba(102, 126, 234, 0.1) !important;
}

.expand-row {
  cursor: pointer;
  background: #667eea;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  transition: background 0.3s;
}

.expand-row:hover {
  background: #5a67d8;
}

.trade-details {
  background: #f8f9fa;
  padding: 15px;
  border-top: none;
}

/* Single Post Styling */
.single-tradejournal .entry-content {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
  margin: 20px 0;
}

.single-tradejournal .entry-title {
  font-size: 2.5em;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

/* Risk Calculators */
.risk-calculators {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
}

.risk-calculators .calculator {
  margin-bottom: 30px;
}

.risk-calculators label {
  display: block;
  margin: 10px 0;
}

.risk-calculators input {
  margin-left: 10px;
  padding: 5px;
}

.risk-calculators button {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

.risk-calculators button:hover {
  background: #5a67d8;
}

.risk-calculators p {
  margin-top: 10px;
  font-weight: bold;
  color: #667eea;
}

/* Portfolio Overview */
.portfolio-overview {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
}

.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.portfolio-table th, .portfolio-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.portfolio-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.binance-balance {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
}

.balance-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.balance-table th, .balance-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.balance-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Trader Portfolio Styles */
.trader-portfolio {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.trader-portfolio h3 {
  margin: 0 0 30px 0;
  text-align: center;
  font-size: 2em;
  font-weight: 300;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.portfolio-item {
  background: rgba(255,255,255,0.9);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.6);
  transition: transform 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-3px);
}

.portfolio-item strong {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.portfolio-item strong::after {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  margin-top: 5px;
  border-radius: 1px;
}

.trader-portfolio h4 {
  margin: 30px 0 15px 0;
  font-size: 1.4em;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.trader-portfolio ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trader-portfolio li {
  background: rgba(255,255,255,0.8);
  padding: 12px 15px;
  margin-bottom: 8px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: background 0.3s ease;
}

.trader-portfolio li:hover {
    background: rgba(255,255,255,1);
}

.transaction-history {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    overflow: hidden;
}

.transaction-history th,
.transaction-history td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.transaction-history th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.transaction-history tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ===== AI INSIGHTS STYLES ===== */

.ai-insights {
    max-width: 1400px;
    margin: 40px auto;
    font-family: var(--font-primary);
    color: #333;
}

.ai-insights h3 {
    font-size: clamp(2em, 5vw, 3em);
    font-weight: 300;
    text-align: center;
    margin: 0 0 40px 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.ai-widget {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: var(--transition);
}

.ai-widget:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.ai-widget h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Performance Analysis */
.insight-metrics {
    display: grid;
    gap: 15px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.metric .label {
    font-weight: 500;
    color: #555;
}

.metric .value {
    font-weight: 700;
    font-size: 1.2em;
    color: #667eea;
}

/* Pattern Recognition */
.pattern-insights {
    display: grid;
    gap: 15px;
}

.pattern-item {
    background: rgba(76, 175, 80, 0.05);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #4CAF50;
}

.pattern-item strong {
    display: block;
    color: #2E7D32;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.confidence {
    background: rgba(76, 175, 80, 0.1);
    color: #2E7D32;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 10px;
    display: inline-block;
}

.pattern-item p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

/* Recommendations */
.recommendations {
    grid-column: 1 / -1;
}

.recommendations-list {
    display: grid;
    gap: 20px;
}

.recommendation-item {
    border-radius: 12px;
    padding: 25px;
    border-left: 5px solid;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.recommendation-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.recommendation-item.high-priority {
    border-left-color: #F44336;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.05) 0%, rgba(244, 67, 54, 0.02) 100%);
}

.recommendation-item.medium-priority {
    border-left-color: #FF9800;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05) 0%, rgba(255, 152, 0, 0.02) 100%);
}

.recommendation-item.low-priority {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(76, 175, 80, 0.02) 100%);
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.rec-header strong {
    font-size: 1.2em;
    color: #333;
    flex: 1;
}

.priority-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recommendation-item.high-priority .priority-badge {
    background: #F44336;
    color: white;
}

.recommendation-item.medium-priority .priority-badge {
    background: #FF9800;
    color: white;
}

.recommendation-item.low-priority .priority-badge {
    background: #4CAF50;
    color: white;
}

.recommendation-item p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #555;
}

.rec-action {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 500;
    color: #667eea;
    font-style: italic;
}

/* Risk Assessment */
.risk-metrics {
    display: grid;
    gap: 20px;
}

.risk-level {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
}

.risk-level.low-risk {
    background: linear-gradient(135deg, #E8F5E8 0%, #C8E6C9 100%);
    color: #2E7D32;
    border: 2px solid #4CAF50;
}

.risk-level.medium-risk {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    color: #E65100;
    border: 2px solid #FF9800;
}

.risk-level.high-risk {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    color: #C62828;
    border: 2px solid #F44336;
}

.risk-label {
    display: block;
    font-size: 1.2em;
    margin-bottom: 8px;
}

.risk-value {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
}

.risk-factors {
    display: grid;
    gap: 12px;
}

.risk-factor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(244, 67, 54, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(244, 67, 54, 0.1);
}

.factor-name {
    font-weight: 500;
    color: #333;
}

.factor-impact {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.factor-impact.high {
    background: #F44336;
    color: white;
}

.factor-impact.medium {
    background: #FF9800;
    color: white;
}

.factor-impact.low {
    background: #4CAF50;
    color: white;
}

/* Mobile responsiveness for AI insights */
@media (max-width: 768px) {
    .ai-insights {
        margin: 20px 10px;
    }

    .ai-insights-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ai-widget {
        padding: 20px;
    }

    .recommendations {
        grid-column: auto;
    }

    .metric {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rec-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Dark mode support for AI insights */
[data-theme="dark"] .ai-insights {
    color: #e9ecef;
}

[data-theme="dark"] .ai-widget {
    background: linear-gradient(135deg, #2a2a4e 0%, #1e2a4a 100%);
    color: #e9ecef;
}

[data-theme="dark"] .recommendation-item {
    background: linear-gradient(135deg, #2a2a4e 0%, #1e2a4a 100%);
    color: #e9ecef;
}

/* ===== BACKTESTING STYLES ===== */

.backtesting-engine {
    max-width: 1400px;
    margin: 40px auto;
    font-family: var(--font-primary);
    color: #333;
}

.backtesting-engine h3 {
    font-size: clamp(2em, 5vw, 3em);
    font-weight: 300;
    text-align: center;
    margin: 0 0 40px 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.backtest-config {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    margin-bottom: 40px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.config-panel h4 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.6em;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.backtest-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 15px;
}

.form-row label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.form-row input,
.form-row select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.rules-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.rules-section h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.rule-item select,
.rule-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.remove-rule {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: var(--transition);
}

.remove-rule:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.add-rule-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    margin-top: 10px;
}

.add-rule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.run-backtest-btn {
    background: var(--success-gradient);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.run-backtest-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.save-strategy-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.save-strategy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Results Display */
.backtest-results {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin-bottom: 40px;
}

.results-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-metric {
    background: rgba(102, 126, 234, 0.05);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
}

.results-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.chart-container canvas {
    max-height: 300px;
}

/* Trades Table */
.detailed-results h5 {
    color: #333;
    font-size: 1.4em;
    margin: 0 0 20px 0;
    font-weight: 600;
}

.trades-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.trades-table th,
.trades-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.trades-table th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

.trades-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.winning-trade {
    background: rgba(76, 175, 80, 0.05);
}

.losing-trade {
    background: rgba(244, 67, 54, 0.05);
}

.trades-table .positive {
    color: #2e7d32;
    font-weight: 600;
}

.trades-table .negative {
    color: #c62828;
    font-weight: 600;
}

/* Action Buttons */
.backtest-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.export-btn,
.optimize-btn,
.compare-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover,
.optimize-btn:hover,
.compare-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* Saved Strategies */
.saved-strategies {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.saved-strategies h4 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.strategies-list {
    display: grid;
    gap: 15px;
}

.saved-strategy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: var(--transition);
}

.saved-strategy-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.strategy-info h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1em;
}

.strategy-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

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

.load-strategy-btn,
.delete-strategy-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.load-strategy-btn {
    background: var(--primary-gradient);
    color: white;
}

.load-strategy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.delete-strategy-btn {
    background: #f44336;
    color: white;
}

.delete-strategy-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

/* Notifications */
.backtest-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    max-width: 350px;
}

.backtest-notification.success {
    background: #4caf50;
}

.backtest-notification.error {
    background: #f44336;
}

.backtest-notification.info {
    background: #2196f3;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .backtesting-engine {
        margin: 20px 10px;
    }

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

    .form-row label {
        white-space: normal;
        font-weight: 600;
    }

    .rule-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .rule-item select,
    .rule-item input {
        width: 100%;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

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

    .saved-strategy-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .strategy-actions {
        justify-content: center;
    }

    .backtest-actions {
        justify-content: center;
    }
}

/* Dark mode support for backtesting */
[data-theme="dark"] .backtest-config,
[data-theme="dark"] .backtest-results,
[data-theme="dark"] .saved-strategies {
    background: linear-gradient(135deg, #2a2a4e 0%, #1e2a4a 100%);
    color: #e9ecef;
}

[data-theme="dark"] .rule-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .form-row input,
[data-theme="dark"] .form-row select,
[data-theme="dark"] .rule-item select,
[data-theme="dark"] .rule-item input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e9ecef;
}

[data-theme="dark"] .trades-table th {
    background: var(--primary-gradient);
}

[data-theme="dark"] .saved-strategy-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ===== NEWS & ANNOUNCEMENTS STYLES ===== */

.trading-news-system {
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--font-primary);
}

.news-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
}

.news-header h3 {
  font-size: 2.5em;
  font-weight: 300;
  color: #333;
  margin: 0 0 15px 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.news-header p {
  color: #6c757d;
  font-size: 1.1em;
  margin: 0 0 25px 0;
}

/* News Filters */
.news-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 25px;
}

.filter-btn {
  padding: 10px 20px;
  border: 2px solid #e9ecef;
  background: white;
  color: #495057;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.filter-btn:hover {
  border-color: #667eea;
  background: #f8f9fa;
}

.filter-btn.active {
  background: var(--primary-gradient);
  border-color: #667eea;
  color: white;
}

/* Featured News */
.featured-news {
  margin-bottom: 50px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
}

.featured-image {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.featured-news:hover .featured-img {
  transform: scale(1.05);
}

.no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4em;
  color: white;
}

.featured-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
  display: flex;
  align-items: flex-end;
}

.featured-content {
  padding: 40px;
  color: white;
  max-width: 600px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.featured-badge {
  background: #ff6b35;
  color: white;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.featured-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.featured-title {
  font-size: 2.2em;
  font-weight: 700;
  margin: 0 0 15px 0;
  line-height: 1.2;
}

.featured-title a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.featured-title a:hover {
  color: #667eea;
}

.featured-excerpt {
  font-size: 1.1em;
  line-height: 1.6;
  margin: 0 0 20px 0;
  color: rgba(255, 255, 255, 0.9);
}

.read-more-btn {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 12px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.read-more-btn:hover {
  background: #5a67d8;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* News Container */
.news-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.news-container.list-layout {
  grid-template-columns: 1fr;
  gap: 25px;
}

.news-container.card-layout {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* News Items */
.news-item {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
}

.news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.news-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-item:hover .news-img {
  transform: scale(1.1);
}

.news-no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  color: #6c757d;
}

.news-category {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--primary-gradient);
  color: white;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.news-content {
  padding: 25px;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 12px;
  color: #6c757d;
  flex-wrap: wrap;
  gap: 10px;
}

.news-date,
.news-author,
.news-views {
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-title {
  font-size: 1.4em;
  font-weight: 600;
  margin: 0 0 15px 0;
  line-height: 1.3;
}

.news-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.news-title a:hover {
  color: #667eea;
}

.news-excerpt {
  color: #6c757d;
  line-height: 1.6;
  margin: 0 0 20px 0;
  font-size: 14px;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  flex-wrap: wrap;
  gap: 15px;
}

.news-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.comments-count {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
}

.read-more-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
}

.read-more-link:hover {
  color: #5a67d8;
  text-decoration: underline;
}

/* News Pagination */
.news-pagination {
  margin-bottom: 50px;
  text-align: center;
}

.news-pagination .page-numbers {
  display: inline-block;
  padding: 10px 15px;
  margin: 0 5px;
  background: white;
  color: #495057;
  text-decoration: none;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.news-pagination .page-numbers:hover,
.news-pagination .page-numbers.current {
  background: var(--primary-gradient);
  color: white;
  border-color: #667eea;
}

/* No News State */
.no-news {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin: 40px 0;
}

.no-news-icon {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-news h3 {
  color: #333;
  margin: 0 0 15px 0;
  font-size: 1.5em;
}

.no-news p {
  color: #6c757d;
  margin: 0;
  font-size: 1.1em;
}

/* Newsletter Signup */
.newsletter-signup {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
  color: white;
  margin-top: 50px;
}

.newsletter-content {
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-icon {
  font-size: 3em;
  margin-bottom: 20px;
}

.newsletter-signup h3 {
  font-size: 2em;
  font-weight: 300;
  margin: 0 0 15px 0;
  color: white;
}

.newsletter-signup p {
  font-size: 1.1em;
  margin: 0 0 30px 0;
  opacity: 0.9;
  line-height: 1.6;
}

.newsletter-input-group {
  display: flex;
  gap: 15px;
  max-width: 500px;
  margin: 0 auto 20px auto;
  flex-wrap: wrap;
}

.newsletter-input-group input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  min-width: 250px;
}

.newsletter-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.newsletter-btn:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

#newsletter-message {
  margin-top: 15px;
  font-weight: 500;
}

/* ===== RESPONSIVE DESIGN FOR NEWS ===== */
@media (max-width: 768px) {
  .trading-news-system {
    padding: 0 15px;
  }

  .news-header h3 {
    font-size: 2em;
  }

  .news-filters {
    gap: 10px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 80px;
  }

  .featured-content {
    padding: 30px 20px;
  }

  .featured-title {
    font-size: 1.8em;
  }

  .news-container {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .news-content {
    padding: 20px;
  }

  .news-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .news-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .newsletter-signup {
    margin: 30px 15px;
    padding: 30px 20px;
  }

  .newsletter-input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-input-group input {
    min-width: auto;
  }

  .newsletter-btn {
    align-self: center;
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .trading-news-system {
    padding: 0 10px;
  }

  .news-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
  }

  .news-header h3 {
    font-size: 1.5em;
  }

  .featured-news {
    margin-bottom: 30px;
  }

  .featured-image {
    height: 250px;
  }

  .featured-content {
    padding: 20px;
  }

  .featured-title {
    font-size: 1.5em;
  }

  .news-item {
    margin: 0 -10px;
    border-radius: 0;
  }

  .newsletter-signup {
    margin: 20px 10px 0;
    border-radius: 15px;
  }
}

/* ===== LEADERBOARD STYLES ===== */

.trading-leaderboard {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.1);
  font-family: var(--font-primary);
}

.leaderboard-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
}

.leaderboard-header h3 {
  font-size: 2.5em;
  font-weight: 300;
  color: #333;
  margin: 0 0 15px 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.leaderboard-header p {
  color: #6c757d;
  font-size: 1.1em;
  margin: 0 0 25px 0;
}

/* Leaderboard Filters */
.leaderboard-filters {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 16px;
  background: white;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Leaderboard Podium */
.leaderboard-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 50px;
  align-items: end;
}

.podium-position {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.podium-position.first {
  order: 2;
  transform: translateY(-20px);
}

.podium-position.second {
  order: 1;
}

.podium-position.third {
  order: 3;
}

.podium-avatar {
  position: relative;
  margin-bottom: 20px;
}

.podium-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--primary-gradient);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.rank-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: white;
}

.rank-badge.rank-1 {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.rank-badge.rank-2 {
  background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
  box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
}

.rank-badge.rank-3 {
  background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
  box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

.podium-info {
  text-align: center;
  margin-bottom: 20px;
}

.podium-info h4 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  font-weight: 600;
  color: #333;
}

.podium-stats {
  display: grid;
  gap: 8px;
}

.podium-stats .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 14px;
}

.podium-stats .stat-label {
  font-weight: 500;
  color: #495057;
}

.podium-stats .stat-value {
  font-weight: 600;
  color: #667eea;
}

.podium-base {
  width: 100%;
  max-width: 120px;
  position: relative;
}

.podium-height {
  background: var(--primary-gradient);
  border-radius: 10px 10px 0 0;
  min-height: 40px;
  width: 100%;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Leaderboard Table */
.leaderboard-table-container {
  overflow-x: auto;
  margin-bottom: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 14px;
}

.leaderboard-table thead th {
  background: var(--primary-gradient);
  color: white;
  padding: 20px 15px;
  font-weight: 600;
  font-size: 16px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
}

.leaderboard-table tbody td {
  padding: 18px 15px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.leaderboard-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.leaderboard-table tbody tr.current-user {
  background: rgba(102, 126, 234, 0.1);
  border-left: 4px solid #667eea;
}

/* Rank Cell */
.rank-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  color: #333;
  min-width: 80px;
}

.rank-number {
  font-size: 20px;
  font-weight: bold;
}

.rank-medal {
  font-size: 16px;
}

/* Trader Cell */
.trader-cell {
  min-width: 200px;
}

.trader-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.trader-info img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid #e9ecef;
}

.trader-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trader-name {
  font-weight: 600;
  color: #333;
  font-size: 16px;
}

.trader-level {
  font-size: 12px;
  color: #6c757d;
  background: #f8f9fa;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

/* P&L Cell */
.pnl-cell {
  font-weight: 600;
  font-size: 16px;
  min-width: 120px;
}

.pnl-amount.positive {
  color: #28a745;
}

.pnl-amount.negative {
  color: #dc3545;
}

/* Win Rate Cell */
.win-rate-cell {
  min-width: 150px;
}

.win-rate-bar {
  position: relative;
  height: 24px;
  background: #e9ecef;
  border-radius: 12px;
  overflow: hidden;
}

.win-rate-fill {
  height: 100%;
  background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
  transition: width 0.3s ease;
}

.win-rate-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 12px;
  color: #333;
}

/* Level Cell */
.level-cell {
  min-width: 100px;
}

.level-badge {
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.level-badge.level-beginner {
  background: #e3f2fd;
  color: #1976d2;
}

.level-badge.level-intermediate {
  background: #f3e5f5;
  color: #7b1fa2;
}

.level-badge.level-advanced {
  background: #fff3e0;
  color: #f57c00;
}

.level-badge.level-professional {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #333;
}

/* Actions Cell */
.actions-cell {
  min-width: 150px;
}

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

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.action-btn.view-profile {
  background: #667eea;
  color: white;
}

.action-btn.view-profile:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.action-btn.follow-btn {
  background: #28a745;
  color: white;
}

.action-btn.follow-btn:hover {
  background: #218838;
  transform: translateY(-1px);
}

/* Leaderboard Stats */
.leaderboard-stats {
  margin-bottom: 40px;
}

.stat-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
}

.stat-box h4 {
  margin: 0 0 25px 0;
  color: #333;
  font-size: 1.5em;
  font-weight: 600;
}

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

.stats-grid .stat-item {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-number {
  display: block;
  font-size: 2em;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

/* Achievement Badges */
.achievement-badges {
  margin-bottom: 30px;
}

.achievement-badges h4 {
  text-align: center;
  margin: 0 0 30px 0;
  font-size: 1.5em;
  font-weight: 600;
  color: #333;
}

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

.badge-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.badge-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.badge-icon {
  font-size: 2.5em;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  border-radius: 50%;
  color: white;
  flex-shrink: 0;
}

.badge-info h5 {
  margin: 0 0 8px 0;
  font-size: 1.2em;
  font-weight: 600;
  color: #333;
}

.badge-info p {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
  line-height: 1.4;
}

/* ===== RESPONSIVE DESIGN FOR LEADERBOARD ===== */
@media (max-width: 768px) {
  .trading-leaderboard {
    margin: 15px;
    padding: 25px 20px;
  }

  .leaderboard-header h3 {
    font-size: 2em;
  }

  .leaderboard-filters {
    flex-direction: column;
    align-items: center;
  }

  .filter-select {
    min-width: 250px;
  }

  .leaderboard-podium {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .podium-position {
    order: unset !important;
    transform: none !important;
  }

  .podium-info h4 {
    font-size: 1.1em;
  }

  .leaderboard-table {
    font-size: 13px;
  }

  .leaderboard-table thead th,
  .leaderboard-table tbody td {
    padding: 12px 8px;
  }

  .rank-cell,
  .trader-cell,
  .pnl-cell,
  .win-rate-cell {
    min-width: auto;
  }

  .trader-info {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .trader-details {
    align-items: center;
  }

  .trader-actions {
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .badge-item {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .trading-leaderboard {
    margin: 10px;
    padding: 20px 15px;
  }

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

  .leaderboard-table-container {
    margin: 0 -15px;
    border-radius: 0;
  }

  .leaderboard-table {
    min-width: 600px; /* Ensure table doesn't get too cramped */
  }
}

/* ===== TRADE ENTRY FORM STYLES ===== */

.trade-entry-form {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.1);
  font-family: var(--font-primary);
}

.form-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
}

.form-header h3 {
  font-size: 2.5em;
  font-weight: 300;
  color: #333;
  margin: 0 0 15px 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-header p {
  color: #6c757d;
  font-size: 1.1em;
  margin: 0;
}

/* Trade Templates */
.trade-templates {
  margin-bottom: 30px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 15px;
  border: 1px solid #e9ecef;
}

.trade-templates h4 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 1.2em;
  font-weight: 600;
}

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

.template-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 60px;
}

.template-btn:hover {
  border-color: #667eea;
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

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

/* Form Sections */
.form-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h4 {
  color: #333;
  font-size: 1.4em;
  margin: 0 0 25px 0;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-gradient);
  padding-bottom: 8px;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  min-height: 50px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.form-group select[multiple] {
  min-height: 120px;
}

/* Form Hints */
.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
}

/* File Upload */
.file-preview {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-preview img {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: border-color 0.3s ease;
}

.file-preview img:hover {
  border-color: #667eea;
}

/* P&L Calculator */
.pnl-calculator {
  margin-top: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  border: 1px solid #dee2e6;
}

.pnl-calculator h4 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 1.2em;
  font-weight: 600;
}

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

.calc-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.calc-result .label {
  font-weight: 500;
  color: #495057;
}

.calc-result .value {
  font-weight: 700;
  font-size: 1.2em;
  color: #667eea;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #f0f0f0;
}

.btn-outline {
  background: transparent;
  color: #6c757d;
  border: 2px solid #dee2e6;
}

.btn-outline:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

/* Messages */
.trade-form-message {
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  font-weight: 500;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.trade-form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.trade-form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ===== RESPONSIVE DESIGN FOR TRADE FORM ===== */
@media (max-width: 768px) {
  .trade-entry-form {
    margin: 15px;
    padding: 25px 20px;
  }

  .form-header h3 {
    font-size: 2em;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .template-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .calculator-display {
    grid-template-columns: 1fr;
  }

  .calc-result {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .trade-entry-form {
    margin: 10px;
    padding: 20px 15px;
  }

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

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

  .form-section h4 {
    font-size: 1.2em;
  }
}

/* ===== USER DASHBOARD STYLES ===== */

.user-dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

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

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--primary-gradient);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details h2 {
  margin: 0 0 5px 0;
  font-size: 2em;
  font-weight: 600;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-role {
  margin: 0;
  color: #6c757d;
  font-size: 1.1em;
  font-weight: 500;
}

.user-meta {
  margin-top: 8px;
}

.member-since {
  font-size: 0.9em;
  color: #6c757d;
  background: #f8f9fa;
  padding: 4px 12px;
  border-radius: 20px;
}

.dashboard-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.btn-secondary:hover {
  background: #e9ecef;
  color: #212529;
}

/* Statistics Overview */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: white;
  flex-shrink: 0;
}

.stat-content h3 {
  margin: 0 0 5px 0;
  font-size: 2em;
  font-weight: 700;
  color: #333;
}

.stat-content p {
  margin: 0 0 8px 0;
  color: #6c757d;
  font-size: 0.9em;
  font-weight: 500;
}

.stat-change {
  font-size: 0.85em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.stat-change.positive {
  background: #d4edda;
  color: #155724;
}

.stat-change.negative {
  background: #f8d7da;
  color: #721c24;
}

.stat-trades,
.stat-balance {
  font-size: 0.8em;
  color: #6c757d;
  font-weight: 400;
}

.stat-rate {
  font-size: 0.85em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.stat-rate.good {
  background: #d4edda;
  color: #155724;
}

.stat-rate.poor {
  background: #fff3cd;
  color: #856404;
}

/* Dashboard Content */
.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

/* Dashboard Widgets */
.dashboard-widget {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  overflow: hidden;
}

.widget-header {
  padding: 25px 30px 15px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget-header h3 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 600;
  color: #333;
}

.view-all,
.manage-link {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  transition: color 0.3s ease;
}

.view-all:hover,
.manage-link:hover {
  color: #5a67d8;
  text-decoration: underline;
}

.widget-content {
  padding: 25px 30px;
}

/* Chart Toggle */
.chart-toggle {
  display: flex;
  gap: 5px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 3px;
}

.chart-btn {
  padding: 6px 15px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chart-btn.active {
  background: white;
  color: #495057;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Portfolio Summary */
.portfolio-summary {
  display: grid;
  gap: 15px;
}

.portfolio-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.portfolio-item .label {
  font-weight: 500;
  color: #495057;
}

.portfolio-item .value {
  font-weight: 600;
  color: #333;
}

.portfolio-item .value.positive {
  color: #28a745;
}

.portfolio-item .value.negative {
  color: #dc3545;
}

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

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 15px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  text-decoration: none;
  color: #495057;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 100px;
}

.action-btn:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn svg {
  opacity: 0.7;
}

/* Dashboard Messages */
.dashboard-message {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
  max-width: 500px;
  margin: 40px auto;
}

.dashboard-message h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.5em;
}

.dashboard-message p {
  margin: 0 0 20px 0;
  color: #6c757d;
}

.dashboard-message.error {
  border-left: 4px solid #dc3545;
}

.dashboard-message.error h3 {
  color: #dc3545;
}

/* ===== RESPONSIVE DESIGN FOR DASHBOARD ===== */
@media (max-width: 1024px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }

  .stats-overview {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .user-dashboard {
    padding: 15px;
  }

  .dashboard-header {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }

  .user-info {
    flex-direction: column;
    gap: 15px;
  }

  .dashboard-actions {
    width: 100%;
    justify-content: center;
  }

  .stats-overview {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .stat-card {
    padding: 20px;
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .stat-icon {
    width: 50px;
    height: 50px;
  }

  .stat-content h3 {
    font-size: 1.5em;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-btn {
    min-height: 80px;
    padding: 15px 10px;
  }

  .widget-header {
    padding: 20px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .widget-content {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .action-btn {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    min-height: 60px;
  }

  .portfolio-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* ===== USER REGISTRATION & LOGIN STYLES ===== */

.user-registration-form,
.user-login-form {
  max-width: 600px;
  margin: 40px auto;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.1);
  font-family: var(--font-primary);
}

.registration-header,
.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.registration-header h3,
.login-header h3 {
  font-size: 2.2em;
  font-weight: 300;
  color: #333;
  margin: 0 0 15px 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.registration-header p,
.login-header p {
  color: #6c757d;
  font-size: 1.1em;
  margin: 0;
}

/* Form Sections */
.form-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h4 {
  color: #333;
  font-size: 1.4em;
  margin: 0 0 20px 0;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-gradient);
  padding-bottom: 8px;
}

/* Form Rows and Groups */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: white;
  min-height: 50px;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Password Strength */
.password-strength {
  margin-top: 8px;
}

.password-strength-meter {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  margin-bottom: 4px;
  transition: all 0.3s ease;
}

.password-strength-meter.very-weak { background: #dc3545; width: 20%; }
.password-strength-meter.weak { background: #fd7e14; width: 40%; }
.password-strength-meter.fair { background: #ffc107; width: 60%; }
.password-strength-meter.good { background: #20c997; width: 80%; }
.password-strength-meter.strong { background: #28a745; width: 100%; }

.password-strength-text {
  font-size: 12px;
  color: #6c757d;
}

/* Avatar Preview */
#avatar-preview {
  margin-top: 10px;
  text-align: center;
}

#avatar-preview img {
  border: 2px solid #e9ecef;
  transition: border-color 0.3s ease;
}

#avatar-preview img:hover {
  border-color: #667eea;
}

/* Checkbox Groups */
.checkbox-group {
  margin: 15px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}

.checkbox-label input[type="checkbox"] {
  margin: 0 10px 0 0;
  width: 18px;
  height: 18px;
  accent-color: #667eea;
}

.checkmark {
  position: relative;
  margin-right: 10px;
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 3px;
  background: white;
  transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  color: #667eea;
  font-size: 14px;
  font-weight: bold;
}

/* Social Login */
.social-login-section {
  margin-bottom: 30px;
}

.social-login-buttons {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-height: 50px;
}

.google-btn {
  background: #fff;
  color: #757575;
  border: 1px solid #dadce0;
}

.google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.facebook-btn {
  background: #1877f2;
  color: white;
}

.facebook-btn:hover {
  background: #166fe5;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.twitter-btn {
  background: #1da1f2;
  color: white;
}

.twitter-btn:hover {
  background: #1a91da;
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e9ecef;
}

.divider span {
  background: white;
  padding: 0 15px;
  color: #6c757d;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

/* Password Input Group */
.password-input-group {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: color 0.3s ease;
}

.toggle-password:hover {
  color: #667eea;
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.forgot-password {
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* Form Actions */
.form-actions {
  margin-top: 30px;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 50px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

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

/* Form Footer */
.form-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.form-footer p {
  margin: 0;
  color: #6c757d;
}

.form-footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

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

/* Messages */
.registration-message,
.login-message {
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  font-weight: 500;
  text-align: center;
}

.registration-message.success,
.login-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.registration-message.error,
.login-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.logout-link {
  color: #dc3545;
  text-decoration: none;
  font-weight: 500;
}

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

/* ===== RESPONSIVE DESIGN FOR USER FORMS ===== */
@media (max-width: 768px) {
  .user-registration-form,
  .user-login-form {
    margin: 20px 15px;
    padding: 25px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .social-login-buttons {
    grid-template-columns: 1fr;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .registration-header h3,
  .login-header h3 {
    font-size: 1.8em;
  }

  .form-section h4 {
    font-size: 1.2em;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .user-registration-form,
  .user-login-form {
    margin: 15px 10px;
    padding: 20px 15px;
  }

  .registration-header h3,
  .login-header h3 {
    font-size: 1.5em;
  }

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

/* ===== RESPONSIVE DESIGN FOR ALL SHORTCODES ===== */
@media (max-width: 768px) {
  /* Mobile optimizations for all shortcodes */
  .trade-summary,
  .trading-calendar,
  .performance-dashboard,
  .pnl-chart,
  .equity-curve,
  .drawdown-chart,
  .portfolio-overview,
  .risk-calculators,
  .trader-portfolio,
  .strategy-gallery,
  .trader-directory,
  .trading-challenges,
  .trader-leaderboards {
    padding: 20px 15px;
    margin: 15px 0;
    border-radius: 10px;
  }

  .trade-summary h3,
  .trading-calendar h3,
  .performance-dashboard h3,
  .pnl-chart h3,
  .equity-curve h3,
  .drawdown-chart h3,
  .portfolio-overview h3,
  .risk-calculators h3,
  .trader-portfolio h3,
  .strategy-gallery h3,
  .trader-directory h3,
  .trading-challenges h3,
  .trader-leaderboards h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  /* Mobile table scrolling */
  .trade-summary table,
  .trading-calendar table,
  .performance-dashboard table,
  .portfolio-overview table,
  .trader-portfolio table,
  .trader-leaderboards table {
    font-size: 14px;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }

  .trade-summary th,
  .trading-calendar th,
  .performance-dashboard th,
  .portfolio-overview th,
  .trader-portfolio th,
  .trader-leaderboards th,
  .trade-summary td,
  .trading-calendar td,
  .performance-dashboard td,
  .portfolio-overview td,
  .trader-portfolio td,
  .trader-leaderboards td {
    padding: 8px 6px;
    min-width: 80px;
  }

  /* Mobile grid adjustments */
  .strategy-gallery,
  .trader-directory,
  .trading-challenges {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .strategy-card,
  .trader-card,
  .challenge-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .trade-summary,
  .trading-calendar,
  .performance-dashboard,
  .pnl-chart,
  .equity-curve,
  .drawdown-chart,
  .portfolio-overview,
  .risk-calculators,
  .trader-portfolio,
  .strategy-gallery,
  .trader-directory,
  .trading-challenges,
  .trader-leaderboards {
    padding: 15px 10px;
    margin: 10px 0;
  }

  .trade-summary h3,
  .trading-calendar h3,
  .performance-dashboard h3,
  .pnl-chart h3,
  .equity-curve h3,
  .drawdown-chart h3,
  .portfolio-overview h3,
  .risk-calculators h3,
  .trader-portfolio h3,
  .strategy-gallery h3,
  .trader-directory h3,
  .trading-challenges h3,
  .trader-leaderboards h3 {
    font-size: 1.5em;
  }
}

/* ===== PWA AND MODERN ENHANCEMENTS ===== */

/* PWA Install Button */
.pwa-install-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Theme Switcher */
.theme-switcher {
  background: rgba(255, 255, 255, 0.1);
  color: #667eea;
  border: 1px solid rgba(102, 126, 234, 0.3);
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}

.theme-switcher:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

/* Dark theme overrides */
[data-theme="dark"] {
  --background-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  --hover-shadow: 0 25px 45px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .tradejournal-post {
  background: linear-gradient(135deg, #2a2a4e 0%, #1e2a4a 100%);
  color: #e9ecef;
}

[data-theme="dark"] .dashboard-widget {
  background: linear-gradient(135deg, #2a2a4e 0%, #1e2a4a 100%);
  color: #e9ecef;
}

/* Offline notification */
.offline-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #ff6b6b;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  z-index: 10000;
  font-weight: 500;
}

/* Pull to refresh indicator */
.pull-indicator {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(102, 126, 234, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  z-index: 1000;
}

/* Mobile menu styles */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-right: 15px;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #667eea;
  transition: var(--transition);
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 20px;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }

  .nav-link {
    padding: 12px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  }

  .nav-link:last-child {
    border-bottom: none;
  }
}

/* Widget controls enhancement */
.widget-placeholder {
  background: rgba(102, 126, 234, 0.1);
  border: 2px dashed #667eea;
  border-radius: var(--border-radius);
  margin: 10px 0;
}

/* Enhanced loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Modern button styles */
.modern-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  font-family: var(--font-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
}

.modern-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modern-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* =====================================================
   TRADEZELLA-STYLE DESIGN SYSTEM (tjwp-*)
   ===================================================== */
:root {
  --tjwp-primary: #667eea;
  --tjwp-primary-dark: #5a67d8;
  --tjwp-accent: #764ba2;
  --tjwp-green: #10b981;
  --tjwp-green-bg: rgba(16, 185, 129, 0.1);
  --tjwp-red: #ef4444;
  --tjwp-red-bg: rgba(239, 68, 68, 0.1);
  --tjwp-bg: #ffffff;
  --tjwp-bg-alt: #f8fafc;
  --tjwp-bg-card: #ffffff;
  --tjwp-border: #e2e8f0;
  --tjwp-text: #1e293b;
  --tjwp-text-secondary: #64748b;
  --tjwp-muted: #94a3b8;
  --tjwp-radius: 12px;
  --tjwp-radius-sm: 8px;
  --tjwp-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --tjwp-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --tjwp-shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --tjwp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* --- DASHBOARD --- */
.tjwp-dashboard {
  font-family: var(--tjwp-font);
  color: var(--tjwp-text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.tjwp-dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--tjwp-bg-card);
  border: 1px solid var(--tjwp-border);
  border-radius: var(--tjwp-radius);
  box-shadow: var(--tjwp-shadow);
}

.tjwp-dash-topbar__right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tjwp-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.tjwp-user-chip img,
.tjwp-user-chip .default-avatar,
.tjwp-user-chip .user-avatar-img {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.tjwp-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--tjwp-bg-alt);
  border: 1px solid var(--tjwp-border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tjwp-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- KPI CARDS --- */
.tjwp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.tjwp-kpi-card {
  background: var(--tjwp-bg-card);
  border: 1px solid var(--tjwp-border);
  border-radius: var(--tjwp-radius);
  padding: 20px 24px;
  box-shadow: var(--tjwp-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tjwp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tjwp-shadow-md);
}

.tjwp-kpi-card__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tjwp-muted);
  margin-bottom: 6px;
}

.tjwp-kpi-card__value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tjwp-text);
}

.tjwp-kpi-card__sub {
  display: block;
  font-size: 12px;
  color: var(--tjwp-muted);
  margin-top: 4px;
}

/* --- CHARTS ROW --- */
.tjwp-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .tjwp-charts-row {
    grid-template-columns: 1fr;
  }
}

/* --- MINI STATS --- */
.tjwp-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tjwp-mini-stat {
  background: var(--tjwp-bg-card);
  border: 1px solid var(--tjwp-border);
  border-radius: var(--tjwp-radius-sm);
  padding: 14px 18px;
  text-align: center;
}

.tjwp-mini-stat__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tjwp-muted);
  margin-bottom: 4px;
}

.tjwp-mini-stat__value {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

/* --- CARD --- */
.tjwp-card {
  background: var(--tjwp-bg-card);
  border: 1px solid var(--tjwp-border);
  border-radius: var(--tjwp-radius);
  padding: 24px;
  box-shadow: var(--tjwp-shadow);
  margin-bottom: 24px;
}

.tjwp-card--wide {
  grid-column: span 1;
}

.tjwp-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.tjwp-card__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--tjwp-text);
}

/* --- TABLE --- */
.tjwp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tjwp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tjwp-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tjwp-muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--tjwp-border);
  white-space: nowrap;
}

.tjwp-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--tjwp-border);
  color: var(--tjwp-text);
  vertical-align: middle;
}

.tjwp-table tbody tr:hover {
  background: var(--tjwp-bg-alt);
}

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

/* --- BUTTONS --- */
.tjwp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--tjwp-radius-sm);
  font-family: var(--tjwp-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1.4;
  white-space: nowrap;
}

.tjwp-btn--primary {
  background: linear-gradient(135deg, var(--tjwp-primary), var(--tjwp-accent));
  color: #fff;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tjwp-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
  color: #fff;
  text-decoration: none;
}

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

.tjwp-btn--ghost:hover {
  background: var(--tjwp-bg-alt);
  border-color: var(--tjwp-primary);
  color: var(--tjwp-primary);
  text-decoration: none;
}

.tjwp-btn--sm {
  padding: 6px 14px;
  font-size: 13px;
}

.tjwp-btn--block {
  display: flex;
  width: 100%;
}

/* --- COLORS --- */
.tjwp-green { color: var(--tjwp-green) !important; }
.tjwp-red { color: var(--tjwp-red) !important; }

/* --- TAGS --- */
.tjwp-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--tjwp-bg-alt);
  color: var(--tjwp-text-secondary);
}

.tjwp-tag--green {
  background: var(--tjwp-green-bg);
  color: var(--tjwp-green);
}

.tjwp-tag--red {
  background: var(--tjwp-red-bg);
  color: var(--tjwp-red);
}

/* --- SIDE BADGES --- */
.tjwp-side-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.tjwp-side-badge--long {
  background: var(--tjwp-green-bg);
  color: var(--tjwp-green);
}

.tjwp-side-badge--short {
  background: var(--tjwp-red-bg);
  color: var(--tjwp-red);
}

/* --- NOTICE --- */
.tjwp-notice {
  padding: 14px 20px;
  border-radius: var(--tjwp-radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
}

.tjwp-notice p {
  margin: 0;
}

.tjwp-notice a {
  font-weight: 600;
  text-decoration: underline;
}

.tjwp-notice--success {
  background: var(--tjwp-green-bg);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tjwp-notice--error {
  background: var(--tjwp-red-bg);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- AUTH CARD --- */
.tjwp-auth-card {
  max-width: 520px;
  margin: 40px auto;
  background: var(--tjwp-bg-card);
  border: 1px solid var(--tjwp-border);
  border-radius: var(--tjwp-radius);
  padding: 40px;
  box-shadow: var(--tjwp-shadow-lg);
}

.tjwp-auth-card__header {
  text-align: center;
  margin-bottom: 28px;
}

.tjwp-auth-card__header h2 {
  margin: 16px 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--tjwp-text);
}

.tjwp-auth-card__header p {
  color: var(--tjwp-muted);
  font-size: 14px;
  margin: 0;
}

.tjwp-logo-icon {
  display: flex;
  justify-content: center;
}

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

.tjwp-auth-footer a {
  color: var(--tjwp-primary);
  font-weight: 600;
}

/* --- FORMS --- */
.tjwp-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .tjwp-form-row {
    grid-template-columns: 1fr;
  }
}

.tjwp-form-group {
  margin-bottom: 16px;
}

.tjwp-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--tjwp-text);
  margin-bottom: 6px;
}

.tjwp-form-group input[type="text"],
.tjwp-form-group input[type="email"],
.tjwp-form-group input[type="password"],
.tjwp-form-group input[type="number"],
.tjwp-form-group input[type="datetime-local"],
.tjwp-form-group input[type="date"],
.tjwp-form-group textarea,
.tjwp-form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--tjwp-border);
  border-radius: var(--tjwp-radius-sm);
  font-family: var(--tjwp-font);
  font-size: 14px;
  color: var(--tjwp-text);
  background: var(--tjwp-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.tjwp-form-group input:focus,
.tjwp-form-group textarea:focus,
.tjwp-form-group select:focus {
  outline: none;
  border-color: var(--tjwp-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.tjwp-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
}

.tjwp-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.tjwp-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--tjwp-primary);
}

/* Password strength meter */
.tjwp-password-strength {
  height: 4px;
  background: var(--tjwp-border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.tjwp-pw-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.tjwp-pw-1 { background: #ef4444; }
.tjwp-pw-2 { background: #f97316; }
.tjwp-pw-3 { background: #eab308; }
.tjwp-pw-4 { background: #22c55e; }
.tjwp-pw-5 { background: #10b981; }

/* --- LINKS --- */
.tjwp-link {
  color: var(--tjwp-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

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

/* --- EMPTY STATE --- */
.tjwp-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--tjwp-muted);
}

.tjwp-empty-state p {
  font-size: 16px;
  margin-bottom: 16px;
}

/* --- PAGINATION --- */
.tjwp-pagination {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tjwp-border);
}

.tjwp-pagination .page-numbers {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 2px;
  border: 1px solid var(--tjwp-border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  color: var(--tjwp-text-secondary);
  transition: all 0.2s;
}

.tjwp-pagination .page-numbers.current,
.tjwp-pagination .page-numbers:hover {
  background: var(--tjwp-primary);
  border-color: var(--tjwp-primary);
  color: #fff;
}

/* --- RESPONSIVE DASHBOARD --- */
@media (max-width: 768px) {
  .tjwp-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tjwp-kpi-card__value {
    font-size: 22px;
  }
  .tjwp-dash-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .tjwp-auth-card {
    margin: 20px auto;
    padding: 24px;
  }
  .tjwp-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .tjwp-kpi-grid {
    grid-template-columns: 1fr;
  }
  .tjwp-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  /* Responsive table: labels on left, data on right */
  .tjwp-table thead { display: none; }
  .tjwp-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--tjwp-border);
    border-radius: var(--tjwp-radius-sm);
    padding: 8px;
  }
  .tjwp-table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid var(--tjwp-border);
    font-size: 13px;
  }
  .tjwp-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--tjwp-muted);
    text-transform: uppercase;
    font-size: 11px;
  }
  .tjwp-table tbody td:last-child {
    border-bottom: none;
  }
}

/* --- DARK MODE OVERRIDES --- */
body.tjwp-dark-mode .tjwp-dashboard,
body.tjwp-dark-mode .tjwp-card,
body.tjwp-dark-mode .tjwp-kpi-card,
body.tjwp-dark-mode .tjwp-auth-card,
body.tjwp-dark-mode .tjwp-dash-topbar,
body.tjwp-dark-mode .tjwp-mini-stat {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.tjwp-dark-mode .tjwp-kpi-card__label,
body.tjwp-dark-mode .tjwp-kpi-card__sub,
body.tjwp-dark-mode .tjwp-mini-stat__label,
body.tjwp-dark-mode .tjwp-form-group label {
  color: #94a3b8;
}

body.tjwp-dark-mode .tjwp-kpi-card__value,
body.tjwp-dark-mode .tjwp-card__header h3 {
  color: #f1f5f9;
}

body.tjwp-dark-mode .tjwp-table tbody td {
  border-color: #334155;
  color: #e2e8f0;
}

body.tjwp-dark-mode .tjwp-table thead th {
  border-color: #475569;
  color: #94a3b8;
}

body.tjwp-dark-mode .tjwp-table tbody tr:hover {
  background: #334155;
}

body.tjwp-dark-mode .tjwp-form-group input,
body.tjwp-dark-mode .tjwp-form-group textarea,
body.tjwp-dark-mode .tjwp-form-group select {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.tjwp-dark-mode .tjwp-notice--success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

body.tjwp-dark-mode .tjwp-notice--error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

body.tjwp-dark-mode .tjwp-btn--ghost {
  border-color: #475569;
  color: #94a3b8;
}

body.tjwp-dark-mode .tjwp-btn--ghost:hover {
  background: #334155;
}

/* Legacy dark-mode class: table readability baseline for all frontend pages */
body.tjwp-dark-mode table {
  background: #111827;
  color: #e5e7eb;
  border-color: #334155;
}

body.tjwp-dark-mode table thead th {
  background: #0f172a;
  color: #cbd5e1;
  border-color: #334155;
}

body.tjwp-dark-mode table tbody td,
body.tjwp-dark-mode table tfoot td,
body.tjwp-dark-mode .wp-list-table td,
body.tjwp-dark-mode .wp-list-table th {
  color: #e5e7eb;
  border-color: #334155;
}

body.tjwp-dark-mode table tbody tr:nth-child(even) {
  background: #0f1a2c;
}

body.tjwp-dark-mode table tbody tr:hover {
  background: #1e293b;
}

/* --- RTL SUPPORT --- */
[dir="rtl"] .tjwp-dash-topbar,
[dir="rtl"] .tjwp-card__header,
[dir="rtl"] .tjwp-form-options {
  flex-direction: row-reverse;
}

[dir="rtl"] .tjwp-table thead th {
  text-align: right;
}

/* --- PRINT --- */
@media print {
  .tjwp-btn,
  .tjwp-dash-topbar__right {
    display: none !important;
  }
  .tjwp-card,
  .tjwp-kpi-card {
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid;
  }
}

/* --- MY TRADES + REPLAY READABILITY FIX --- */
.tjwp-card .tjwp-table tbody tr {
  background: #ffffff;
}

.tjwp-card .tjwp-table tbody tr:nth-child(even) {
  background: #fafcff;
}

.tjwp-card .tjwp-table tbody tr:hover {
  background: #eef4ff;
}

.tjwp-card .tjwp-table tbody td,
.tjwp-card .tjwp-table tbody td strong {
  color: #0f172a;
}

.tjwp-card .tjwp-table tbody td::before {
  color: #334155;
}

.tjwp-replay {
  max-width: 980px;
  margin: 24px auto;
  color: var(--tjwp-text);
}

.tjwp-replay .tjwp-replay__header h3,
.tjwp-replay .tjwp-replay__header p,
.tjwp-replay label,
.tjwp-replay small,
.tjwp-replay strong,
.tjwp-replay span,
.tjwp-replay div {
  color: var(--tjwp-text);
}

.tjwp-replay .tjwp-replay__status,
.tjwp-replay .tjwp-replay__timeline,
.tjwp-replay .tjwp-replay__key-notes,
.tjwp-replay .tjwp-replay__notes textarea,
.tjwp-replay .tjwp-replay__selector select,
.tjwp-replay .tjwp-replay__controls select {
  background: var(--tjwp-bg-card) !important;
  border-color: var(--tjwp-border) !important;
  color: var(--tjwp-text) !important;
}

.tjwp-replay .tjwp-replay__timeline-item {
  padding: 8px;
  margin: 6px 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
}

.tjwp-replay .tjwp-replay__timeline-item--active {
  background: #ecf5ff;
  border-color: #93c5fd;
}

.tjwp-replay textarea {
  background: var(--tjwp-bg) !important;
}

body.tjwp-dark-mode .tjwp-card .tjwp-table tbody tr,
[data-theme="dark"] .tjwp-card .tjwp-table tbody tr {
  background: #0f172a;
}

body.tjwp-dark-mode .tjwp-card .tjwp-table tbody tr:nth-child(even),
[data-theme="dark"] .tjwp-card .tjwp-table tbody tr:nth-child(even) {
  background: #111b2d;
}

body.tjwp-dark-mode .tjwp-card .tjwp-table tbody tr:hover,
[data-theme="dark"] .tjwp-card .tjwp-table tbody tr:hover {
  background: #1e293b;
}

body.tjwp-dark-mode .tjwp-card .tjwp-table tbody td,
body.tjwp-dark-mode .tjwp-card .tjwp-table tbody td strong,
[data-theme="dark"] .tjwp-card .tjwp-table tbody td,
[data-theme="dark"] .tjwp-card .tjwp-table tbody td strong {
  color: #e2e8f0;
}

body.tjwp-dark-mode .tjwp-card .tjwp-table tbody td::before,
[data-theme="dark"] .tjwp-card .tjwp-table tbody td::before {
  color: #94a3b8;
}

body.tjwp-dark-mode .tjwp-replay,
[data-theme="dark"] .tjwp-replay {
  color: #e2e8f0;
}

body.tjwp-dark-mode .tjwp-replay .tjwp-replay__header h3,
body.tjwp-dark-mode .tjwp-replay .tjwp-replay__header p,
body.tjwp-dark-mode .tjwp-replay label,
body.tjwp-dark-mode .tjwp-replay small,
body.tjwp-dark-mode .tjwp-replay strong,
body.tjwp-dark-mode .tjwp-replay span,
body.tjwp-dark-mode .tjwp-replay div,
[data-theme="dark"] .tjwp-replay .tjwp-replay__header h3,
[data-theme="dark"] .tjwp-replay .tjwp-replay__header p,
[data-theme="dark"] .tjwp-replay label,
[data-theme="dark"] .tjwp-replay small,
[data-theme="dark"] .tjwp-replay strong,
[data-theme="dark"] .tjwp-replay span,
[data-theme="dark"] .tjwp-replay div {
  color: #e2e8f0;
}

body.tjwp-dark-mode .tjwp-replay .tjwp-replay__status,
body.tjwp-dark-mode .tjwp-replay .tjwp-replay__timeline,
body.tjwp-dark-mode .tjwp-replay .tjwp-replay__key-notes,
body.tjwp-dark-mode .tjwp-replay .tjwp-replay__notes textarea,
body.tjwp-dark-mode .tjwp-replay .tjwp-replay__key-notes textarea,
body.tjwp-dark-mode .tjwp-replay .tjwp-replay__selector select,
body.tjwp-dark-mode .tjwp-replay .tjwp-replay__controls select,
[data-theme="dark"] .tjwp-replay .tjwp-replay__status,
[data-theme="dark"] .tjwp-replay .tjwp-replay__timeline,
[data-theme="dark"] .tjwp-replay .tjwp-replay__key-notes,
[data-theme="dark"] .tjwp-replay .tjwp-replay__notes textarea,
[data-theme="dark"] .tjwp-replay .tjwp-replay__key-notes textarea,
[data-theme="dark"] .tjwp-replay .tjwp-replay__selector select,
[data-theme="dark"] .tjwp-replay .tjwp-replay__controls select {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

body.tjwp-dark-mode .tjwp-replay .tjwp-replay__timeline-item,
[data-theme="dark"] .tjwp-replay .tjwp-replay__timeline-item {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

body.tjwp-dark-mode .tjwp-replay .tjwp-replay__timeline-item--active,
[data-theme="dark"] .tjwp-replay .tjwp-replay__timeline-item--active {
  background: #1e293b !important;
  border-color: #60a5fa !important;
}

/* --- DASHBOARD + LEADERBOARD + REPLAY HARDENING --- */
body.tjwp-dark-mode .trade-averages-table,
[data-theme="dark"] .trade-averages-table {
  background: #0f172a;
  border-color: #334155;
}

body.tjwp-dark-mode .trade-averages-table tbody tr:nth-child(odd),
[data-theme="dark"] .trade-averages-table tbody tr:nth-child(odd) {
  background: #0f172a;
}

body.tjwp-dark-mode .trade-averages-table tbody tr:nth-child(even),
[data-theme="dark"] .trade-averages-table tbody tr:nth-child(even) {
  background: #111b2d;
}

body.tjwp-dark-mode .trade-averages-table tbody tr:hover,
[data-theme="dark"] .trade-averages-table tbody tr:hover {
  background: #1e293b;
}

body.tjwp-dark-mode .trade-averages-table td,
body.tjwp-dark-mode .trade-averages-table th,
body.tjwp-dark-mode .trade-averages-table td:before,
[data-theme="dark"] .trade-averages-table td,
[data-theme="dark"] .trade-averages-table th,
[data-theme="dark"] .trade-averages-table td:before {
  color: #e2e8f0;
  border-color: #334155;
}

body.tjwp-dark-mode .trading-leaderboard,
[data-theme="dark"] .trading-leaderboard {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #1f2937;
}

body.tjwp-dark-mode .trading-leaderboard .leaderboard-header,
[data-theme="dark"] .trading-leaderboard .leaderboard-header {
  border-bottom-color: #334155;
}

body.tjwp-dark-mode .trading-leaderboard .leaderboard-header h3,
[data-theme="dark"] .trading-leaderboard .leaderboard-header h3,
body.tjwp-dark-mode .trading-leaderboard .achievement-badges h4,
[data-theme="dark"] .trading-leaderboard .achievement-badges h4,
body.tjwp-dark-mode .trading-leaderboard .stat-box h4,
[data-theme="dark"] .trading-leaderboard .stat-box h4 {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: #f8fafc;
}

body.tjwp-dark-mode .trading-leaderboard .stat-box,
[data-theme="dark"] .trading-leaderboard .stat-box,
body.tjwp-dark-mode .trading-leaderboard .stats-grid .stat-item,
[data-theme="dark"] .trading-leaderboard .stats-grid .stat-item,
body.tjwp-dark-mode .trading-leaderboard .badge-item,
[data-theme="dark"] .trading-leaderboard .badge-item {
  background: #111827;
  border-color: #374151;
}

body.tjwp-dark-mode .trading-leaderboard .stat-label,
[data-theme="dark"] .trading-leaderboard .stat-label,
body.tjwp-dark-mode .trading-leaderboard .badge-info p,
[data-theme="dark"] .trading-leaderboard .badge-info p,
body.tjwp-dark-mode .trading-leaderboard .badge-info h5,
[data-theme="dark"] .trading-leaderboard .badge-info h5 {
  color: #cbd5e1;
}

.tjwp-replay .tjwp-replay__status,
.tjwp-replay .tjwp-replay__timeline,
.tjwp-replay .tjwp-replay__key-notes,
.tjwp-replay .tjwp-replay__notes textarea,
.tjwp-replay .tjwp-replay__key-notes textarea,
.tjwp-replay .tjwp-replay__selector select,
.tjwp-replay .tjwp-replay__controls select {
  background: var(--tjwp-bg-card, #ffffff) !important;
  color: var(--tjwp-text, #0f172a) !important;
}

.trading-leaderboard .leaderboard-header h3,
.trading-leaderboard .achievement-badges h4 {
  background: none;
  -webkit-text-fill-color: currentColor;
}