/* ===== GLOBAL STYLES & LAYOUT ===== */
:root {
  --bg-color: #0c0f1a;
  --panel-color: #171c2e;
  --text-color: #e0e7ff;
  --text-muted-color: #8c96c2;
  --border-color: rgba(140, 150, 194, 0.2);
  --accent-color: #00e0c6;
  --glow-color: rgba(0, 224, 198, 0.5);
  --green-color: #00ffc4;
  --red-color: #ff4976;
  --header-bg: #111524F0;
  /* Add transparency for blur effect */
  --left-sidebar-bg: #111524;
  --font-primary: 'Roboto';
  --font-display: 'Roboto';
  --header-height: 65px;
}
/* ===== THEME-BASED LOGO TOGGLE ===== */

/* By default, the theme is dark. Show the dark logo and hide the light one. */
.logo-dark {
  display: inline;
}
.logo-light {
  display: none;
}
.left-header{
  padding-left: 15px;
  scroll-margin-top: 60px;
}
/* updated.css */

/* Add padding to chart header based on the active view */

  

/* When the theme is light, reverse the visibility. */
body[data-theme="light"] .logo-dark {
  display: none;
}
body[data-theme="light"] .logo-light {
  display: inline-block;
}
html {
  font-family: var(--font-primary);
  color: var(--text-color);
}

body {
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-color);
  margin: 0;
  padding-top: var(--header-height);
  /* Make space for absolute header */
}

