/* --- Global Styles --- */
* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #f9d5d5, #fbeaea);
  color: #111;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Links */
a {
  color: #b00020;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ff1744;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
  width: 100%;
}

/* Topbar */
.topbar {
  background: #111;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid #b00020;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.topbar .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: white;
  font-size: 18px;
}

.topbar .logo img {
  height: 32px;
}

/* Navigation */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

nav a {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 8px 14px;
  border-radius: 10px;
  background: white;
  border: 1px solid #b00020;
  color: #b00020;
  font-weight: 500;
  text-align: center;
}

nav a.primary {
  background: #b00020;
  color: white;
}

nav a.danger {
  background: #ff1744;
  color: white;
}

nav a:hover {
  opacity: 0.85;
}

/* Grid & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  justify-items: center;
}

.card {
  background: white;
  border: 1px solid #f0c0c0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  width: 100%;
  max-width: 350px;
  box-sizing: border-box;
}

.card:hover {
  transform: translateY(-3px);
}

/* Dashboard Card */
.dashboard-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 350px;
  box-sizing: border-box;
}

/* USDT Balance Box */
.balance-box {
  background: #ffe6e6;
  border-radius: 10px;
  padding: 10px;
  font-weight: bold;
  font-size: 15px;
  color: #b00020;
  text-align: center;
  margin-bottom: 12px;
}

/* Buttons container */
.button-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.button-box .btn {
  display: block;
  width: 100%;
  max-width: 100%;
  background: #ff6f6f;
  color: white;
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.button-box .btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Generic Buttons */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.1s ease;
  text-align: center;
  min-width: 90px;
}

.btn.small {
  padding: 4px 8px;
  font-size: 12px;
}

.btn.danger {
  background: #ff1744;
  color: white;
}

.btn:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

/* Alerts */
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 500;
}

.alert.success {
  background: #e6ffed;
  color: #1b5e20;
}

.alert.danger {
  background: #ffe6e6;
  color: #b00020;
}

/* --- Recent Orders Table Fix --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;  /* ✅ Allow horizontal scroll */
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  min-width: 600px;   /* ✅ Force enough width for all columns */
  max-width: 100%;    /* ✅ No fixed 500px */
}

table th, table td {
  padding: 14px 10px;
  font-size: 14px;
  border-bottom: 1px solid #f0c0c0;
}

table th {
  background: #ffe6e6;
  font-weight: bold;
  color: #b00020;
}

/* ✅ Seller Column - Give more room and wrap */
table td:nth-child(2), 
table th:nth-child(2) {
  min-width: 200px;
  max-width: 250px;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  font-weight: 500;
}

/* Keep numeric columns compact */
table td:nth-child(3), /* USDT */
table td:nth-child(4), /* INR */
table td:nth-child(5), /* Status */
table td:nth-child(6), /* Action */
table th:nth-child(3),
table th:nth-child(4),
table th:nth-child(5),
table th:nth-child(6) {
  min-width: 80px;
  text-align: center;
}

table tr:nth-child(even) {
  background: #fff6f6;
}

table tr:hover {
  background: #fdeaea;
}

/* Status Badges */
.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.status.confirmed {
  background: #e6ffed;
  color: #1b5e20;
}

.status.pending {
  background: #fff3cd;
  color: #856404;
}

.status.cancelled {
  background: #ffe6e6;
  color: #b00020;
}

/* Forms */
label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

input, select {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #f0c0c0;
  background: #fff6f6;
  color: #111;
}

.copyrow {
  display: flex;
  gap: 8px;
}

.copyrow input {
  flex: 1;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  color: #555;
}

/* Timer */
.timer {
  margin-top: 10px;
  font-weight: 600;
  color: #b00020;
}

/* Chatbox */
.chatbox {
  height: 240px;
  overflow: auto;
  border: 1px solid #f0c0c0;
  border-radius: 12px;
  padding: 8px;
  background: #fff6f6;
}

.msg {
  margin-bottom: 6px;
}

/* Login Page Styling */
body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.login-page main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.login-form-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-form {
  width: 100%;
  box-sizing: border-box;
  padding: 25px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}


