html,
body {
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  margin: 0;
  background-color: #121212;
  color: #e0e0e0;
  line-height: 1.6;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.table-responsive::-webkit-scrollbar{
  display: none;
}

/* table.display {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
} */

table.display th,
table.display td {
    padding: 8px 10px;
    text-align: center;
    white-space: nowrap;
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  overflow-x: hidden;
  background-color: rgba(0, 0, 0, 0.6);
  padding-top: 60px;
}

/* Modal Content */
.custom-modal {
  background-color: #1e1e1e;
  color: #e0e0e0;
  margin: auto;
  border-radius: 10px;
  width: 90%;
  max-width: 900px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.market-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.market-widget {
  background-color: #1e1e1e;
  color: #fff;
  border-radius: 0.5rem;
  padding: 0 1rem;
  min-width: 190px;
  flex: 1 1 23%;
  /* flex: 1 1 auto; */
  max-width: 160px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.market-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.market-title-text{
  color: #4FC3F7;
}

.market-value {
  font-size: 1.2rem;
  font-weight: bold;
}

.market-change {
  font-size: 0.95rem;
}

.market-change .fa-caret-up,
.market-change .fa-caret-down {
  margin-right: 4px;
}

/* .market_cards{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
} */

.market_cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tableHead{
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 1rem;
}

.pnl-overview-container {
  display: flex;
  gap: 16px;
}

.pnl-card {
  background-color: #1E1E1E;
  border-radius: 12px;
  padding: 5px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.pnl-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.05rem;
}

.pnl-label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #4FC3F7;
}

.pnl-value {
  font-size: .8rem;
  margin-bottom: 2px;
}

.pnl-value .fa-arrow-up {
  color: green;
}

.pnl-value .fa-arrow-down {
  color: red;
}

.pnl-total {
  font-size: 0.9rem;
  color: #e4e2e2;
}

.pnl-icon {
  font-size: 32px;
  opacity: 0.8;
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 0;
  right: 15px;
  font-size: 26px;
  font-weight: bold;
  color: #ccc;
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #fff;
}

/* Modal Body Layout */
.modal-body {
  display: flex;
  flex-direction: row;
  padding: 30px;
  gap: 30px;
}

/* Text Content */
.modal-text {
  flex: 2;
}

.modal-text h2 {
  margin-top: 0;
  color: #4fc3f7;
}

.modal-text p {
  line-height: 1.6;
  color: #ccc;
}

.modal-footer {
  margin-top: 15px;
  font-size: 0.85rem;
  color: #aaa;
}

.modal-premium {
  color: #ff5c5c;
  margin-left: 6px;
}

/* .news-box{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
} */

/* Image Styling */
/* .modal-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
} */

.news-box {
  display: flex;
  justify-content: space-between;
  /* align-items: center; */
  gap: 24px; /* adds space between <p> and image */
}

.news-box p {
  flex: 1;
  margin: 0;
  max-width: 600px;
}

/* .modal-image {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.modal-image img {
  width: 250px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
} */

.container {
  margin: 0 auto;
  padding: 20px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: #111;
  color: white;
  font-family: Arial, sans-serif;
}

.news-layout {
  display: flex;
  gap: 12px;
}

.news-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.news-images img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  width: 850px; 
}

.news-image-fallback {
  /* margin-top: 10px;
  border-radius: 8px;
  max-width: 100%; */
  width: 250px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}


.news-content{
  background-color: #120f0f;
  color: #fff;
  border-radius: 10px;
  min-width: 996px;
}

.sidebar{
  background-color: #1e1e1e;
  padding: 20px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.widget-success{
  color: #00c853;
}

.widget-danger{
  color: rgb(209, 3, 3);
}

/* .news-content {
  flex: 3;
} */

.sidebar {
  flex: 1;
  height: fit-content;
}

.sidebar h2 {
  color: #66b2ff;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.4em;
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
}

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

.sidebar li {
  margin-bottom: 12px;
}

.sidebar a {
  text-decoration: none;
  color: #66b2ff;
}

.sidebar a:hover {
  text-decoration: underline;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

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

.sidebar-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #66b2ff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 10px;
  font-size: 0.8em;
}

.sidebar-item-content .title {
  font-weight: 500;
  color: #e0e0e0;
}

.sidebar-item-content .date {
  font-size: 0.8em;
  color: #888;
}

/* Table Styling */
#stockTable {
  width: 100%;
  font-size: 0.88rem;
  color: #fff;
  border-collapse: separate;
  border-spacing: 0 10px;
}

#stockTable th,
#stockTable td {
  text-align: left;
  padding: 10px;
}

