/* ============================================
   TENDERS VIEW - RESPONSIVE LAYOUT
   ============================================ */

/* Mobile Layout (default) - Vertical Stack */
#tenders-view .view-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px;
  max-width: var(--view-max-width);
  margin: 0 auto;
}

#tenders-view .tenders-main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

#tenders-view .section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Glass Panel for sections (matching Overview) */
.tenders-list-section {
  background: var(--modern-card-background);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .tenders-list-section {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Tender Filter Pills */
.tender-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tender-filters::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--brokerly-border-medium);
  background: transparent;
  color: var(--brokerly-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  background: rgba(0, 0, 0, 0.02);
}

.filter-pill.active {
  background: var(--brokerly-primary);
  color: white;
  border-color: var(--brokerly-primary);
  box-shadow: 0 4px 12px var(--brokerly-primary-shadow);
}

.quick-stat-pill.clickable {
  cursor: pointer;
}

.quick-stat-pill.clickable:hover {
  transform: translateY(-2px);
  background: var(--modern-card-highlight);
  border-color: var(--brokerly-primary-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Modern Tender Rows (Substantial Height) */
.tenders-list-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tender-row {
  background: var(--brokerly-bg-secondary);
  border-radius: 20px;
  padding: 24px 28px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

[data-theme="dark"] .tender-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.tender-row:hover {
  transform: translateY(-3px);
  background: var(--modern-card-highlight);
  border-color: rgba(26, 127, 230, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.tender-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tender-left {
  flex: 1;
  min-width: 0;
}

.tender-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0 0 6px 0;
}

.tender-category {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brokerly-text-tertiary);
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.tender-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}

.tender-status-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tender-status {
  font-size: 11px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tender-status.active {
  background: rgba(26, 179, 89, 0.1);
  color: #1AB359;
  box-shadow: 0 0 10px rgba(26, 179, 89, 0.1);
  position: relative;
  padding-left: 24px;
}

.tender-status.active::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #1AB359;
  border-radius: 50%;
  animation: liveStatusPulse 2s infinite;
}

/* Timeline Customization */
.bids-timeline {
  position: relative;
  padding-left: 28px;
  margin-top: 24px;
}

.bids-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: linear-gradient(to bottom, var(--brokerly-primary) 0%, var(--brokerly-primary-light) 100%);
  border-radius: 2px;
  opacity: 0.8;
  box-shadow: 0 0 8px rgba(26, 127, 230, 0.2);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-marker {
  position: absolute;
  left: -33px;
  top: 14px;
  width: 14px;
  height: 14px;
  background: white;
  border: 3px solid var(--brokerly-primary);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 6px rgba(26, 127, 230, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:hover .timeline-marker {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(26, 127, 230, 0.2);
}

.timeline-item:first-child .timeline-marker {
  animation: bidPulse 2s infinite;
  background: var(--brokerly-primary);
  border-color: white;
}

@keyframes bidPulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 127, 230, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(26, 127, 230, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 127, 230, 0); }
}

@keyframes liveStatusPulse {
  0% { transform: translateY(-50%) scale(1); opacity: 1; }
  50% { transform: translateY(-50%) scale(2); opacity: 0; }
  100% { transform: translateY(-50%) scale(1); opacity: 0; }
}

.tender-status.completed { background: rgba(0, 122, 255, 0.1); color: #007AFF; }
.tender-status.draft { background: rgba(255, 167, 38, 0.1); color: #FFA726; }
.tender-status.cancelled { background: rgba(255, 111, 97, 0.1); color: #FF6F61; }

.tender-budget {
  font-size: 18px;
  font-weight: 800;
  color: var(--brokerly-text-primary);
}

.tender-row-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .tender-row-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.tender-stats {
  display: flex;
  gap: 24px;
}

.tender-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
}

.tender-stat svg {
  opacity: 0.7;
  color: var(--brokerly-primary);
}

.tender-view-button {
  background: var(--brokerly-bg-secondary);
  color: var(--brokerly-text-primary);
  border: 1px solid var(--brokerly-border-medium);
  padding: 8px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tender-view-button:hover {
  background: var(--brokerly-primary);
  color: white;
  border-color: var(--brokerly-primary);
}

/* Desktop Fixes for Rows */
@media (min-width: 768px) {
  #tenders-view .view-content {
    gap: 32px;
    padding: 32px;
  }

  .tenders-list-content {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .tender-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
    min-height: 100px;
    padding: 24px 32px;
  }

  .tender-row-header {
    flex: 1;
    margin-bottom: 0;
  }

  .tender-row-footer {
    border-top: none;
    padding-top: 0;
    margin-left: 24px;
    gap: 32px;
  }

  .tender-stats {
    margin-right: 24px;
  }
}