/* Round SELL USDT button */
.btn.primary {
  background: linear-gradient(135deg, #ff4b4b, #ff6f6f);
  color: white;
  padding: 14px 20px;
  border-radius: 50px;   /* pill / round style */
  font-weight: 700;
  font-size: 16px;
  display: block;
  text-align: center;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

.btn.primary:hover {
  opacity: 0.95;
  transform: scale(1.03);
}

/* Verified Tick Badge */
.verify-badge {
  display: inline-block;
  margin-left: 6px;
  color: #1da1f2; /* Twitter blue style */
  font-size: 16px;
  font-weight: bold;
  vertical-align: middle;
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Verified Badge */
.verify-badge {
  display: inline-block;
  background: #1da1f2;   /* Blue badge like Twitter */
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 4px;
}

/* Not Verified */
.not-verified {
  display: inline-block;
  background: #ffcccc;
  color: #b00020;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 4px;
}

.pay-method {
  display: inline-flex;
  align-items: center;
  background: #ffe6e6;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  margin: 3px 6px;
  color: #b00020;
}

.pay-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
}

/* Info Banner on Login Page */
.info-banner {
  background: #ffe6e6;
  border: 1px solid #f0c0c0;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  margin: 20px auto;
  max-width: 500px;
  font-size: 15px;
  font-weight: 600;
  color: #b00020;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.info-banner p {
  margin: 5px 0;
}

.payment-icons {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.payment-icons span {
  display: inline-flex;
  align-items: center;
  background: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  color: #b00020;
  border: 1px solid #f0c0c0;
}

.pay-icon {
  width: 20px;
  height: 20px;
  margin-right: 6px;
}

/* Login Page Fullscreen Fix */
body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.login-page main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* keeps banner on top */
  padding: 20px 10px;
}

/* Banner */
.info-banner {
  width: 100%;
  max-width: 600px;
  margin-bottom: 20px;
}

/* Login Container */
.login-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.login-form {
  width: 100%;
  max-width: 400px; /* PC */
  padding: 25px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin: 0 auto;
}


/* Admin Panel Buttons */
.admin-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
}

.admin-buttons .btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 50px; /* pill shape */
  background: linear-gradient(135deg, #ff4b4b, #ff6f6f);
  color: #fff;
  font-weight: 600;
  text-align: center;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.admin-buttons .btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}


/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 16px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.table-responsive table {
  width: 100%;
  min-width: 700px; /* keeps structure, scrolls on mobile */
  border-collapse: collapse;
}

.table-responsive th,
.table-responsive td {
  padding: 12px 10px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid #f0c0c0;
}

.table-responsive th {
  background: #ffe6e6;
  font-weight: bold;
  color: #b00020;
}

.table-responsive tr:nth-child(even) {
  background: #fff6f6;
}

.table-responsive tr:hover {
  background: #fdeaea;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 16px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Table Styling */
.table-responsive table {
  width: 100%;
  min-width: 700px; /* Forces horizontal scroll on small screens */
  border-collapse: collapse;
}

.table-responsive th,
.table-responsive td {
  padding: 12px 10px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid #f0c0c0;
  white-space: nowrap; /* Prevents line breaks */
}

.table-responsive th {
  background: #ffe6e6;
  font-weight: bold;
  color: #b00020;
}

.table-responsive tr:nth-child(even) {
  background: #fff6f6;
}

.table-responsive tr:hover {
  background: #fdeaea;
}

/* Truncate long text like TX Hash */
.truncate {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 16px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.table-responsive table {
  width: 100%;
  min-width: 800px; /* ensures scroll on small screens */
  border-collapse: collapse;
}

.table-responsive th,
.table-responsive td {
  padding: 10px 8px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid #f0c0c0;
  white-space: nowrap;
}

.table-responsive th {
  background: #ffe6e6;
  color: #b00020;
  font-weight: bold;
}

.table-responsive tr:nth-child(even) {
  background: #fff6f6;
}

.table-responsive tr:hover {
  background: #fdeaea;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.table-responsive table {
  width: 100%;
  min-width: 600px; /* ensures scroll on small screens */
  border-collapse: collapse;
}

.table-responsive th,
.table-responsive td {
  padding: 10px 8px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid #f0c0c0;
  white-space: nowrap;
}

.table-responsive th {
  background: #ffe6e6;
  color: #b00020;
  font-weight: bold;
}

.table-responsive tr:nth-child(even) {
  background: #fff6f6;
}

.table-responsive tr:hover {
  background: #fdeaea;
}

/* Optional: truncate long TX hash with ellipsis */
.truncate {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  .login-form {
    max-width: 90%;   /* 90% screen width on mobile */
    border-radius: 12px;
    padding: 20px;
  }
}

@media (max-width: 600px) {
  body.login-page main {
    padding: 20px;
  }
  .login-form {
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .login-form-container {
      padding: 0;
  }
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
    margin: 0;
    padding: 12px;
  }

  .card, .dashboard-card {
    border-radius: 12px;
    box-shadow: none;
    max-width: none;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  nav a {
    flex: 1 1 calc(50% - 10px);
    font-size: 14px;
    padding: 8px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
    justify-items: center;
  }

  .card {
    padding: 12px;
  }

  .button-box .btn {
    width: 100%;
    max-width: none;
    font-size: 16px;
  }

  .table-responsive table {
    min-width: 550px;  /* ✅ Allow scroll instead of cutting */
  }

  table td:nth-child(2),
  table th:nth-child(2) {
    min-width: 220px;  /* ✅ Extra space for Seller */
  }
}

/* Additions/Fixes for Centering: */
.grid {
  justify-items: center;
}

.dashboard-card, .card {
    max-width: 350px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.button-box {
  align-items: center;
}

.tradingview-widget-container {
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 992px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-card {
      max-width: none;
  }
}