#stockTable tbody tr {
  background-color: #222;
}

#stockTable a {
  text-decoration: none;
  color: #66b2ff;
}

.tableHead_heading{
  font-size: 1.3rem; 
  font-weight: bold; 
  color: #4FC3F7; 
  display: inline-block;
}

@media (max-width: 992px) {
  .news-layout {
    flex-direction: column;
  }

  .news-content,
  .sidebar {
    width: 100%;
    flex: none;
  }
}

@media (max-width: 768px) {
  .market-widget{
    padding: 0 0.5rem;
  }

  .main-header {
    flex-direction: column;
    text-align: center;
    padding: 15px 10px;
  }

  .market_cards{
    flex-direction: column;
    text-align: center;
  }

  .container{
    padding: 0;
  }

  .main-header .logo {
    margin-bottom: 10px;
  }

  .news-content h1 {
    font-size: 1.4em;
  }

  .news-layout {       
    flex-direction: column;
  }

  .modal-body {
    flex-direction: column;
    padding: 20px;
  }

  .modal-image {
    justify-content: center;
    margin-top: 15px;
  }

  .modal-image img {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .news-content{
    min-width: 380px;
    padding: 15px 8px;
  }

  .news-content,
  .sidebar {
    width: 96%;
    padding: 15px 8px;
  }

  .tableHead_heading{
    display: none;
  }
  .news-box{
    flex-direction: column-reverse;
  }
  .sidebar-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar-item-icon {
    margin-bottom: 6px;
  }

  .sidebar-item-content .title {
    font-size: 0.95em;
  }

  .sidebar-item-content .date {
    font-size: 0.75em;
  }

  .modal-content {
    padding: 15px;
  }
}

.custom-ticker {
  background-color: #1e1e1e;
  color: #66b2ff;
  font-size: 0.9rem;
  padding: 10px;
  text-align: center;
  font-weight: bold;
  border-bottom: 1px solid #333;
}

.gainer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

.gainer-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 0.9em;
  flex-shrink: 0;
}

.gainer-details {
  flex-grow: 1;
  color: #e0e0e0;
}

.gainer-name {
  font-weight: 500;
  font-size: 0.95em;
}

.gainer-symbol {
  font-size: 0.75em;
  color: #aaa;
}

.gainer-price {
  text-align: right;
  font-size: 0.85em;
  color: #fff;
}

.gainer-change {
  color: #00c853;
  font-size: 0.75em;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.tab-btn {
  /* flex: 1; */
  background-color: #2c2c2c;
  color: #fff;
  border: none;
  padding: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.tab-btn.active,
.tab-btn:hover {
  background-color: #66b2ff;
  color: #000;
}

.tab-btn i {
  margin-right: 6px;
}

.up-icon{
    color: green;
}

.down-icon{
    color: red;
}

.dataTables_filter input{
  padding: 6px 10px;
  border-radius: 6px;
  border: 0.5px solid #444;
  background-color: #222;
  color: #fff;
  font-size: 0.85rem;
}

#stockModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
}

/* Make modal box scrollable if content overflows */
.modal-content {
  background: #fff;
  max-height: 90vh;
  width: 90%;
  overflow-y: auto;
  padding: 20px;
  border-radius: 8px;
}

#stockTable th,
#stockTable td {
  text-align: center;
  vertical-align: middle;
}

#stockTable th:first-child,
#stockTable td:first-child {
  text-align: left;
  border-right: 1px solid #131212;
}