/* static/css/components/dashboard.css */
/* Dashboard Component Styles */

.dashboard {
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Dashboard Header */
.dashboard-header {
  background: #090E2F;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dashboard-header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(8px, 2vw, 12px) clamp(12px, 4vw, 16px);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.dashboard-header__logo {
  color: var(--text-primary);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  text-decoration: none;
}

.dashboard-header__actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
}

/* Search */
.dashboard-header__search {
  position: relative;
}

.dashboard-header__search-btn {
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.dashboard-header__search-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dashboard-header__search-input {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-base);
}

.dashboard-header__search-input.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dashboard-header__search-input input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  outline: none;
}

.dashboard-header__search-input input::placeholder {
  color: var(--text-muted);
}

/* Settings and Notifications */
.dashboard-header__settings,
.dashboard-header__notifications {
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.dashboard-header__settings:hover,
.dashboard-header__notifications:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* User Avatar */
.dashboard-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
}

.dashboard-header__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-header__avatar-placeholder {
  width: 100%;
  height: 100%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

/* Dashboard Container */
.dashboard__container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 116px);
}

/* Empty States */
.dashboard__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: var(--space-8);
}

.dashboard__empty-icon {
  margin-bottom: var(--space-6);
}

.dashboard__empty-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.dashboard__empty-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 600px;
}

.dashboard__empty-cta {
  min-width: 200px;
}

/* Welcome Section */
.dashboard__welcome {
  padding: clamp(16px, 4vw, 32px) 0;
}

.dashboard__welcome-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}

.dashboard__welcome-title {
  font-family: Inter, sans-serif;
  font-size: clamp(18px, 4vw, 20px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.dashboard__welcome-subtitle {
  font-family: Manrope, sans-serif;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.dashboard__welcome-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.dashboard__action-btn {
  height: 40px;
  min-width: 84px;
  max-width: 480px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-xl);
  font-family: Manrope, sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* Tabs */
.dashboard__tabs {
  display: flex;
  gap: var(--space-2);
}

.dashboard__tab {
  display: flex;
  height: 36px;
  padding: var(--space-2) var(--space-3);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  font-family: Inter, sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.dashboard__tab--active {
  border: 1px solid #D5D7DA;
  background: var(--text-primary);
  color: #414651;
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
}

/* Stats Grid */
.dashboard__stats {
  margin: clamp(24px, 6vw, 32px) 0;
}

.dashboard__stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(16px, 4vw, 24px);
}

.dashboard__stat-card {
  background: #090A2B;
  border: 1px solid #040548;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
}

.dashboard__stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}

.dashboard__stat-title {
  font-family: Inter, sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.dashboard__stat-menu {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard__stat-menu span {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
}

.dashboard__stat-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
}

.dashboard__stat-value {
  font-family: Inter, sans-serif;
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.dashboard__stat-change {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: Inter, sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 500;
  flex-wrap: wrap;
}

.dashboard__stat-change--positive {
  color: #17B26A;
}

.dashboard__stat-change--negative {
  color: var(--accent-danger);
}

.dashboard__stat-period {
  color: var(--text-primary);
}

.dashboard__stat-chart {
  flex-shrink: 0;
  width: 100%;
  max-width: 200px;
}

.dashboard__stat-chart svg {
  width: 100%;
  height: auto;
}

/* Portfolio Section */
.dashboard__portfolio {
  margin: clamp(32px, 8vw, 48px) 0;
}

.dashboard__section-header {
  margin-bottom: var(--space-6);
}

.dashboard__section-title h2 {
  font-family: Inter, sans-serif;
  font-size: clamp(18px, 4vw, 20px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.dashboard__section-title p {
  font-family: Manrope, sans-serif;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Table */
.dashboard__table-container {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-primary);
}

.dashboard__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
}

.dashboard__table th {
  font-family: Manrope, sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-primary);
}

.dashboard__table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-primary);
  font-family: Manrope, sans-serif;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.dashboard__investment-status {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
}

.dashboard__investment-status--active {
  background: rgba(23, 178, 106, 0.1);
  color: #17B26A;
}

.dashboard__investment-status--pending {
  background: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

.dashboard__investment-action {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.dashboard__investment-action:hover {
  color: var(--accent-secondary);
}

.dashboard__empty-table {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* Growth Chart Section */
.dashboard__growth {
  margin: clamp(32px, 8vw, 48px) 0;
}

.dashboard__growth-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}

.dashboard__growth-title {
  font-family: Inter, sans-serif;
  font-size: clamp(18px, 4vw, 20px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.dashboard__growth-value {
  font-family: Inter, sans-serif;
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.dashboard__period-tabs {
  display: flex;
  gap: 2px;
  background: #080C2D;
  border: 1px solid #040548;
  border-radius: var(--radius-md);
  padding: 2px;
}

.dashboard__period-tab {
  display: flex;
  height: 36px;
  padding: var(--space-2) var(--space-3);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  font-family: Inter, sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.dashboard__period-tab--active {
  border: 1px solid #D5D7DA;
  background: var(--text-primary);
  color: #EB1260;
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
}

.dashboard__growth-chart {
  height: 289px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-primary);
  position: relative;
}

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

/* Content Switching */
.dashboard__content--hidden {
  display: none;
}

/* Investment Cards for Browse Tab */
.dashboard__investments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(16px, 4vw, 24px);
  margin-top: var(--space-6);
}

.dashboard__investment-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--transition-base);
}

.dashboard__investment-card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-lg);
}

.dashboard__investment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.dashboard__investment-card-category {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}

.dashboard__investment-card-type {
  font-size: var(--font-size-xs);
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.dashboard__investment-card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.dashboard__investment-card-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.dashboard__investment-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.dashboard__investment-card-stat-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.dashboard__investment-card-stat-value {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard__investment-card-progress {
  margin-bottom: var(--space-4);
}

.dashboard__investment-card-progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.dashboard__investment-card-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width var(--transition-slow);
}

.dashboard__investment-card-progress-text {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.dashboard__investment-card-btn {
  width: 100%;
}

/* Search Results */
.search-results {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border-primary);
  padding-top: var(--space-3);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.search-result-icon {
  font-size: var(--font-size-lg);
}

.search-result-name {
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.search-result-type {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: capitalize;
}

.search-no-results {
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.search-no-results p {
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-header__container {
    gap: var(--space-2);
  }
  
  .dashboard__welcome-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .dashboard__welcome-actions {
    align-self: stretch;
  }
  
  .dashboard__action-btn {
    flex: 1;
  }
  
  .dashboard__stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard__stat-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  
  .dashboard__stat-chart {
    max-width: none;
    align-self: stretch;
  }
  
  .dashboard__growth-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .dashboard__period-tabs {
    align-self: stretch;
    justify-content: space-between;
  }
  
  .dashboard__period-tab {
    flex: 1;
    font-size: var(--font-size-xs);
  }
  
  .dashboard__table-container {
    font-size: var(--font-size-xs);
  }
  
  .dashboard__table th,
  .dashboard__table td {
    padding: var(--space-2);
  }
  
  .dashboard__investments-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dashboard__container {
    padding: 0 var(--space-4);
  }
  
  .dashboard__period-tab {
    padding: var(--space-1) var(--space-2);
  }
  
  .dashboard__investment-card-stats {
    grid-template-columns: 1fr;
  }
}