.panel {
  background-color: var(--panel-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* ===== FIXED HEADER (visible + pinned) ===== */
/* This is the NEW, corrected code */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height); /* Use the CSS variable */
  background-color: var(--header-bg, #ffffff);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  display: flex;
  /*justify-content: space-between;*/
  align-items: center;
  padding: 0 0 0 25px;
}


.logo {
  height: 40px;
  width: 55px;
  filter: drop-shadow(0 0 5px var(--glow-color));
  border-radius: 10px;
}
/* updated.css */

/* ===== UPDATED LIGHT THEME VARIABLES ===== */
body[data-theme="light"] {
  --bg-color: #f5f5f5;
  --panel-color: #ffffff;
  --text-color: #000000;
  --text-muted-color: #555555;
  --border-color: #e0e0e0;
  --header-bg: rgba(0, 0, 0,);
  --left-sidebar-bg: #ffffff;

  /* Use a light gray for hovers/active states */
  --accent-color: #e9ecef; 
  --glow-color: rgba(0, 0, 0, 0.1);
}

/* ===== OVERRIDES FOR LIGHT THEME READABILITY ===== */

/* Ensure text on hovered nav/time buttons is black */
body[data-theme="light"] .nav-button.active,
body[data-theme="light"] .nav-button:hover,
body[data-theme="light"] .time-button.active,
body[data-theme="light"] .time-button:hover {
  color: var(--text-color);
}

/* Make tab active state a simple black underline */
body[data-theme="light"] .tab-button.active {
  color: var(--text-color);
  border-bottom-color: var(--text-color);
}

body[data-theme="light"] .tab-button-watchlist.active {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

/* Ensure text on hovered search suggestions is black */
body[data-theme="light"] .suggestion-item:hover,
body[data-theme="light"] .suggestion-item.active {
  color: var(--text-color);
}

body[data-theme="light"] .modal-header h2,
body[data-theme="light"] .modal-content {
    color: var(--text-color);
}

/* Specifically target table headers within the modal for light mode */
body[data-theme="light"] .modal-content th {
    color: var(--text-color);
}
body[data-theme="light"] .description-text,
body[data-theme="light"] .item-name,
body[data-theme="light"] .item-symbol,
body[data-theme="light"] .side-text,
body[data-theme="light"] .no-related-text,
body[data-theme="light"] .time-text,
body[data-theme="light"] .size-text,
body[data-theme="light"] .order-row,
body[data-theme="light"] .order-book-label,
body[data-theme="light"] .brand-name,
body[data-theme="light"] .ticker-text,
body[data-theme="light"] .watchlist-header-text,
body[data-theme="light"] .suggestion-item:hover .item-title,
body[data-theme="light"] .suggestion-item.active .item-title,
body[data-theme="light"] .suggestion-item:hover .item-ticker,
body[data-theme="light"] .suggestion-item.active .item-ticker {
   color: var(--text-color);
}
body[data-theme="light"] .search-box {
  display: flex;
  align-items: center;
  background-color: rgb(239, 239, 239);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
/* updated.css */

/* Make footer tabs and watchlist header white in light mode */
body[data-theme="light"] .real-footer-tabs,.footer-tabs,
body[data-theme="light"] {
    background-color: rgb(239, 239, 239)
}
body[data-theme="light"] .bx-search{
  color: black;
}
.bx-search{
  color: white;
}
/* updated.css */

/* Add padding to chart header based on the active view */
body.data-view .left-header,
body.chart-view .left-header{
  padding-top: 70px;
}
body.indicators-view .left-header {
  padding-top: 100px;
}


/* Make the theme toggle knob a darker gray in light mode for contrast */
body[data-theme="light"] .slider {
    background-color: #e0e0e0;
}
body[data-theme="light"] .slider::before {
  background-color: #6c757d;
}

body[data-theme="light"] input:checked + .slider::before {
    background-color: #ffffff;
}

body[data-theme="light"] input:checked + .slider {
    background-color: #6c757d;
}

.header-left {
  font-family: var(--font-display);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
/* updated.css */

/* ===== 1. ADD LIGHT THEME VARIABLES ===== */
body[data-theme="light"] {
  --bg-color: #f0f2f5;
  --panel-color: #ffffff;
  --text-color: #1c1e21;
  --text-muted-color: #65676b;
  --border-color: #dddfe2;
  --header-bg: rgba(255, 255, 255, 0.85);
  --left-sidebar-bg: #ffffff;
}

/* ===== 2. STYLE THE SETTINGS POPUP ===== */
.settings-popup {
  position: absolute;
  bottom: 24px;
  left: 90px; /* Position next to the sidebar */
  width: 250px;
  background-color: var(--panel-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  z-index: 1200;
  
  /* Animation */
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.settings-popup.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.settings-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--text-color);
}

.settings-content {
  padding: 16px;
}

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

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

/* ===== 3. STYLE THE THEME TOGGLE SWITCH ===== */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2c324a; /* Dark background for slider track */
  border-radius: 34px;
  transition: .4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.slider i {
  color: #f0f2f5;
  font-size: 20px;
  transition: .4s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: var(--accent-color);
  border-radius: 50%;
  transition: .4s;
}

input:checked + .slider {
  background-color: #ccc;
}

input:checked + .slider::before {
  transform: translateX(26px);
}



.search-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--glow-color);
}
.home-box-region{
  right: 10px;
}
.search-box input {
  border: none;
  outline: none;
  background: none;
  margin-left: 8px;
  font-size: 14px;
  width: 250px;
  color: var(--text-color);
}
.subtract-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #e11d48; /* Tailwind red-600 */
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  margin-left: 0;
}
.subtract-button:hover {
  background: #fee2e2; /* Tailwind red-100 */
  border-color: #be123c; /* Tailwind red-700 */
}
.subtract-icon {
  color: #e11d48;
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
} 
.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.user-profile-img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
}

/* ===== LEFT SIDEBAR (FIXED & VISIBLE) ===== */
.left-sidebar {
  position: fixed;
  top: 0;
  /* Align to top of viewport */
  left: 0;
  bottom: 0;
  width: 80px;
  background-color: var(--left-sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: var(--header-height) 0 24px 0;
  /* Push content below header */
  z-index: 999;
  /* Below header */
}
.header-container{
  right: 10px;
  padding-top: 0px;
}

.sidebar-top {
  flex-grow: 1;
}

.sidebar-bottom {
  flex-shrink: 0;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.eventview-text{
  padding-left: 5px;
}
.Logo_Button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-muted-color);
  font-size: 24px;
  transition: all 0.2s ease;
  position: relative;
}


body[data-theme="light"] .expand-button{
  position: relative;
  width: 30px;
  height: 30px;
  right: 0px;
  text-decoration: none;
  color: var(--text-muted-color);
  transition: all 0.2s ease;
  background-color: rgb(191, 191, 191);
  color: rgb(0, 0, 0);
  border: none;
  display: inline-block;
}

