/* Portfolio page - Tokyo Night Theme */
.portfolio-section {
  padding: 2.5rem 0 4rem;
  background: var(--bg-main);
  min-height: 100vh;
}

.portfolio-info {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(158, 206, 106, 0.1);
  border-radius: 1rem;
  border-left: 4px solid var(--success);
  border: 1px solid rgba(158, 206, 106, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-info:hover {
  transform: translateY(-2px);
  background: rgba(158, 206, 106, 0.15);
}

.portfolio-updated {
  margin: 0;
  color: var(--success);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portfolio-updated svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
}

.portfolio-section .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  margin-top: 3rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.portfolio-section .section-head:first-of-type {
  margin-top: 0;
}

.portfolio-section .section-head h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.portfolio-section .section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.portfolio-table-wrapper {
  overflow: hidden;
  margin-top: 1.5rem;
  background: var(--bg-elevated);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-table-wrapper:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

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

.portfolio-table thead {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.portfolio-table thead th {
  text-align: left;
  padding: 1.25rem 1.5rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.portfolio-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-elevated);
}

.portfolio-table tbody tr:hover {
  background: var(--bg-highlight);
}

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

.portfolio-table tbody td {
  padding: 1.25rem 1.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.stock-symbol {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-bright);
}

.stock-link {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: rgba(122, 162, 247, 0.1);
}

.stock-link:hover {
  color: var(--secondary);
  background: rgba(122, 162, 247, 0.2);
  transform: translateY(-1px);
}

.stock-name {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.price {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
  font-weight: 600;
  color: var(--text);
}

.quantity {
  font-weight: 600;
  color: var(--text-bright);
}

.performance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.performance-badge svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 2.5;
}

.performance-badge.positive {
  background: rgba(158, 206, 106, 0.15);
  color: var(--success);
  border: 1px solid rgba(158, 206, 106, 0.3);
}

.performance-badge.positive:hover {
  background: rgba(158, 206, 106, 0.2);
  transform: scale(1.05);
}

.performance-badge.negative {
  background: rgba(247, 118, 142, 0.15);
  color: var(--danger);
  border: 1px solid rgba(247, 118, 142, 0.3);
}

.performance-badge.negative:hover {
  background: rgba(247, 118, 142, 0.2);
  transform: scale(1.05);
}

.performance-badge.neutral {
  background: rgba(86, 95, 137, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(86, 95, 137, 0.3);
}

.portfolio-cards {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.portfolio-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border-color: var(--primary);
}

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

.card-stock-info {
  flex: 1;
}

.card-stock-symbol {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.card-stock-symbol a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.card-stock-symbol a:hover {
  color: var(--primary);
}

.card-stock-name {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.card-badge {
  flex-shrink: 0;
}

.card-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.card-metric {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.card-metric-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-metric-value {
  color: var(--text-bright);
  font-size: 1.1rem;
  font-weight: 700;
}

.card-metric-value.price {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
}

@media (max-width: 1024px) {
  .portfolio-table thead th,
  .portfolio-table tbody td {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
  }

  .stock-symbol {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .portfolio-section {
    padding: 1.5rem 0 3rem;
  }

  .portfolio-section .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .portfolio-section .section-head h2 {
    font-size: 1.5rem;
  }

  .portfolio-table-wrapper {
    display: none;
  }

  .portfolio-cards {
    display: grid;
  }

  .card-body {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card-metric {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-surface);
    border-radius: 0.75rem;
  }

  .card-metric-label {
    font-size: 0.8rem;
  }

  .card-metric-value {
    font-size: 1rem;
  }

  .portfolio-info {
    padding: 1rem 1.25rem;
  }

  .portfolio-updated {
    font-size: 0.875rem;
  }
}

@media (min-width: 769px) {
  .portfolio-cards {
    display: none;
  }
}
