:root {
  --dark-bg: #171b26;
  --darker-bg: #131722;
  --panel-bg: #1e222d;
  --border-color: #2a2e39;
  --text-color: #d1d4dc;
  --muted-text: #787b86;
  --green: #4caf50;
  --red: #e53935;
  --blue: #2196f3;
  --accent-blue: #5d9cf5;
  --header-height: 60px;
  --side-panel-width: 320px;
  /* --side-panel-height-mobile: 300px; */
  --side-panel-height-mobile: 38vh;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: var(--darker-bg);
  color: var(--text-color);
  height: 100vh !important;
  overflow: hidden !important;
  padding: 0;
  margin: 0;
  background: #171b26;
}

.main {
  width: 100%;
  height: 100vh;
  /* Added height */
  position: relative;
  /* Added position relative */
}

header {
  display: flex;
  justify-content: space-between;
  padding: 8px !important;
}

.header {
  height: var(--header-height);
  background-color: var(--dark-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 15px !important;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 30px;
  margin-right: 10px;
}

.language-selector {
  display: flex;
  align-items: center;
  background-color: var(--panel-bg);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  margin-right: 10px;
}

.language-selector i {
  margin-left: 8px;
  font-size: 12px;
}

.fullscreen-btn {
  padding: 8px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 4px;
  cursor: pointer;
  margin-right: 10px;
}

.account-info {
  display: flex;
  align-items: center;
}

.account-dropdown {
  background-color: var(--panel-bg);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  margin-right: 15px;
}

.account-dropdown i {
  margin-left: 8px;
  font-size: 12px;
}

.account-number {
  margin-left: 5px;
  font-weight: bold;
}

.header-button {
  background-color: var(--panel-bg);
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 13px;
  margin-right: 15px;
}

.header-button i {
  margin-right: 8px;
}

.balance-display {
  margin-right: 15px;
  text-align: right;
}

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

.balance-amount {
  font-size: 20px;
  font-weight: bold;
}

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

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #555;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.user-info {
  text-align: left;
}

.user-title {
  font-weight: bold;
}

.user-subtitle {
  font-size: 12px;
  color: var(--muted-text);
}

.main-content {
  display: flex;
  height: calc(100vh - var(--header-height));
}

.chart-container {
  flex: 1;
  height: 100%;
  position: relative;
  background-color: var(--darker-bg);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--dark-bg);
}