body[data-theme="light"] .expand-button:hover {
  cursor: pointer;
  position: relative;
  right: 0px;
  background-color: rgba(191, 191, 191, 0.669);
  color: var(--panel-color);
  box-shadow: 0 0 15px var(--glow-color);
  display: inline-block;
}



.expand-button {
  position: relative;
  width: 30px;
  height: 30px;

  border-radius: 12px;
  right: 0px;
  text-decoration: none;
  color: var(--text-muted-color);
  transition: all 0.2s ease;
  background-color: var(--accent-color);
  color: var(--panel-color);
  box-shadow: 0 0 15px var(--glow-color);
  display: inline-block;
  /* Add flex-shrink to prevent the button from squishing */




}

.expand-button:hover {
  cursor: pointer;
  position: relative;
  right: 0px;
  background-color: var(--accent-color);
  color: var(--panel-color);
  box-shadow: 0 0 15px var(--glow-color);
  display: inline-block;
}

.nav-button.active,
.nav-button:hover {
  background-color: var(--accent-color);
  color: var(--panel-color);
  box-shadow: 0 0 15px var(--glow-color);
}

.nav-button:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 70px;
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 1100;
}
#trades.tab-pane.active {
    display: flex;
    gap: 16px; /* Creates space between the table and the button */
    align-items: flex-start; /* Aligns the top of the table and button */
}

/* Make the table take up all available space */
#trades > table {
    flex-grow: 1;
    width: 0; /* Fixes a common flexbox issue with tables */
}
.header .nav-button:hover::after {
  left: 50%;
  transform: translateX(-50%);
  top: 52px;
}
/* Add this class to your CSS file to control visibility */


/* ===== MAIN & RIGHT SIDEBAR GRID ===== */
body {
  display: grid;
  grid-template-columns: 80px 3fr 1fr ;
  grid-template-rows: 1fr;
  grid-template-areas: "nav main sidebar";
  padding-left: 0;
  padding-right: 0px;
  padding-bottom: 24px;
  gap: 7px;
  
}

.main-content {
  grid-area: main;
  display: grid;
  grid-template-rows: 2fr 1fr; /* Chart 2/3, data/indicators 1/3 */
  gap: 2px;
  min-height: 0;
  row-gap: 200px;
  overflow-y: auto;
}

/* Chart panel fills the top row fully */
.chart-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: transparent;
  border: none;
  padding: 0;
  min-height: 75vh; /* Ensures it doesn't collapse */

}

/* Ensure the chart container inside the panel grows correctly */
.chart-container {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

/* This is the NEW, corrected code */
.right-sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Add padding for better spacing and remove the old gap */
  padding: 0 12px 12px 4px;
  box-sizing: border-box;
}



.panel-header {
  flex: 0 0 auto;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}


h1,
h2 {
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.chart-container {
  width: 100%;
  height: 100%;
  flex-grow: 1;
  background-color: var(--panel-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  /*max-height: 200px;*/
}

/* ===== TIME BUTTONS STYLED LIKE NAV BUTTONS ===== */
.chart-controls {
  display: flex;
  gap: 8px;
  right: 0px;
  margin-left: auto; 
}

.time-button {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted-color);
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-button.active,
.time-button:hover {
  background-color: var(--accent-color);
  color: var(--panel-color);
  box-shadow: 0 0 15px var(--glow-color);
}


/* Order Book Footer */
.order-book-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  max-height: 220px;
  overflow: hidden;
}

.footer-tabs, .real-footer-tabs {
  display: flex;
  background-color: rgba(0, 0, 0, 0.2);
  width: 100%;
  
}

.tab-button {
  border: none;
  background: none;
  color: var(--text-muted-color);
  padding: 10px 16px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  border-bottom: 2px solid transparent;
}

.tab-button.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}
.tab-button-watchlist {
  border: none;
  background: none;
  color: var(--text-muted-color);
  padding: 10px ;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  display: inline-block;
}

