/**
 * Resource Coordination - Resource Hub Styles
 * Product: Virtual Village (resourceCoordinationEnabled: true)
 * Tabs: Equipment | Time Bank | Services
 */

/* Tab Bar */
.rc-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.5rem;
}

.rc-tab {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.rc-tab:hover {
  color: #3b82f6;
}

.rc-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* Resource Card (Equipment) */
.resource-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.resource-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.resource-card-image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.resource-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.resource-card-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* Condition Badge */
.condition-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.condition-badge.excellent {
  background: #d1fae5;
  color: #065f46;
}

.condition-badge.good {
  background: #dbeafe;
  color: #1e40af;
}

.condition-badge.fair {
  background: #fef3c7;
  color: #92400e;
}

.condition-badge.needs_repair {
  background: #fee2e2;
  color: #991b1b;
}

/* Category Badge */
.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f3f4f6;
  color: #374151;
}

/* Availability Badge */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.availability-badge.available {
  background: #d1fae5;
  color: #065f46;
}

.availability-badge.limited {
  background: #fef3c7;
  color: #92400e;
}

.availability-badge.unavailable {
  background: #fee2e2;
  color: #991b1b;
}

/* Time Bank Balance Card */
.timebank-balance-card {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
}

.timebank-balance-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.timebank-balance-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

.timebank-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.timebank-stat {
  text-align: center;
}

.timebank-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.timebank-stat-label {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Transaction Row */
.transaction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.transaction-row:hover {
  background: #f9fafb;
}

.transaction-row:last-child {
  border-bottom: none;
}

.transaction-info {
  flex: 1;
  min-width: 0;
}

.transaction-description {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.transaction-amount {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.transaction-amount.credit {
  color: #059669;
}

.transaction-amount.debit {
  color: #dc2626;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.confirmed,
.status-badge.approved,
.status-badge.active {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.returned {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.cancelled,
.status-badge.disputed {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.overdue {
  background: #fecaca;
  color: #7f1d1d;
}

/* Service Card */
.service-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
  transition: box-shadow 0.2s;
}

.service-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.service-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.service-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.service-card-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-provider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #374151;
}

/* Exchange Type Badge */
.exchange-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.exchange-badge.time_bank {
  background: #ede9fe;
  color: #5b21b6;
}

.exchange-badge.free {
  background: #d1fae5;
  color: #065f46;
}

.exchange-badge.negotiable {
  background: #fef3c7;
  color: #92400e;
}

/* Modal Overlay */
.rc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.rc-modal {
  background: white;
  border-radius: 0.75rem;
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.rc-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.rc-modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.rc-modal-body {
  padding: 1.5rem;
}

.rc-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Grid Layouts */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Empty State */
.rc-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.rc-empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.rc-empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Community Stats Card */
.community-stats-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.community-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.community-stat {
  text-align: center;
}

.community-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

.community-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 640px) {
  .rc-tab-bar {
    overflow-x: auto;
  }

  .rc-tab {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .timebank-balance-value {
    font-size: 2rem;
  }

  .timebank-stats {
    flex-direction: column;
    gap: 0.75rem;
  }
}
