/* ========================= */
/* TRADER PAGE STYLING */
/* ========================= */

.deal-container {
  width: 100%;
  max-width: 100%;
}
/* TABLE CARD */
.table-card {
  background: white;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow-x: auto;
}

/* TABLE */
#traderTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* HEADER */
#traderTable th {
  background: #2c3e50;
  color: white;
  padding: 10px;
  text-align: center;
}

/* BODY */
#traderTable td {
  padding: 8px;
  border: 1px solid #ddd;
}

/* HOVER */
#traderTable tbody tr:hover {
  background: #f5f5f5;
}

/* RIGHT ALIGN */
.right {
  text-align: right;
}

/* SEARCH BAR SAME AS DEAL */
.tool-search {
  display: flex;
  align-items: center;
  gap: 6px;

  background: linear-gradient(145deg, #f39c12, #e67e22);
  padding: 8px 12px;
  border-radius: 8px;

  width: 220px;
}

.tool-search input {
  border: none;
  outline: none;
  background: transparent;
  color: white;
  width: 100%;
}

.tool-search i {
  color: white;
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 350px;
}

.modal-content.large {
  width: 500px;
}

.modal-content input {
  width: 100%;
  padding: 8px;
  margin: 8px 0;
}

/* LIST */
.list-box {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  margin-top: 10px;
}

.list-item {
  padding: 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.list-item:hover {
  background: #f1f1f1;
}

/* TRADER INFO */
.trader-info {
  background: #ecf0f1;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}
#backButton .btn {
  background: linear-gradient(145deg, #e67e22, #d35400);
  color: white;
}
.info-card {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.info-card {
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.info-card {
  max-width: 500px;   /* 🔥 control width */
  margin: 0 auto 15px; /* center horizontally */
}

.info-card h3 {
  margin: 0;
}

.info-card p {
  margin: 3px 0;
  font-size: 13px;
  color: #ddd;
}
#millTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* HEADER */
#millTable th {
  background: #2c3e50;
  color: white;
  padding: 8px;
  text-align: center;
  border: 1px solid #ddd;
}

/* BODY */
#millTable td {
  padding: 6px;
  border: 1px solid #ddd;
}

/* HOVER */
#millTable tbody tr:hover {
  background: #f5f5f5;
}

/* RIGHT ALIGN */
.right {
  text-align: right;
}

/* TOTAL ROW */
.total-row {
  background:  #2c3e50;
  font-weight: bold;
}

/* ========================= */
/* STICKY HEADER (TRADER + MILL)
/* ========================= */

/* 🔥 IMPORTANT: enable vertical scroll */
.table-card {
  overflow-y: auto;      /* already x scroll exists */
  max-height: 450px;     /* adjust height if needed */
  position: relative;
}

/* 🔥 TRADER HEADER STICKY */
#traderTable thead th {
  position: sticky;
  top: 0;
  z-index: 5;

  background: #2c3e50;   /* MUST reapply */
  color: white;
}

/* 🔥 MILL HEADER STICKY */
#millTable thead th {
  position: sticky;
  top: 0;
  z-index: 5;

  background: #2c3e50;
  color: white;
}

#traderTable thead th,
#millTable thead th {
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
/* ========================= */
/* INPUT GROUP IMPROVED */
/* ========================= */

.input-group {
  position: relative;
  margin-bottom: 12px;   /* 🔥 space between fields */
}

/* ICON */
.input-group i {
  position: absolute;
  left: 14px;            /* 🔥 more space from left */
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 14px;
}

/* INPUT */
.input-group input {
  width: 100%;
  padding: 10px 12px 10px 42px;  /* 🔥 more padding for icon */
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  background: #fff;

  outline: none;
  box-shadow: none;
}

/* FOCUS */
.input-group input:focus {
  border: 1px solid #4CAF50;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.15);
}
/* ===== MODAL IMPROVEMENT ===== */

