/* Main styles for Bybit PnL Dashboard Demo */

/*-------------------------------------
  1. Variables
-------------------------------------*/
:root {
    --base-bg: #111111;
    --base-color: #fff;
    --card-bg: linear-gradient(135deg, #1a1a1a, #222);
    --border-radius-default: 8px;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --blue: #2563eb;
    --purple: #8b5cf6;
  }
  
  /*-------------------------------------
    2. Base Styles
  -------------------------------------*/
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    background-color: var(--base-bg);
    color: var(--base-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
      Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  
  h1 {
    text-align: center;
    color: var(--base-color);
    margin-bottom: 30px;
    font-size: 2.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  h2 {
    color: #666;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
  }
  
  h3 {
    color: #888;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
  }
  
  /*-------------------------------------
    3. Loading Overlay
  -------------------------------------*/
  .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }
  
  .loading-overlay.active {
    display: flex;
  }
  
  .loading-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .loading-content h2 {
    color: var(--base-color);
    margin-bottom: 20px;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  .progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
  }
  
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    border-radius: 3px;
  }
  
  .progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.15) 50%,
      rgba(255, 255, 255, 0) 100%
    );
    animation: shine 1.5s infinite;
  }
  
  .loading-status {
    color: #999;
    font-size: 0.9em;
    margin-top: 15px;
    min-height: 1.2em;
  }
  
  /*-------------------------------------
    4. Stats Cards
  -------------------------------------*/
  .stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
  }
  
  .stat-card {
    background: linear-gradient(135deg, #1e1e1e, #2d2d2d);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
  }
  
  .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  }
  
  .stat-card h3 {
    color: #888;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
  }
  
  .stat-card p {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: var(--base-color);
  }
  
  /*-------------------------------------
    5. Currency Switcher
  -------------------------------------*/
  .currency-switcher {
    display: inline-block;
    margin-left: 15px;
    vertical-align: middle;
    text-align: right;
    margin-bottom: 15px;
  }
  
  .currency-switcher select {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
  }
  
  .currency-switcher select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
  }
  
  /*-------------------------------------
    6. Tab Navigation
  -------------------------------------*/
  .dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    position: sticky;
    top: 20px;
    z-index: 100;
  }
  
  .tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #999;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
  }
  
  .tab-button:hover {
    color: var(--base-color);
    background: rgba(255, 255, 255, 0.1);
  }
  
  .tab-button.active {
    background: #2563eb;
    color: var(--base-color);
  }
  
  .tab-content {
    position: relative;
  }
  
  .tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px 0;
    animation: fadeIn 0.3s ease;
  }
  
  .tab-pane.active {
    display: block;
    opacity: 1;
  }
  
  /*-------------------------------------
    7. Chart Container
  -------------------------------------*/
  .chart-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius-default);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    height: 500px;
  }
  
  /*-------------------------------------
    8. Recent Trades Section
  -------------------------------------*/
  .recent-trades-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius-default);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    overflow-x: auto;
  }
  
  .trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
  }
  
  .trades-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8em;
  }
  
  .trades-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .trades-table tr:last-child td {
    border-bottom: none;
  }
  
  .trades-table tr.positive {
    color: var(--green);
  }
  
  .trades-table tr.negative {
    color: var(--red);
  }
  
  .trades-table .buy {
    color: var(--green);
  }
  
  .trades-table .sell {
    color: var(--red);
  }
  
  /*-------------------------------------
    9. PnL Section
  -------------------------------------*/
  .pnl-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  }
  
  .pnl-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
  }
  
  .pnl-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #999;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
  }
  
  .pnl-tab:hover {
    color: var(--base-color);
    background: rgba(255, 255, 255, 0.1);
  }
  
  .pnl-tab.active {
    background: #2563eb;
    color: var(--base-color);
  }
  
  .pnl-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
  }
  
  .pnl-stat-card {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .pnl-stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }
  
  .pnl-stat-card p {
    font-size: 1.5rem;
    font-weight: 600;
  }
  
  /*-------------------------------------
    10. Analysis Tab
  -------------------------------------*/
  .analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
  }
  
  .analysis-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius-default);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  /*-------------------------------------
    11. Session Analysis
  -------------------------------------*/
  .analysis-section {
    margin-bottom: 25px;
  }
  
  .analysis-section h3 {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .session-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .session-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-default);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
  }
  
  .session-card:hover {
    transform: translateY(-2px);
  }
  
  .session-card.positive {
    border-left: 3px solid var(--green);
  }
  
  .session-card.negative {
    border-left: 3px solid var(--red);
  }
  
  .session-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
  }
  
  .session-title {
    display: flex;
    flex-direction: column;
  }
  
  .session-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
  }
  
  .session-time {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
  }
  
  .session-pnl {
    font-size: 1.2em;
    font-weight: bold;
    margin: 10px 0;
  }
  
  .session-pnl.positive {
    color: var(--green);
  }
  
  .session-pnl.negative {
    color: var(--red);
  }
  
  .session-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 0.9em;
    color: #888;
  }
  
  /*-------------------------------------
    12. Trade Performance Section
  -------------------------------------*/
  .trading-performance {
    margin-top: 16px;
  }
  
  .performance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .performance-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-default);
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .performance-card.winning {
    border-top: 3px solid var(--green);
  }
  
  .performance-card.losing {
    border-top: 3px solid var(--red);
  }
  
  .metric-title {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
  }
  
  .metric-value {
    font-size: 1.8em;
    font-weight: 600;
    margin-bottom: 4px;
  }
  
  .winning .metric-value {
    color: var(--green);
  }
  
  .losing .metric-value {
    color: var(--red);
  }
  
  .metric-subtitle {
    color: #666;
    font-size: 0.8em;
  }
  
  /*-------------------------------------
    13. Search Component
  -------------------------------------*/
  .search-container {
    position: relative;
    margin-bottom: 1rem;
  }
  
  .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
  }
  
  .search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-default);
    color: var(--base-color);
    font-size: 0.9em;
  }
  
  .search-input:focus {
    outline: none;
    border-color: var(--blue);
  }
  
  /*-------------------------------------
    14. Coin Stats
  -------------------------------------*/
  .coin-stats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
  }
  
  .coin-stats-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-default);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .coin-symbol {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--base-color);
  }
  
  .coin-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #999;
  }
  
  .coin-stat:last-child {
    border-bottom: none;
  }
  
  /*-------------------------------------
    15. Calendar Tab
  -------------------------------------*/
  .calendar-container {
    padding: 20px;
    color: var(--base-color);
    background: var(--card-bg);
    border-radius: var(--border-radius-default);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  .calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
  }
  
  .calendar-navigation button {
    background-color: #333;
    color: var(--base-color);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    margin: 0 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
  }
  
  .calendar-navigation button:hover {
    background-color: #555;
  }
  
  .calendar-navigation #current-month {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--base-color);
    min-width: 150px;
    text-align: center;
  }
  
  #month-pnl-summary {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--green);
    margin-left: 15px;
    display: inline-block;
    padding: 0.3em 0.6em;
    background-color: rgba(34, 197, 94, 0.1);
    border-radius: 4px;
  }
  
  #month-pnl-summary.negative {
    color: var(--red);
    background-color: rgba(239, 68, 68, 0.1);
  }
  
  .calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
    margin-bottom: 5px;
  }
  
  .calendar-header div {
    color: #666;
    font-size: 0.8em;
    padding: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
  }
  
  .trading-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    max-width: 900px;
    margin: 20px auto;
    padding: 15px;
  }
  
  .calendar-day {
    aspect-ratio: 1;
    min-height: 70px;
    border-radius: 4px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  
  .calendar-day.current-day {
    border: 2px solid var(--blue);
  }
  
  .calendar-day.other-month {
    opacity: 0.4;
  }
  
  .day-number {
    font-size: 0.9rem;
    font-weight: 500;
  }
  
  .day-pnl {
    font-size: 0.8rem;
    font-weight: 600;
  }
  
  .day-pnl.positive {
    color: var(--green);
  }
  
  .day-pnl.negative {
    color: var(--red);
  }
  
  .day-trades {
    font-size: 0.7rem;
    color: #666;
  }
  
  /*-------------------------------------
    16. Transfers Tab
  -------------------------------------*/
  .transfers-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius-default);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  .transfers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
  }
  
  .transfers-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8em;
  }
  
  .transfers-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .transfers-table tr:last-child td {
    border-bottom: none;
  }
  
  /*-------------------------------------
    17. Modal
  -------------------------------------*/
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
  }
  
  .modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .modal-content {
    position: relative;
    background: var(--card-bg);
    margin: 5vh auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #666;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
  }
  
  .close-modal:hover {
    color: var(--base-color);
    background: rgba(255, 255, 255, 0.1);
  }
  
  .day-summary {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .day-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .day-stat span:first-child {
    color: #666;
    font-size: 0.9rem;
  }
  
  .day-stat span:last-child {
    font-size: 1.25rem;
    font-weight: 600;
  }
  
  /*-------------------------------------
    18. Censor Toggle
  -------------------------------------*/
  .censor-toggle {
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 15px;
    color: #666;
    transition: color 0.3s;
  }
  
  .censor-toggle:hover {
    color: #ccc;
  }
  
  /*-------------------------------------
    19. Utility Classes & Animations
  -------------------------------------*/
  .positive {
    color: var(--green);
  }
  
  .negative {
    color: var(--red);
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes shine {
    0% {
      transform: translateX(-100%);
    }
    100% {
      transform: translateX(100%);
    }
  }
  
  /*-------------------------------------
    20. Custom Scrollbar
  -------------------------------------*/
  ::-webkit-scrollbar {
    width: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  /*-------------------------------------
    21. Responsive Design
  -------------------------------------*/
  @media (max-width: 1200px) {
    .analysis-grid {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 768px) {
    .container {
      padding: 10px;
    }
  
    .stats-container,
    .session-grid,
    .performance-grid {
      grid-template-columns: 1fr;
    }
  
    .pnl-tabs,
    .dashboard-tabs {
      flex-wrap: wrap;
    }
  
    .chart-container {
      height: 300px;
    }
  
    .modal-content {
      width: 95%;
      padding: 15px;
    }
  
    .trading-calendar {
      gap: 1px;
      padding: 10px;
    }
  
    .calendar-day {
      min-height: 60px;
      padding: 5px;
    }
  
    .calendar-day .profit {
      font-size: 0.9em;
    }
  
    .tab-button {
      padding: 10px;
      font-size: 0.8em;
    }
  }
  
  @media (max-width: 480px) {
    h1 {
      font-size: 2em;
    }
  
    .calendar-day {
      min-height: 50px;
    }
  
    .calendar-day .profit {
      font-size: 0.8em;
    }
  }

  /* Add this CSS to your bybit-demo.css file */
.back-to-portfolio {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.back-to-portfolio a {
  display: inline-block;
  padding: 8px 16px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #00bfa5;
  text-decoration: none;
  border-radius: 4px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  transition: all 0.2s ease;
}

.back-to-portfolio a:hover {
  background-color: rgba(0, 0, 0, 0.9);
  color: #00e5bb;
  transform: translateX(-3px);
}