/* B2B Lead Sales - Frontend Styles */

/* Container */
.b2b-marketplace-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  font-family: Arial, sans-serif;
}

/* Header */
.b2b-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.b2b-header h1 {
  margin: 0;
  font-size: 28px;
  color: #333;
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

/* Wallet */
.b2b-wallet {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0f2f5;
  padding: 10px 20px;
  border-radius: 6px;
}

.wallet-label {
  font-size: 14px;
  color: #666;
}

.wallet-amount {
  font-size: 20px;
  font-weight: bold;
  color: #188038;
}

.btn-topup {
  background: #0073aa;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-topup:hover {
  background: #005a87;
}

.btn-my-leads {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #28a745;
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-my-leads:hover {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.btn-my-leads .icon {
  font-size: 16px;
}

.btn-back {
  background: #666;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-back:hover {
  background: #444;
}

/* Filters */
.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  min-width: 180px;
  cursor: pointer;
}

.btn-filter,
.btn-reset {
  padding: 10px 20px !important;
  border: none !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: background 0.3s !important;
}

.btn-filter {
  background: #0073aa !important;
  color: #fff !important;
}

.btn-filter:hover {
  background: #005a87 !important;
}

.btn-reset {
  background: #f0f2f5 !important;
  color: #333 !important;
}

.btn-reset:hover {
  background: #e0e2e5 !important;
}

/* Table & Grid Layouts */
.table-responsive {
  overflow-x: auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th,
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
  font-size: 14px;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

/* Leads Grid Redesign */
.b2b-leads-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 25px;
  margin-top: 20px;
}

@media (min-width: 768px) {
  .b2b-leads-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .b2b-leads-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Lead Card Design */
.lead-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #eee;
}

.lead-card:hover {
  border-color: #0073aa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lead-card.lead-closed {
  background: #f8f9fa;
  filter: grayscale(0.7);
  opacity: 0.7;
}

/* Card Status Badge */
.card-status-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
}

/* Card Header */
.card-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: #fcfcfc;
  border-bottom: 1px solid #f5f5f5;
  position: relative;
}

.lead-id-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #0073aa;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.customer-avatar {
  width: 50px;
  height: 50px;
  background: #f0f4f8;
  color: #0073aa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid #0073aa;
}

.customer-info h3 {
  margin: 0;
  font-size: 17px;
  color: #333;
  font-weight: 700;
}

.lead-time {
  font-size: 12px;
  color: #999;
  display: block;
  margin-top: 2px;
}

/* Card Body */
.card-body {
  padding: 20px;
  flex-grow: 1;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.info-item .icon {
  font-size: 16px;
}

.info-item .label {
  font-size: 13px;
  color: #777;
  font-weight: 500;
  width: 70px;
}

.info-item .value {
  font-size: 14px;
  color: #333;
  font-weight: 600;
}

.info-item .value.masked {
  font-family: monospace;
  color: #aaa;
}

/* Progress Section */
.sold-status {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: #28a745;
}

.sold-text {
  font-size: 11px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Footer */
.card-footer {
  padding: 15px 20px;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #eee;
  gap: 15px;
}

.price-tag {
  display: flex;
  flex-direction: column;
}

.price-tag .amount {
  font-size: 22px;
  font-weight: 700;
  color: #188038;
}

.price-tag .currency {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  font-weight: 700;
}

/* Buy Button Simplified */
.buy-btn {
  background: #0073aa !important;
  color: #fff !important;
  padding: 12px 20px !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  transition: background 0.2s !important;
  flex-grow: 1 !important;
  text-align: center !important;
  display: inline-block !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  text-transform: none !important;
  font-family: Arial, sans-serif !important;
  letter-spacing: normal !important;
  margin: 0 !important;
}

.buy-btn:hover:not(:disabled) {
  background: #005a87 !important;
  color: #fff !important;
}

.buy-btn:disabled {
  background: #ddd !important;
  color: #888 !important;
  cursor: not-allowed !important;
}

.btn-login-link {
  text-decoration: none;
}

/* Badges Simplified */
.urgency-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.urgency-badge.urgent-high {
  background: #d93025;
}

.urgency-badge.urgent-medium {
  background: #e67e22;
}

.urgency-badge.urgent-normal {
  background: #f1c40f;
  color: #333;
}

/* Modal */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-large {
  max-width: 800px;
}

.modal .close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.modal .close:hover {
  color: #000;
}

.modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.btn-submit {
  background: #0073aa;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: #005a87;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .b2b-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .b2b-header h1 {
    font-size: 22px;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .b2b-wallet {
    width: 100%;
    justify-content: space-between;
  }

  .btn-my-leads {
    width: 100%;
    justify-content: center;
  }

  .filters {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }

  .btn-filter,
  .btn-reset {
    width: 100%;
  }

  /* Mobile Card Layout */
  .table,
  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tr {
    border: 1px solid #ddd;
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
  }

  .table td {
    border: none;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    min-width: 100px;
  }

  .table td:last-child {
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
  }

  .buy-btn {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .b2b-marketplace-container {
    padding: 0 10px;
    margin: 20px auto;
  }

  .b2b-header h1 {
    font-size: 20px;
  }

  .wallet-amount {
    font-size: 18px;
  }

  .table {
    font-size: 12px;
  }

  .buy-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}