.symbol-selector {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.symbol-text {
  font-size: 18px;
  font-weight: bold;
  margin-right: 8px;
}

.timeframe-tabs {
  display: flex;
  background-color: var(--dark-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 5px;
}

.timeframe-tab {
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 3px;
  margin-right: 5px;
  font-size: 12px;
}

.timeframe-tab.active {
  background-color: var(--panel-bg);
}

.chart-area {
  position: absolute;
  width: 100%;
  height: calc(100% - 80px);
  top: 96px;
}

.market-watch {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(30, 34, 45, 0.7);
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 10;
  backdrop-filter: blur(3px);
}

.side-panel {
  width: 320px;
  background-color: var(--dark-bg);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
}

.panel-section {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-dropdown {
  padding: 8px 15px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 15px;
}

.input-field {
  padding: 10px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
  width: 100%;
  margin-bottom: 15px;
}

.profit-display {
  background-color: var(--panel-bg);
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.profit-label {
  font-size: 12px;
  margin-bottom: 5px;
}

.profit-amount {
  font-size: 22px;
  font-weight: bold;
}

.profit-percentage {
  font-size: 16px;
  margin-top: 5px;
}

.action-button {
  width: 100%;
  padding: 15px;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-down {
  background-color: var(--red);
}

.btn-icon {
  margin-right: 10px;
}

.price-labels {
  position: absolute;
  right: 5px;
  top: 40px;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 0;
  font-size: 11px;
  color: var(--muted-text);
}

.chart-controls {
  position: absolute;
  left: 10px;
  bottom: 23%;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.chart-control-btn {
  width: 30px;
  height: 30px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 5px;
  color: var(--text-color);
  font-size: 14px;
}

/* pppppppppp */
/* Reset main container styles */
.main {
  width: 100%;
  /* Subtract sidebar width */
  height: calc(100vh - var(--header-height));
  position: relative;
}

/* Keep chart container styles simple */
#container-chart {
  width: 100%;
  height: calc(100vh - 170px);
  position: absolute;
  bottom: 0;
  left: 0;
  top: 0;
}

/* Ensure main-content fills available space */
.main-content {
  display: flex;
  height: calc(100vh - var(--header-height));
}

/* Chart container takes remaining width */
.chart-container {
  flex: 1;
  height: 100%;
  position: relative;
  background-color: var(--darker-bg);
}

/* Side panel remains fixed width */
.side-panel {
  width: 320px;
  min-width: 320px;
  /* Prevent shrinking */
  background-color: var(--dark-bg);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
}

.chart-container:fullscreen {
  background-color: var(--darker-bg);
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
}

.chart-container:fullscreen .chart-area {
  height: calc(100% - 80px);
}

.chart-container:-webkit-full-screen {
  background-color: #fff;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
}

.chart-container:-moz-full-screen {
  background-color: #fff;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
}

.chart-container:-ms-fullscreen {
  background-color: #fff;
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
}

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

.modal-content {
  position: relative;
  background-color: #1e222d;
  margin: 15% auto;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  color: #d1d4dc;
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #2a2e39;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: #d1d4dc;
}

.modal-body {
  padding: 20px;
}

.trade-detail {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.trade-icon {
  font-size: 24px;
  margin-right: 10px;
}

.trade-icon.up {
  color: #4caf50;
}

.trade-icon.down {
  color: #e53935;
}

.trade-type {
  font-size: 18px;
  font-weight: bold;
}

.trade-info {
  background-color: #171b26;
  padding: 15px;
  border-radius: 6px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.symbol {
  font-weight: bold;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #2a2e39;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.close-btn {
  background-color: #2a2e39;
  color: #d1d4dc;
}

.submit-btn {
  color: white;
}

.up-submit {
  background-color: #4caf50;
}

.down-submit {
  background-color: #e53935;
}

.close-btn:hover {
  background-color: #363a47;
}

.up-submit:hover {
  background-color: #45a049;
}

.down-submit:hover {
  background-color: #d32f2f;
}

/* Dropdown Base Styles */
.dropdown-menu {
  display: none;
  position: absolute;
  background-color: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 160px;
}

.dropdown-item {
  padding: 10px 15px;
  color: #d1d4dc;
  cursor: pointer;
  font-size: 14px;
}

.dropdown-item:hover {
  background-color: #2a2e39;
}

.dropdown-divider {
  height: 1px;
  background-color: #2a2e39;
  margin: 5px 0;
}

/* Language Selector Dropdown */
.language-selector {
  position: relative;
}

.language-menu {
  top: 100%;
  left: 0;
  margin-top: 5px;
}

/* Account Dropdown */
.account-dropdown {
  position: relative;
}

.account-menu {
  top: 100%;
  left: 0;
  margin-top: 5px;
  min-width: 240px;
}

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

.account-details {
  flex: 1;
}

.account-id {
  font-size: 12px;
  color: #787b86;
  margin-top: 2px;
}

.account-balance {
  font-weight: bold;
  margin-left: 15px;
}

/* Panel Dropdown */
.panel-dropdown {
  position: relative;
}

.timeframe-menu {
  top: 100%;
  left: 0;
  margin-top: 5px;
  width: 100%;
}

/* Active state for dropdowns */
.dropdown-active {
  background-color: #2a2e39;
}

/* Show dropdown when active */
.show-dropdown {
  display: block;
}

.account-l {
  display: flex;
}

.right-section {
  display: flex;
  width: 100%;
  justify-content: space-between;
}

.account-r {
  display: flex;
}

.symbol-selector {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
}

.symbol-selector:hover {
  background-color: #2a2e39;
}

.symbol-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 200px;
  margin-top: 5px;
  display: none;
}

.symbol-menu.show-dropdown {
  display: block;
}

.symbol-category {
  padding: 10px 15px;
  color: #787b86;
  font-size: 12px;
  font-weight: bold;
  background-color: #171b26;
  border-bottom: 1px solid #2a2e39;
}

.symbol-item {
  padding: 10px 15px;
  color: #d1d4dc;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ================================== */
/* Responsive layout styles */
.main-content {
  display: flex;
  height: calc(100vh - var(--header-height));
  position: relative;
}

/* Chart container takes remaining width */
.chart-container {
  flex: 1;
  height: 100%;
  position: relative;
  background-color: var(--darker-bg);
  transition: height 0.3s ease;
}

/* Side panel styles */
.side-panel {
  width: var(--side-panel-width);
  min-width: var(--side-panel-width);
  background-color: var(--dark-bg);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  transition: transform 0.3s ease;
}

/* Panel toggle button - hidden by default on desktop */
.panel-toggle {
  display: none;
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 50%;
  z-index: 100;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.panel-toggle i {
  font-size: 20px;
  transition: transform 0.3s ease;
}

/* Media query for tablets and mobile */
@media (max-width: 1024px) {
  /* body {
    overflow: auto !important;
  } */
  .chart-controls {
    bottom: 50vh;
  }
  .main-content {
    flex-direction: column;
  }
  .chart-container {
    height: calc(100% - var(--side-panel-height-mobile));
    width: 100%;
  }
  .side-panel {
    position: absolute;
    /* bottom: 8%; */
    bottom: 0%;
    left: 0;
    width: 100%;
    height: var(--side-panel-height-mobile);
    min-width: unset;
    border-left: none;
    border-top: 1px solid var(--border-color);
    /* transform: translateY(calc(100% - 40px)); */
    /* Show just the handle by default */
    z-index: 50;
    background: white !important;
  }
  /* .side-panel.expanded {
    transform: translateY(0);
  } */
  .panel-toggle {
    /* display: flex; */
    display: none;
    top: 5px;
    right: 10px;
    border-radius: 4px;
  }
  /* .side-panel.expanded .panel-toggle i {
    transform: rotate(180deg);
  } */
  /* Add a drag handle at the top of the panel */
  .panel-handle {
    display: block;
    height: 28px;
    background: #227dc099;
    position: relative;
    cursor: pointer;
    text-align: center;
  }
  .panel-handle:before {
    content: "";
    width: 40px;
    height: 5px;
    background-color: #fff;
    border-radius: 5px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
  .fullscreen-btn {
    display: none;
  }
  .btn-down {
    margin-bottom: 60px !important;
  }
  /* Adjust panel sections for mobile */
  .panel-section {
    padding: 10px;
  }
  #container-chart {
    height: calc(100vh - var(--side-panel-height-mobile) - 100px);
  }
}
/* Small mobile devices */
@media (max-width: 480px) {
  .action-buttons {
    display: flex;
    flex-direction: column;
  }
  .market-watch {
    font-size: 10px;
  }
  .action-button {
    margin-bottom: 10px;
  }
}

/* ======================= */
/* Hamburger Menu Styles */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  margin-right: 10px;
}

.hamburger .line {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  margin: 4px 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .account-dropdown {
    width: 100%;
  }
  .menu-items {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
    position: absolute;
    top: var(--header-height);
    left: 0;
    z-index: 1000;
  }
  /* #container-chart {
    height: calc(72vh);
  } */
  .menu-items.active {
    display: flex;
  }

  .right-section {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .account-r {
    flex-direction: row-reverse;
  }
  .market-watch {
    top: 100px;
  }
  .account-l {
    display: flex;
    flex-direction: column;
  }
  .account-dropdown {
    margin-right: 0px;
  }
  .show-dropdown {
    width: 100%;
  }

  .account-l,
  .account-r {
    width: 100%;
    padding: 10px;
  }
  .account-r {
    background: #e9f2f9;
  }
  .account-info {
    gap: 5px;
  }
  .balance-display {
    margin-right: 0;
    margin-left: 10px;
  }
  .user-avatar {
    width: 30px;
    height: 30px;
  }

  .header-button {
    width: 100%;
    margin: 5px 0;
  }

  .balance-display,
  .user-profile {
    width: 100%;
    text-align: left;
  }
}
/* @media (min-width: 992px) and (max-width: 1024px) {
  .panel-handle {
    height: 60px;
  }
  #container-chart {
    height: calc(74vh);
  }
} */
/* Fix for device rotation issues */
html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
}

/* Media query for landscape orientation */
@media screen and (orientation: landscape) and (max-height: 500px) {
  body {
    overflow-y: auto !important;
    position: relative;
  }

  .main-content {
    min-height: 100vh;
  }

  .chart-container {
    min-height: 300px;
  }

  .side-panel {
    height: auto;
    max-height: 40vh;
  }

  #container-chart {
    height: 60vh;
    min-height: 250px;
  }

  .panel-handle {
    height: 20px;
  }

  .panel-handle:before {
    top: 7px;
  }
}

@media screen and (orientation: landscape) and (max-height: 400px) {
  .side-panel {
    max-height: 50vh;
  }

  .chart-container {
    height: calc(100% - 50vh);
  }

  #container-chart {
    height: 50vh;
  }
}
.timerrr {
  color: #131722;
}
.position_box_profit .timerrr {
  color: #4caf50;
  /* font-weight: bold; */
}
.position_box_loss .timerrr {
  color: #f44336;
  /* font-weight: bold; */
}
.vj {
  display: flex;
  flex-direction: column;
}