.tab-button-watchlist.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}
.footer-content {
  box-sizing: border-box;
  padding: 16px 16px 100px 16px; /* More bottom padding */
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.expand-button-container {
  display: flex;
  padding-right: 1px;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto; /* Ensures it is pushed to the far right */
}
.tab-pane {
  display: none;
  height: 100%;
}

.tab-pane.active {
  display: block;
}
/* ===== WATCHLIST TABS & CONTENT ===== */
.watchlist-tabs {
  padding: 0 0px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
}

.watchlist-content {
    /* Reduced padding for a tighter fit */

  row-gap: 15px;
  min-height: 0;
  overflow-y: auto;
}

/* Specificity for tab buttons inside the watchlist */
.watchlist-tabs .tab-button {
  
  font-size: 13px;
}

.user-watchlist-controls {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

#user-watchlist-list {
  flex-grow: 1;
}

/* ===== ADD TO WATCHLIST BUTTON ===== */
.add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%; /* Makes it circular */
  background-color: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: center; /* Center the button horizontally */
  margin-top: 16px; /* Space from the list above */
  flex-shrink: 0;
  position: relative; /* For tooltip positioning */
}

.add-button:hover {
  background-color: var(--accent-color);
  color: var(--panel-color);
  box-shadow: 0 0 15px var(--glow-color);
}

.add-button:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 55px; /* Position tooltip above the button */
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 1100;
}
body[data-theme="light"] .add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%; /* Makes it circular */
  background-color: transparent;
  border: 2px solid rgb(0, 0, 0);
  color: rgb(0, 0, 0);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: center; /* Center the button horizontally */
  margin-top: 16px; /* Space from the list above */
  flex-shrink: 0;
  position: relative; /* For tooltip positioning */
}

body[data-theme="light"] .add-button:hover {
  background-color: rgba(0,0,0,0.2);
  color: rgba(0,0,0,0.2)
 
}



.tab-pane-watchlist {
  display: none;
  height: 100%;
}

.tab-pane-watchlist.active {
  display: block;
}

.order-book-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.order-book-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted-color);
  margin-bottom: 8px;
  padding: 0 8px;
}

.order-book-header span:first-child {
  text-align: left;
}

.order-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: right;
  font-size: 14px;
  margin-bottom: 4px;
  border-radius: 4px;
  padding: 4px 8px;
  position: relative;
}

.order-row span:first-child {
  text-align: left;
  font-weight: 500;
}

.bid-row {
  background: linear-gradient(to left, rgba(0, 255, 196, 0.2) var(--depth), transparent 0);
}

.ask-row {
  background: linear-gradient(to right, rgba(255, 73, 118, 0.2) var(--depth), transparent 0);
}

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

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

th {
  color: var(--text-muted-color);
  font-weight: 500;
}

/* Right Sidebar Panels */
/* updated.css */

/*
  ADD THIS NEW RULE IN ITS PLACE:
*/
.watchlist-panel {
  flex-grow: 1; /* This makes the panel fill all available vertical space in the sidebar. */
  min-height: 0; /* This prevents potential overflow issues with scrolling content inside the panel. */
}

.news-panel {
  height: 150px;
  margin-bottom: 100px;
  
  /* Take remaining space */

}


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

.watchlist-header .search-box {
  padding: 20px 10px;
}

.watchlist-header .search-box input {
  width: 100px;
  font-size: 13px;
}

.watchlist-header-text {
  font-size: 12px;
}

.watchlist-item a.watchlist-link {
  display: flex; /* Make the link a flex container */
  justify-content: space-between; /* Space out the info and price */
  align-items: flex-start; /* Align items to the top */
  width: 100%; /* Ensure the link takes full width of its parent */
  text-decoration: none; /* Remove underline from links */
  color: var(--text-color); /* Inherit text color, or set a specific one */
}

/* Existing styles for item-info already look good, but let's review: */
.watchlist-item .item-info {
  display: flex;
  flex-direction: column; /* Stack symbol and name vertically */
  gap: 2px; /* Reduce gap between symbol and name for tighter look */
  flex-grow: 1;
  min-width: 0; /* Allow shrinking */
}

.watchlist-item .item-symbol {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 15px; /* Slightly larger for emphasis */
  color: var(--accent-color); /* Make symbol stand out */
}

