/* assets/css/frontend-style.css */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Roboto:wght@400;500;600;700&display=swap');

/* ===== GLOBAL BUTTON STYLES ===== */
button,
.button-primary,
.button-secondary,
input[type="submit"],
input[type="button"] {
  font-family: 'Instrument Sans', sans-serif !important;
}

/* ===== SEARCH PAGE ===== */
#tahn-search {
  max-width: 100%;
}

.tahn-search-top {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #E3D4FF;
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.tahn-search-top input,
.tahn-search-top select,
.tahn-search-top button {
  padding: 0.75rem 1rem;
  border: 1px solid #E3D4FF;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s;
}

.tahn-search-top input:focus,
.tahn-search-top select:focus {
  outline: none;
  border-color: #6C3DF4;
  box-shadow: 0 0 0 3px rgba(108, 61, 244, 0.1);
}

.tahn-search-top button {
  background: #6C3DF4;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.tahn-search-top button:hover {
  background: #5028D0;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.tahn-search-top button:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}

.tahn-search-top #tahn-adv-toggle {
  background: #fff;
  color: #6C3DF4;
  border: 1px solid #6C3DF4;
}

.tahn-search-top #tahn-adv-toggle:hover {
  background: #E7DDFF;
}

.tahn-status-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #E3D4FF;
}

.tahn-status-filter button {
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #E3D4FF;
  border-radius: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tahn-status-filter button:hover {
  background: #F9FAFB;
  border-color: #6C3DF4;
}

.tahn-status-filter button.active {
  background: #6C3DF4;
  color: #fff;
  border-color: #6C3DF4;
}

#tahn-adv {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #F9FAFB;
  border: 1px solid #E3D4FF;
  border-radius: 8px;
}

.tahn-search-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .tahn-search-grid {
    grid-template-columns: 1fr;
  }
}

#tahn-results {
  background: #fff;
  border: 1px solid #E3D4FF;
  border-radius: 12px;
  padding: 1rem;
  min-height: 400px;
}

#tahn-map {
  background: #F3F4F6;
  border: 1px solid #E3D4FF;
  border-radius: 12px;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
}

.search-notice {
  padding: 1.5rem;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  color: #92400E;
}

.search-notice p {
  margin: 0 0 0.75rem;
}

.search-notice ul {
  margin: 0;
  padding-left: 1.5rem;
}

.deals-list {
  display: grid;
  gap: 1rem;
}

.deal-card {
  padding: 1.25rem;
  border: 1px solid #E3D4FF;
  border-radius: 8px;
  transition: all 0.2s;
}

.deal-card:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  border-color: #6C3DF4;
}

.deal-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: #111827;
}

.deal-location,
.deal-price,
.deal-type {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: #6B7280;
}

.deal-price {
  font-weight: 600;
  color: #6C3DF4;
  font-size: 1rem;
}

.deal-link {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: #6C3DF4;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}

.deal-link:hover {
  background: #5028D0;
}

/* ===== BID MANAGER ===== */
.tahn-bid {
  border: 1px solid #E3D4FF;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: #fff;
  transition: all 0.2s;
}

.tahn-bid:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* New 1/2 + 1/4 + 1/4 Layout */
.bid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Left Column (1/2) - Bid Info */
.bid-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bid-deal-title {
  margin: 0 0 0.75rem 0;
  font-weight: 700;
  font-size: 1.25rem;
  color: #111827;
  line-height: 1.3;
}

.bid-detail-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #F3F4F6;
}

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

.bid-detail-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6B7280;
  min-width: 140px;
}

.bid-detail-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  flex: 1;
}

.bid-status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: capitalize;
}

.bid-status-badge.status-sealed-bids {
  background: #DBEAFE;
  color: #1E40AF;
}

.bid-status-badge.status-bids-with-counter-offers {
  background: #FEF3C7;
  color: #92400E;
}

.bid-status-badge.status-accepted {
  background: #D1FAE5;
  color: #065F46;
}

.bid-status-badge.status-heads-of-terms-agreed,
.bid-status-badge.status-hot-agreed {
  background: #E0E7FF;
  color: #3730A3;
}

.bid-status-badge.status-exchanged {
  background: #D1FAE5;
  color: #047857;
}

.bid-status-badge.status-completed {
  background: #CCFBF1;
  color: #115E59;
}