.modal-content.large {
  width: 480px;
  padding: 20px;
}

/* TITLE SPACING */
.modal-content h3 {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* SEARCH BOX SPACING */
.search-box {
  margin-bottom: 12px;
}

/* LIST */
.list-box {
  max-height: 260px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* LIST ITEM */
.list-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: 0.2s;
}

.list-item:hover {
  background: #f4f6f9;
}

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

/* CLOSE BUTTON 
.close-btn {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  color: white;
  border-radius: 6px;
  padding: 6px 12px;
}

.close-btn:hover {
  opacity: 0.9;
}
*/
/* ALIGN BUTTON RIGHT */
.modal-actions {
  margin-top: 12px;
  text-align: right;
}
/* ========================= */
/* HARD RESET INPUT STYLE */
/* ========================= */

.input-group input {
  -webkit-appearance: none;   /* 🔥 removes browser styling */
  appearance: none;

  border: 1px solid #ccc;
  outline: none;
  box-shadow: none !important;
  background: #fff;

  width: 100%;
  padding: 8px 10px 8px 32px;
  border-radius: 6px;
}

/* REMOVE ANY EXTRA BORDER FROM PARENT */
.input-group {
  border: none !important;
  box-shadow: none !important;
}

/* REMOVE GLOBAL INPUT EFFECTS */
input,
input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* CLEAN FOCUS STYLE */
.input-group input:focus {
  border: 1px solid #4CAF50;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.15);
}

/* ========================= */
/* INFO CARD ICON STYLE */
/* ========================= */

.info-card i {
  margin-right: 8px;
  color: #f1c40f;   /* gold */
}

/* NAME ICON BIGGER */
.info-card h3 i {
  font-size: 16px;
  color: #2ecc71;
}

/* ALIGN TEXT + ICON */
.info-card p {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* FIX ALIGNMENT (important) */
.info-card p i {
  width: 16px;
}

#toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #222;
  color: white;
  padding: 14px 18px;
  border-radius: 10px;
  z-index: 999999;
  display: none;
  font-size: 14px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.25);
}

/* =========================
   DELETED ROW
========================= */

.deleted-row {

  opacity: 0.55;

  filter: blur(1px);

  background: #ffe5e5 !important;

  pointer-events: none;

  user-select: none;
}

.deleted-row td {

  color: #dc2626 !important;
}

/* ==========================================================================
   MOBILE & RESPONSIVE TRADER & MILL PAGE OVERRIDES (<= 768px)
   ========================================================================== */

@media (max-width: 768px) {
  .deal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .deal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .deal-actions .btn {
    flex-grow: 1;
    text-align: center;
    padding: 10px;
  }

  /* Toolbar Stack overrides */
  .deal-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 8px 0;
  }

  .toolbar-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .toolbar-left .tool-btn {
    flex-grow: 1;
    justify-content: center;
    padding: 10px;
  }

  .toolbar-right {
    position: static;
    transform: none;
    width: 100%;
  }

  .tool-search {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
  }

  /* Modals scaling */
  .modal {
    padding: 12px;
  }

  .modal-content,
  .modal-content.large {
    width: 94%;
    max-width: 440px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  }

  .modal-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
  }

  .modal-actions button,
  .modal-actions .btn {
    flex-grow: 1;
    text-align: center;
    padding: 12px;
  }

  /* Info cards stacking */
  .info-card {
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .info-card h3 {
    font-size: 16px;
  }

  .info-card p {
    font-size: 12px;
  }

  /* Scrollable Table Card panel */
  .table-card {
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: none;
    max-height: 60vh;
  }

  #traderTable {
    min-width: 800px;
  }

  #millTable {
    min-width: 1100px;
  }

  #traderTable th, #millTable th {
    padding: 8px;
    font-size: 12px;
  }

  #traderTable td, #millTable td {
    padding: 7px;
    font-size: 12px;
  }
}