.watchlist-item .item-name {
  white-space: normal;
  word-break: break-word;
  color: var(--text-muted-color);
  font-size: 13px; /* Slightly smaller for detailed text */
  line-height: 1.3; /* Adjust line spacing for readability */
}

.watchlist-item .item-price {
  flex-shrink: 0; /* Prevent price from shrinking */
  margin-left: 8px; /* Add some space between name and price */
  font-weight: 700;
  color: var(--text-color); /* Ensure price is visible */
  font-size: 15px; /* Match symbol size */
}

/* Ensure consistent vertical padding for all watchlist items */
.watchlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Center aligns entire row, including the price */
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0; /* Uniform vertical spacing */
}

/* Correcting potential conflict for the last item not having a border-bottom */
.watchlist-item:last-child {
  border-bottom: none; /* */
}

/* Adjust the watchlist content padding to remove inner padding */
.watchlist-content {
  padding: 0px; /* Remove inner padding so list items control their spacing */
  row-gap: 0px; /* No gap for list items, padding handles it */
  min-height: 0;
  overflow-y: auto;
}

/* If you want the scrollbar to always be visible (for consistent layout) */
.watchlist {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto; /* Always show scrollbar if content overflows */
  max-height: 400px; /* Adjust as needed, ensure it fits within the panel */
}

.item-symbol {
  font-weight: 700;
  font-family: var(--font-display);
}

.price-up {
  color: var(--green-color);
}

.price-down {
  color: var(--red-color);
}
/* ===== NEW WATCHLIST ITEM STYLES ===== */
.watchlist-item .item-info {
  display: flex;
  align-items: flex-start; /* Align symbol and name to the top */
  gap: 12px; 
  flex-grow: 1; 
  min-width: 0; 
}

.watchlist-item .item-symbol {
  flex-shrink: 0; 
  margin-top: 1px; /* Minor alignment adjustment */
}

.watchlist-item .item-name {
  white-space: normal; /* Allow text to wrap */
  word-break: break-word; /* Break long words if necessary */
  color: var(--text-muted-color);
  font-size: 14px;
  line-height: 1.4; /* Adjust line spacing for readability */
}

.watchlist-item .item-price-change {
  flex-shrink: 0; 
  padding-left: 8px; 
  font-size: 14px;
  font-weight: 500;
}
.market-description {
  
  padding: 10px 16px; /* Only add horizontal padding */
}

.market-description h6 {
  font-size: 14px;
  color: white;
  font-family: var(--font-display);
  line-height: 1.5;
  margin: 0 0 12px 0;
  font-weight: 400;
}
.news-title {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.news-list {
  list-style: none;

  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 40px;
}

.news-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.news-item:last-child,
.watchlist-item:last-child {
  border: none;
}

/* ===== CUSTOM SCROLLBAR STYLES ===== */
::-webkit-scrollbar {
  width: 8px;
  /* Width of the entire scrollbar */
}

::-webkit-scrollbar-track {
  background: var(--panel-color);
  /* Color of the tracking area */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--text-muted-color);
  /* Color of the scroll thumb */
  border-radius: 10px;
  /* Roundness of the scroll thumb */
  border: 2px solid var(--panel-color);
  /* Creates padding around the thumb */
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-color);
  /* Color of the scroll thumb on hover */
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex; /* Shown with JS */
}

.modal {
    background: var(--panel-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted-color);
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: var(--text-color);
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex; /* Shown with JS */
}

.modal {
    background: var(--panel-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted-color);
    cursor: pointer;
    transition: color 0.2s ease;
}


