/* Pro Workspace Styles */
/* Extends design-system.css */

/* ============================================
   Layout
   ============================================ */

.pro-workspace {
  min-height: 100vh;
  padding-top: 72px;
  background: var(--surface-sunken);
}

/* ============================================
   Page Header
   ============================================ */

.pro-header {
  background: white;
  border-bottom: 1px solid var(--color-neutral-200);
  padding: var(--space-8) 0;
}

.pro-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.pro-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-neutral-900);
  margin: 0 0 var(--space-1) 0;
}

.pro-subtitle {
  font-size: var(--text-base);
  color: var(--color-neutral-500);
  margin: 0;
}

.btn-accent {
  background: #e76f51;
  color: white;
  border: none;
}

.btn-accent:hover {
  background: #d45a3c;
  color: white;
}

/* ============================================
   Boat Selector Section
   ============================================ */

.pro-selector-section {
  background: white;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-neutral-200);
}

.pro-selector-container {
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* ============================================
   Tab Navigation
   ============================================ */

.pro-tabs-section {
  background: white;
  padding: var(--space-4) 0;
  position: sticky;
  top: 72px;
  z-index: 100;
  border-bottom: 1px solid var(--color-neutral-200);
}

.pro-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pro-tabs::-webkit-scrollbar {
  display: none;
}

.pro-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: 1.5px solid var(--color-neutral-300);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-neutral-600);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.pro-tab:hover {
  background: var(--color-neutral-100);
  border-color: var(--color-neutral-400);
  color: var(--color-neutral-900);
}

.pro-tab.active {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
  color: white;
}

.pro-tab i {
  font-size: var(--text-base);
}

/* ============================================
   Tab Panels
   ============================================ */

.pro-panels-section {
  padding: var(--space-8) 0;
}

.pro-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.pro-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Metrics Grid (Valuation Tab)
   ============================================ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.metric-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

.metric-label {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
}

/* Metric Card Variants */
.metric-card.metric-primary {
  background: #e76f51;
  color: white;
}

.metric-card.metric-primary .metric-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.metric-card.metric-primary .metric-label {
  color: rgba(255, 255, 255, 0.8);
}

.metric-card.metric-neutral {
  background: #e6edf2;
  color: var(--color-neutral-900);
}

.metric-card.metric-neutral .metric-icon {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-neutral-700);
}

.metric-card.metric-neutral .metric-label {
  color: var(--color-neutral-600);
}

.metric-card.metric-success {
  background: #2a9d8f;
  color: white;
}

.metric-card.metric-success .metric-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.metric-card.metric-success .metric-label {
  color: rgba(255, 255, 255, 0.8);
}

.metric-card.metric-dark {
  background: #003049;
  color: white;
}

.metric-card.metric-dark .metric-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.metric-card.metric-dark .metric-label {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Comps Card & Table
   ============================================ */

.comps-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.comps-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) var(--space-6);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--color-neutral-200);
}

.comps-card-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
  color: var(--color-neutral-900);
}

.comps-count {
  font-size: var(--text-sm);
  color: var(--color-neutral-500);
  background: var(--color-neutral-200);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.comps-card-body {
  padding: 0;
}

.comps-table {
  width: 100%;
  border-collapse: collapse;
}

.comps-table th,
.comps-table td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--color-neutral-200);
}

.comps-table th {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface-sunken);
}

.comps-table td {
  font-size: var(--text-sm);
  color: var(--color-neutral-700);
}

.comps-table tbody tr:hover {
  background: var(--color-neutral-50);
}

.comps-table tbody tr:last-child td {
  border-bottom: none;
}

.comps-table a {
  color: var(--color-primary-500);
  text-decoration: none;
  font-weight: 500;
}

.comps-table a:hover {
  text-decoration: underline;
}

/* ============================================
   Comps Filters
   ============================================ */

.comps-filters {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 120px;
}

.filter-group.filter-action {
  flex: 0 0 auto;
  min-width: auto;
}

.filter-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-neutral-600);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-input,
.filter-select {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: white;
  color: var(--color-neutral-900);
  transition: all var(--transition-fast);
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px var(--color-primary-100);
}

/* ============================================
   Charts Grid (Trends Tab)
   ============================================ */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.chart-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chart-card.chart-card-full {
  grid-column: span 2;
}

.chart-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-neutral-200);
}

.chart-header h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
  color: var(--color-neutral-900);
}

.chart-body {
  padding: var(--space-5);
  height: 300px;
}

.chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ============================================
   Map (Regional Prices Tab)
   ============================================ */

.map-container {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.pro-map {
  width: 100%;
  height: 600px;
}

/* Leaflet legend styling */
.price-legend {
  background: white !important;
  padding: var(--space-3) var(--space-4) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
}

.price-legend div {
  margin-bottom: var(--space-1);
}

/* ============================================
   Empty State
   ============================================ */

.pro-empty-state {
  padding: var(--space-16) 0;
}

.empty-content {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  background: var(--color-primary-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-500);
  font-size: var(--text-3xl);
}

.empty-content h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-neutral-900);
}

.empty-content p {
  color: var(--color-neutral-500);
  margin: 0;
}

/* ============================================
   Loading State
   ============================================ */

.pro-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-neutral-200);
  border-top-color: var(--color-primary-500);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Footer
   ============================================ */

.pro-workspace + .footer-modern {
  margin-top: auto;
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  color: var(--color-neutral-400);
  text-decoration: none;
  font-size: var(--text-sm);
}

.footer-links a:hover {
  color: white;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .chart-card.chart-card-full {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .pro-workspace {
    padding-top: 64px;
  }

  .pro-tabs-section {
    top: 64px;
  }

  .pro-header {
    padding: var(--space-6) 0;
  }

  .pro-title {
    font-size: var(--text-2xl);
  }

  .pro-tab span {
    display: none;
  }

  .pro-tab {
    padding: var(--space-3);
    border-radius: var(--radius-md);
  }

  .pro-tab i {
    font-size: var(--text-lg);
    margin: 0;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .metric-card {
    padding: var(--space-4);
  }

  .metric-value {
    font-size: var(--text-xl);
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .pro-map {
    height: 400px;
  }

  .comps-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

@media (max-width: 480px) {
  .pro-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .pro-header-content .btn {
    width: 100%;
    justify-content: center;
  }

  .pro-selector-container {
    padding: var(--space-4);
  }

  .pro-panels-section {
    padding: var(--space-4) 0;
  }

  .chart-body {
    height: 250px;
    padding: var(--space-3);
  }

  .pro-map {
    height: 300px;
  }
}

/* ============================================
   Mobile Menu (extends design-system.css)
   ============================================ */

.mobile-menu-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-neutral-600);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-12);
}

.mobile-nav-link {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-neutral-700);
  text-decoration: none;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-neutral-200);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--color-primary-600);
}
