/* ==========================
   Sidebar
   ========================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  width: 220px;
  background: #1e1e2f;
  color: #fff;
  padding-top: 1rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
}
.sidebar.open {
  transform: translateX(0);
}
.sidebar-brand {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
}
.sidebar-nav a {
  padding: 0.8rem 1rem;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #d64545;
}
.sidebar-nav a.logout {
  margin-top: auto;
  background: #ff4b4b;
}

/* ==========================
   Main content
   ========================== */
.main {
  margin-left: 0;
  transition: margin-left 0.3s ease;
  padding: 1rem;
  min-height: 100vh;
  background: linear-gradient(135deg, #ff4b4b, #1e1e2f, #ff7f7f);
  background-size: 400% 400%;
  animation: gradientBG 20s ease infinite;
  color: #fff;
}
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #ddd;
}
.topbar .brand {
  font-size: 1.1rem;
  color: #d64545;
}
.menu-toggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* ==========================
   Greeting
   ========================== */
#greeting {
  margin: 1rem 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff; /* white for contrast */
}

/* ==========================
   Section titles
   ========================== */
.wallet-overview h3,
.trading-chart h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff; /* white on gradient */
  border-left: 4px solid #ffb3b3; /* soft red accent */
  padding-left: 0.5rem;
}

/* ==========================
   Wallet Overview
   ========================== */
.wallet-overview {
  margin-top: 1.5rem;
}
.wallet-grid {
  display: grid;
  gap: 1rem;
}
.wallet-card {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}
.wallet-card:hover {
  transform: translateY(-3px);
}
.wallet-card img {
  width: 36px;
  height: 36px;
  margin-right: 0.8rem;
}
.wallet-card h4 {
  margin: 0;
  font-size: 1rem;
  color: #333;
}
.wallet-card .balance {
  font-size: 0.9rem;
  color: #666;
}

/* Responsive wallet grid */
@media (min-width: 768px) {
  .wallet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .wallet-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================
   Account Overview
   ========================== */
.account-overview {
  margin-top: 1.5rem;
}
.account-overview h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  border-left: 4px solid #ffb3b3;
  padding-left: 0.5rem;
}

.account-grid {
  display: grid;
  gap: 1rem;
}
.account-card {
  background: transparent;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  text-align: center;
  transition: transform 0.2s ease;
}
.account-card:hover {
  transform: translateY(-3px);
}
.account-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #fff;
}
.account-card p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #d64545;
}

/* Highlighted Account Balance Card */
.account-card.highlight {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-navy));
  animation: gradientBG 18s ease infinite;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transform: scale(1.02);
  grid-column: span 1; /* default mobile */
  background-size: 400% 400%;
  -webkit-font-smoothing: antialiased;
}
.account-card.highlight h4 {
  color: #fff;
}
.account-card.highlight p {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
}

/* On desktop, make Account Balance full width */
@media (min-width: 1024px) {
  .account-card.highlight {
    grid-column: span 4; /* stretch across all columns */
    border-radius: 28px;
    margin-left: 1rem;
    margin-right: 1rem;
    padding-top: 3rem;
    padding-bottom: 2rem;
  }
}


/* Highlight Current Plan Card (subtle accent) */
.account-card.plan-highlight {
  border: 2px solid #ff4b4b;   /* red border accent */
  background: #f7f5ffa3;         /* soft tinted background */
}
.account-card.plan-highlight h4 {
  color: #fff;
}
.account-card.plan-highlight p {
  color: #d64545;
  font-weight: 600;
}

/* Responsive grid */
@media (min-width: 768px) {
  .account-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .account-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ==========================
   Trading Chart
   ========================== */
.trading-chart {
  margin-top: 2rem;
}
.tradingview-widget-container {
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  height: 400px;
}
#tradingview_chart {
  width: 100%;
  height: 100%;
}

/* ==========================
   Desktop layout
   ========================== */
@media (min-width: 768px) {
  .sidebar {
    transform: translateX(0);
  }
/*.main {
    margin-left: 220px;
  }
    */
  .menu-toggle {
    display: none;
  }


}

/* Sidebar Backdrop (mobile only) */
.sidebar-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 900;
  display: none;
}

.sidebar.open + .sidebar-backdrop {
  display: block;
}

@media (min-width: 768px) {
  .sidebar-backdrop {
    display: none !important; /* disable backdrop on desktop */
  }
}


/* ==========================
   Quick Actions
   ========================== */
.quick-actions {
  margin-top: 2rem;
}
.quick-actions h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  border-left: 4px solid #ffb3b3;
  padding-left: 0.5rem;
}

.actions-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
}

.action-btn.deposit {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
}
.action-btn.withdraw {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.actions-extra {
  margin-top: 1rem;
}

a {
  color: #fff;
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--brand-red-dark);
}