.close-button:hover {
    color: var(--text-color);
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.remove-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: transparent;
  border: 2px solid #e11d48;
  color: #e11d48;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: center;
  margin-top: 16px;
  flex-shrink: 0;
  position: relative;
}
.remove-button:hover {
  background-color: #fee2e2;
  color: #be123c;
  box-shadow: 0 0 15px #e11d48;
}
.remove-icon {
  position: relative;
  top: -2px;
  color: #e11d48;
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* --- 4. For Mobile Devices (e.g., < 480px) --- */
@media (max-width: 480px) {
  .main-content {
    grid-template-rows: 2fr 1fr; /* Maintain 2/3 to 1/3 ratio */
  }
  
  /* Further reduce minimum heights for mobile */
  .chart-panel {
    min-height: 250px;
  }
  
  .chart-container {
    min-height: 200px;
  }
}

/* --- 5. For Very Small Screens (e.g., < 320px) --- */
@media (max-width: 320px) {
  .main-content {
    grid-template-rows: 2fr 1fr; /* Maintain 2/3 to 1/3 ratio */
  }
  
  .chart-panel {
    min-height: 200px;
  }
  
  .chart-container {
    min-height: 150px;
  }
}

/* ===== DATA & INDICATORS SCREENS ===== */
.indicators-panel {
  background-color: var(--panel-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.data-panel {
  background-color: var(--panel-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
 
}

.data-title,
.indicators-title {
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 20px 0;
  color: var(--text-color);
}
.input-text{
  font-family: var(--font-display);
}

.data-content,
.indicators-content {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.data-placeholder,
.indicators-placeholder {
  text-align: center;
  color: var(--text-muted-color);
  padding: 40px;
}

.data-placeholder i,
.indicators-placeholder i {
  font-size: 4rem;
  margin-bottom: 20px;
  color: var(--accent-color);
  opacity: 0.7;
}

.data-placeholder h3,
.indicators-placeholder h3 {
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  color: var(--text-color);
  font-weight: 500;
}

.data-placeholder p,
.indicators-placeholder p {
  font-size: 1rem;
  margin: 0;
  opacity: 0.8;
}

/* Light theme adjustments for placeholders */
body[data-theme="light"] .data-placeholder i,
body[data-theme="light"] .indicators-placeholder i {
  color: var(--text-color);
  opacity: 0.5;
}

body[data-theme="light"] .data-placeholder h3,
body[data-theme="light"] .indicators-placeholder h3 {
  color: var(--text-color);
}

body[data-theme="light"] .data-placeholder p,
body[data-theme="light"] .indicators-placeholder p {
  color: var(--text-muted-color);
}


/* green ↑ */
.price-up,
.price-up .pct {
  color: #00ffc4;      /* or any green you prefer */
}

/* red ↓ */
.price-down,
.price-down .pct {
  color: #ff4976;      /* or any red you prefer */
}

.item-price.price-up {
  color: green !important;
}

.item-price.price-down {
  color: red !important;
}


/* ===== SPACING & TABLE CLEANUP ===== */
:root {
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
}

/* Generic card and header spacing */
.bbg-wrap {
  padding: var(--space-xl);
}
.bbg-header {
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.bbg-header > div > * + * {
  margin-top: var(--space-xxs);
}

/* Grid gap refinement */
.bbg-grid {
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Card padding and stacking */
.bbg-card {
  padding: var(--space-md);
}
.bbg-card + .bbg-card {
  margin-top: var(--space-sm);
}
.bbg-card h3 {
  margin: 0 0 var(--space-sm) 0;
}

/* Table row height & spacing */
.bbg-table {
  border-collapse: separate;
  border-spacing: 0;
}
.bbg-table th,
.bbg-table td {
  padding: 10px var(--space-md);
  line-height: 1.25;
  vertical-align: middle;
  border-bottom: 1px dotted #273141;
}
.bbg-table tr:last-child th,
.bbg-table tr:last-child td {
  border-bottom: 0;
}

/* Tag & related markets spacing */
.bbg-tags {
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}
.bbg-related {
  gap: var(--space-sm);
}
.bbg-rel-item {
  padding: var(--space-sm);
}

/* Typography consistency */
.bbg-ticker,
.bbg-title,
.bbg-sub {
  margin: 0;
}

.watchlist-link,
.watchlist-link:link,
.watchlist-link:visited,
.watchlist-link:hover,
.watchlist-link:active {
  text-decoration: none;   /* remove underline */
  color: inherit;          /* no default blue */
  display: block;          /* full-tile clickable */
}

/* Optional: a subtle hover effect for the tile */
.watchlist-link:hover .bbg-rel-item {
  border-color: #233142;
  filter: brightness(1.05);
}

/* Accessible focus style (keyboard users) */
.watchlist-link:focus-visible .bbg-rel-item {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}