/* App-specific overrides on top of Pico CSS */

.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--pico-border-radius);
}

.message-success {
    background-color: #dcfce7;
    color: #166534;
}

.message-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.message-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.message-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Dashboard layout */
.hero-bar {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--pico-card-background-color);
    border-radius: 1rem;
    box-shadow: var(--pico-card-box-shadow);
}

.hero-bar h1 {
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.hero-metric {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--pico-muted-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    transition: opacity 0.3s ease;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Dashboard cards */
.dashboard-card {
    background-color: var(--pico-card-background-color);
    border-radius: 1rem;
    box-shadow: var(--pico-card-box-shadow);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.dashboard-card header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.dashboard-card header h2 {
    font-size: 1.125rem;
    margin: 0;
}

.dashboard-card footer {
    margin-top: auto;
    padding-top: 1rem;
}

.dashboard-card table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.dashboard-card table th,
.dashboard-card table td {
    padding: 0.5rem 0.25rem;
}

.dashboard-card .financial-statement-table {
    font-size: 0.75rem;
}

.dashboard-card .financial-statement-table th,
.dashboard-card .financial-statement-table td {
    padding: 0.35rem 0.25rem;
    line-height: 1.3;
}

.dashboard-card small {
    display: block;
    color: var(--pico-muted-color);
    font-size: 0.75rem;
}

.empty-state {
    color: var(--pico-muted-color);
    font-style: italic;
    margin: 1rem 0;
}

/* Color utilities */
.color-positive {
    color: #22c55e;
}

.color-negative {
    color: #ef4444;
}

.color-neutral {
    color: var(--pico-muted-color);
}

/* Allocation bar */
.allocation-bar {
    display: flex;
    height: 1.25rem;
    border-radius: 0.625rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: var(--pico-muted-border-color);
}

.allocation-segment {
    height: 100%;
}

.allocation-segment-1 { background-color: #3b82f6; }
.allocation-segment-2 { background-color: #22c55e; }
.allocation-segment-3 { background-color: #f59e0b; }
.allocation-segment-4 { background-color: #8b5cf6; }

.allocation-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.allocation-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.allocation-dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.allocation-label {
    flex: 1;
}

.allocation-value {
    color: var(--pico-muted-color);
    font-size: 0.8rem;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 0.75rem;
    background-color: var(--pico-muted-border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-bar-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 0.375rem;
    transition: width 0.3s ease;
}

.progress-bar-label {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    margin-bottom: 1rem;
}

/* Expenses */
.expense-summary p {
    margin-bottom: 0.75rem;
}

.expense-spent {
    font-size: 1.25rem;
    font-weight: 700;
}

.expense-divider {
    color: var(--pico-muted-color);
}

.expense-budget {
    color: var(--pico-muted-color);
}

.expense-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.expense-categories li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
    font-size: 0.875rem;
}

.expense-categories li:last-child {
    border-bottom: none;
}

/* Properties */
.property-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.property-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.property-list li:last-child {
    border-bottom: none;
}

.property-address {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.property-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

/* HTMX indicators */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms;
}
.htmx-indicator.htmx-request {
    opacity: 1;
}

/* Nav link button (for logout form inside nav) */
.nav-link-button {
  background: none;
  border: none;
  color: var(--pico-primary);
  cursor: pointer;
  padding: 0;
  margin: 0;
  font: inherit;
  text-decoration: none;
  display: inline;
  vertical-align: baseline;
}
.nav-link-button:hover {
  text-decoration: underline;
}

/* Stock detail tabs */
.stock-detail-tabs {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.stock-detail-tabs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.stock-detail-tabs li {
  margin: 0;
}

.stock-detail-tabs a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--pico-muted-color);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.stock-detail-tabs a:hover {
  color: var(--pico-primary);
}

.stock-detail-tabs a.active {
  color: var(--pico-primary);
  border-bottom-color: var(--pico-primary);
  font-weight: 600;
}

.stock-detail-tabs.htmx-request {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Quote refresh */
.quote-refresh-button {
  background: none;
  border: none;
  padding: 0.15rem;
  cursor: pointer;
  color: var(--pico-muted-color);
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.quote-refresh-button:hover {
  color: var(--pico-primary);
}

.metric-subvalue {
  font-size: 0.875rem;
  font-weight: 500;
}

.metric-date {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
}

/* News */
.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.news-list li:last-child {
    border-bottom: none;
}

.news-headline {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.news-meta {
    font-size: 0.75rem;
    color: var(--pico-muted-color);
    margin-bottom: 0.25rem;
}

.news-source {
    font-weight: 500;
}

.news-time::before {
    content: " · ";
}

.news-snippet {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    margin: 0;
}

.sentiment-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.sentiment-bearish {
    background-color: #fee2e2;
    color: #991b1b;
}

.sentiment-somewhat-bearish {
    background-color: #fef3c7;
    color: #92400e;
}

.sentiment-neutral {
    background-color: #f3f4f6;
    color: #374151;
}

.sentiment-somewhat-bullish {
    background-color: #dbeafe;
    color: #1e40af;
}

.sentiment-bullish {
    background-color: #dcfce7;
    color: #166534;
}