.bid-status-badge.status-rejected {
  background: #FEE2E2;
  color: #991B1B;
}

/* Middle Column (1/4) - Timestamps */
.bid-timestamps {
  padding: 1rem;
  background: #F9FAFB;
  border-radius: 8px;
  min-height: 100px;
}

.timestamp-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #E5E7EB;
}

.timestamp-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timestamp-item:first-child {
  padding-top: 0;
}

.timestamp-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timestamp-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111827;
}

.timestamp-item em {
  font-size: 0.8125rem;
  color: #9CA3AF;
}

/* Right Column (1/4) - Actions */
.bid-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bid-actions button {
  padding: 0.625rem 1rem;
  border: 1px solid #E3D4FF;
  border-radius: 6px;
  background: #fff;
  color: #6C3DF4;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.bid-actions button:hover {
  background: #E7DDFF;
  border-color: #6C3DF4;
  transform: translateY(-1px);
}

/* Responsive Layout */
@media (max-width: 1024px) {
  .bid-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .bid-timestamps {
    order: 2;
  }
  
  .bid-actions {
    order: 3;
  }
}

/* Legacy styles for backward compatibility */
.tahn-bid header h4 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1.125rem;
  color: #111827;
}

.tahn-bid .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.tahn-bid .grid > div {
  padding: 0.75rem;
  background: #F9FAFB;
  border-radius: 6px;
}

.tahn-bid .grid label {
  display: block;
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tahn-bid .grid span {
  display: block;
  font-weight: 600;
  color: #111827;
}

.tahn-bid .actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #E3D4FF;
}

.tahn-bid .actions button,
.tahn-bid .actions a {
  padding: 0.5rem 1rem;
  border: 1px solid #E3D4FF;
  border-radius: 6px;
  background: #fff;
  color: #6C3DF4;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tahn-bid .actions button:hover,
.tahn-bid .actions a:hover {
  background: #E7DDFF;
  border-color: #6C3DF4;
}

.tahn-bid .actions button.primary {
  background: #6C3DF4;
  color: #fff;
  border-color: #6C3DF4;
}

.tahn-bid .actions button.primary:hover {
  background: #5028D0;
}

/* Developer Bid Filters */
.sealed-dev-bid-filter-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.sealed-dev-bid-filter,
.sealed-dev-bid-filter-total {
  border: 1px solid #E3D4FF;
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.sealed-dev-bid-filter:hover {
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.1);
}

.sealed-dev-bid-filter.active {
  outline: 2px solid #6C3DF4;
  outline-offset: -2px;
  background: #F5F3FF;
}

.sealed-dev-bid-filter-total {
  background: linear-gradient(135deg, #6C3DF4 0%, #5028D0 100%);
  color: #fff;
  cursor: default;
}

.sealed-dev-bid-filter-content,
.sealed-dev-bid-filter-content-total {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sealed-dev-bid-filter-content p,
.sealed-dev-bid-filter-content-total p {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6B7280;
}

.sealed-dev-bid-filter-total p {
  color: rgba(255, 255, 255, 0.9);
}

.sealed-bid-dev-filter-quantity,
.sealed-bid-dev-total-quantity {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
}

.bid-bulk-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #F9FAFB;
  border: 1px solid #E3D4FF;
  border-radius: 8px;
}

#search-bids,
#search-dev-bids {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #E3D4FF;
  border-radius: 8px;
  font-size: 0.875rem;
}

#search-bids:focus,
#search-dev-bids:focus {
  outline: none;
  border-color: #6C3DF4;
  box-shadow: 0 0 0 3px rgba(108, 61, 244, 0.1);
}

/* ===== MESSENGER ===== */
#tahn-messenger {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid #E3D4FF;
  border-radius: 12px;
  overflow: hidden;
  min-height: 600px;
}

#tahn-msg-sidebar {
  background: #F9FAFB;
  border-right: 1px solid #E3D4FF;
  overflow-y: auto;
}

.tahn-msg-filter {
  padding: 1rem;
  border-bottom: 1px solid #E3D4FF;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tahn-msg-filter button {
  padding: 0.5rem 1rem;
  border: 1px solid #E3D4FF;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tahn-msg-filter button:hover {
  background: #F9FAFB;
  border-color: #6C3DF4;
}