.view-all {
  margin-top: 0.8rem;
  text-align: right;
}
.view-all a {
  color: #ffb3b3;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.view-all a:hover {
  color: #fff;
}

/* Pagination */
.pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}
.pagination button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: #d64545;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.pagination button:disabled {
  background: #bbb;
  cursor: not-allowed;
}
.pagination button:hover:not(:disabled) {
  background: #a83232;
}
.pagination span {
  color: #fff;
  font-weight: 600;
}
/* Filter Bar */
.filter-bar {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.filter-bar label {
  color: #fff;
  font-weight: 600;
}
.filter-bar select {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
}

/* ==========================
   Transaction Table
   ========================== */
.transaction-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0; /* reset */
  table-layout: fixed; /* equal column widths */
}

.transaction-table th,
.transaction-table td {
  padding: 1rem;               /* more breathing room */
  text-align: left;
  font-size: 0.95rem;
  white-space: nowrap;
}

.transaction-table th {
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
}

.transaction-table td {
  color: #444;
  border-bottom: 1px solid #eee;
}

.table-wrapper {
 /* width: 100%;*/
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  padding: 0.5rem; /* adds inner space */
  padding-right: 0;
}

/* Make columns equal width */
.transaction-table th,
.transaction-table td {
  width: 25%; /* 4 equal columns */
}

/* Status badges */
.status {
  padding: 0.4rem 0.8rem;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  display: inline-block;
  text-align: center;
}
.status.success { background: #27ae60; }
.status.pending { background: #f39c12; }
.status.failed { background: #e74c3c; }

/* Mobile optimization */
@media (max-width: 600px) {
  .transaction-table thead {
    display: none;
  }
  .transaction-table tr {
    display: block;
    margin-bottom: 1rem;
    border-bottom: 2px solid #eee;
    padding: 0.5rem 0;
  }
  .transaction-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem;
    width: 100% !important;
    border: none;
  }
  .transaction-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #333;
    margin-right: 1rem;
  }
}



/* Status Legend */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #fff;
}
.status-legend span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.status-legend .status {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
}

/* Current Plan Box 
.current-plan-box {
  background: #fff5f5;
  border-left: 4px solid #d64545;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #333;
}
.current-plan-box strong {
  color: #d64545;
}
*/
/* Enhanced Select & Input Fields */
.form-card select,
.form-card input {
  width: 100%;
  max-width: 100%;          /* ✅ never exceed parent */
  box-sizing: border-box;
  font-size: 1rem;
  padding: 0.9rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* Add custom arrow for selects */
.form-card select {
  padding-right: 2.2rem;    /* ✅ give space for arrow */
  background-color: #fff;   /* ✅ prevent dark-on-dark */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg fill='black' height='24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
}

.form-card {
 /* background: #fff;*/
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 500px;   /* ✅ stops overflow on wide screens */
  margin: 0 auto;     /* ✅ center it */
  box-sizing: border-box;
}
/* On focus/hover */
.form-card select:focus,
.form-card input:focus {
  border-color: #d64545;
  box-shadow: 0 0 8px rgba(214, 69, 69, 0.4);
}

/* Placeholder style */
.form-card input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.form-card select option {
  font-size: 0.95rem;
  white-space: normal; /* wrap instead of overflow */
}

.copy-btn {
  margin-top: 0.8rem;
  padding: 0.6rem 1rem;
  background: #d64545;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease;
}
.copy-btn:hover {
  background: #b73737;
}

@media (max-width: 600px) {
  .form-card {
    padding: 1rem;          /* ✅ less padding on small screens */
  }
  .form-card select,
  .form-card input {
    font-size: 0.9rem;      /* ✅ smaller text */
    padding: 0.7rem;        /* ✅ smaller padding */
  }


}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #d64545;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(20px);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.action-btn.withdraw {
  background: #2980b9;
}
.action-btn.withdraw:hover {
  background: #21618c;
}
.withdraw-history {
  margin-top: 2rem;
}

.withdraw-history h3 {
  margin-bottom: 1rem;
  color: #fff;
  text-align: left;
}


/* Shared table style */
.transactions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  text-align: left;
  min-width: 600px; /* ensures table doesn't squash on wide screens */
}

.transactions-table th,
.transactions-table td {
  padding: 0.9rem 1.2rem; /* more breathing space */
  border-bottom: 1px solid #eee;
  white-space: nowrap; /* keep content neat */
}

.transactions-table th {
  background: #f7f7f7;
  font-weight: 600;
  color: #333;
}

.transactions-table tr:last-child td {
  border-bottom: none;
}

.table-container {
  /*background: #fff;*/
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  padding: 0;
  overflow-x: auto; /* allow scroll on small screens */
}

.notif-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 1.2rem;
}

.notif-bell {
  font-size: 1.5rem;
  margin-right: 0.225rem;
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #d64545;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 50%;
  padding: 2px 6px;
  line-height: 1;
}