.tahn-msg-filter button.active {
  background: #6C3DF4;
  color: #fff;
  border-color: #6C3DF4;
}

#tahn-msg-search {
  padding: 0.5rem 0.75rem;
  border: 1px solid #E3D4FF;
  border-radius: 6px;
  font-size: 0.875rem;
}

#tahn-threads {
  list-style: none;
  margin: 0;
  padding: 0;
}

#tahn-msg-panel {
  display: flex;
  flex-direction: column;
}

.tahn-msg-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E3D4FF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tahn-msg-header button {
  padding: 0.5rem 1rem;
  border: 1px solid #E3D4FF;
  border-radius: 6px;
  background: #fff;
  color: #6C3DF4;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tahn-msg-header button:hover {
  background: #E7DDFF;
  border-color: #6C3DF4;
}

#tahn-msg-window {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.tahn-msg-compose {
  padding: 1rem 1.5rem;
  border-top: 1px solid #E3D4FF;
}

#tahn-send-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

#tahn-send-form button {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#tahn-attach-btn {
  background: #fff;
  color: #6C3DF4;
  border: 1px solid #E3D4FF !important;
}

#tahn-attach-btn:hover {
  background: #F9FAFB;
  border-color: #6C3DF4 !important;
}

#tahn-send-btn {
  background: #6C3DF4;
  color: #fff;
}

#tahn-send-btn:hover {
  background: #5028D0;
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.1);
}

#tahn-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #E3D4FF;
  border-radius: 8px;
  resize: vertical;
  min-height: 60px;
  font-family: 'Roboto', sans-serif;
}

/* Messenger thread list items */
.tahn-thread-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E3D4FF;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.tahn-thread-item:hover {
  background: #F9FAFB;
}

.tahn-thread-item.active {
  background: #E7DDFF;
}

.tahn-thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6C3DF4 0%, #5028D0 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.tahn-thread-content {
  flex: 1;
  min-width: 0;
}

.tahn-thread-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #111827;
  margin-bottom: 0.25rem;
}

.tahn-thread-preview {
  font-size: 0.8125rem;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tahn-thread-badge {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: #DC2626;
  color: #fff;
  border-radius: 10px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Messenger messages */
.tahn-message {
  margin-bottom: 1rem;
  display: flex;
}

.tahn-message-own {
  justify-content: flex-end;
}

.tahn-message-other {
  justify-content: flex-start;
}

.tahn-message-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
}

.tahn-message-own .tahn-message-bubble {
  background: #6C3DF4;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.tahn-message-other .tahn-message-bubble {
  background: #F3F4F6;
  color: #111827;
  border-bottom-left-radius: 4px;
}

.tahn-message-content {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
}

.tahn-message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: right;
}

/* ===== BID COMPARISON MODAL ===== */
.bid-comparison-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.bid-comparison-modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ===== MODAL STYLES ===== */
.tahn-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tahn-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.tahn-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.tahn-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 5px 10px;
  transition: color 0.2s;
}

.tahn-modal-close:hover {
  color: #1f2937;
}

.tahn-modal h2 {
  margin: 0 0 20px 0;
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

.tahn-modal .form-group {
  margin-bottom: 20px;
}

.tahn-modal .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.tahn-modal .form-group input,
.tahn-modal .form-group textarea,
.tahn-modal .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
}

.tahn-modal .form-group input:focus,
.tahn-modal .form-group textarea:focus,
.tahn-modal .form-group select:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.tahn-modal .form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.tahn-modal .form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
}

.tahn-modal .button-primary,
.tahn-modal .button-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tahn-modal .button-primary {
  background: #7c3aed;
  color: #fff;
}

.tahn-modal .button-primary:hover {
  background: #6d28d9;
}

.tahn-modal .button-secondary {
  background: #e5e7eb;
  color: #374151;
}

.tahn-modal .button-secondary:hover {
  background: #d1d5db;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .tahn-search-grid {
    grid-template-columns: 1fr;
  }

  #tahn-messenger {
    grid-template-columns: 1fr;
  }

  .tahn-bid .grid {
    grid-template-columns: 1fr;
  }

  .sealed-dev-bid-filter-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }

  .tahn-modal-content {
    padding: 20px;
  }

  .tahn-modal .form-actions {
    flex-direction: column;
  }

  .tahn-modal .form-actions button {
    width: 100%;
  }
}
