/* Sleek, flush, modern styling for Asset Analysis */
/* Reference: Company Valuations - use cv-page for consistent layout */

.cv-page {
  --cv-gap: 1rem;
  --cv-sidebar-w: 18rem;   /* lg:w-72 */
  --cv-sidebar-w-xl: 20rem; /* xl:w-80 */
}
@media (min-width: 1024px) {
  .cv-page { --cv-gap: 1.5rem; }
}

/* Bottom spacing to match Company Valuations - breathing room below cards */
.cv-page aside {
  align-self: flex-start;
  padding-bottom: 2rem;
}
.cv-page main {
  padding-bottom: 2rem;
}

/* Typography - tabular figures for aligned numbers */
.cv-table td,
.cv-metric .value {
  font-variant-numeric: tabular-nums;
}

/* Cards - shared across all pages */
.cv-card,
.glass-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.cv-card:hover,
.glass-card:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
@media (min-width: 1024px) {
  .cv-card,
  .glass-card { padding: 1.5rem; }
}

/* Error card variant */
.cv-card-error {
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.05);
}

/* Inputs */
.cv-input {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cv-input::placeholder { color: rgba(156,163,175,0.7); }
.cv-input:focus,
.cv-input:focus-visible {
  outline: none;
  border-color: rgba(79,70,229,0.5);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.cv-input.cv-input-error {
  border-color: rgba(239,68,68,0.5);
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
}
.cv-input.cv-input-error:focus {
  border-color: rgba(239,68,68,0.6);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.cv-input-error-msg {
  font-size: 0.75rem;
  color: #f87171;
  margin-top: 0.375rem;
}

/* Buttons */
.cv-btn {
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.cv-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79,70,229,0.35);
}
.cv-btn:focus,
.cv-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.4);
}
.cv-btn:active { transform: translateY(0); }

/* Quick/clickable items */
.cv-quick {
  padding: 0.625rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.cv-quick:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}
.cv-quick:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(79,70,229,0.4);
}

/* Tables */
.cv-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}
.cv-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: rgba(156,163,175,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cv-table th.text-right { text-align: right; }
.cv-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(229,231,235,0.95);
  transition: background 0.15s;
}
.cv-table td.text-right { text-align: right; }
.cv-table td.text-green-400 { color: #4ade80; }
.cv-table td.text-red-400 { color: #f87171; }
.cv-table tbody tr {
  transition: background 0.15s ease;
}
.cv-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.cv-table tbody tr:last-child td { border-bottom: none; }

/* Responsive table - card layout on mobile */
@media (max-width: 640px) {
  .cv-table-responsive {
    display: block;
  }
  .cv-table-responsive thead {
    display: none;
  }
  .cv-table-responsive tbody tr {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.02);
    border-radius: 0.5rem;
  }
  .cv-table-responsive tbody tr:last-child {
    margin-bottom: 0;
  }
  .cv-table-responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: none;
  }
  .cv-table-responsive td::before {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(156,163,175,0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .cv-table-responsive td:first-child::before { content: "Type"; }
  .cv-table-responsive td:last-child::before { content: "Ticker"; }
}

/* Metric cards */
.cv-metric {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
}
.cv-metric .label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(156,163,175,0.9);
  margin-bottom: 0.25rem;
}
.cv-metric .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
}

/* Section titles */
.cv-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
.cv-section-sub {
  font-size: 0.8125rem;
  color: rgba(156,163,175,0.9);
  line-height: 1.4;
}

/* Chart containers */
.cv-chart-wrap {
  background: rgba(0,0,0,0.2);
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.04);
}

/* Loading overlay */
.cv-loading {
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(12px);
}

/* Skeleton loaders */
.cv-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: cv-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
@keyframes cv-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.cv-skeleton-text {
  height: 0.875rem;
}
.cv-skeleton-title {
  height: 1.25rem;
  width: 60%;
}
.cv-skeleton-chart {
  height: 200px;
  width: 100%;
}

/* Empty state - enhanced with CTA hint */
.cv-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  text-align: center;
  padding: 2rem 1.5rem;
}
.cv-empty-state-icon {
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.05);
}
.cv-empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}
.cv-empty-state-desc {
  font-size: 0.875rem;
  color: rgba(156,163,175,0.9);
  max-width: 18rem;
  margin: 0 auto 1rem;
  line-height: 1.5;
}
.cv-empty-state-hint {
  font-size: 0.75rem;
  color: rgba(156,163,175,0.6);
  margin-top: 0.5rem;
}

/* Scrollbar */
.cv-page main::-webkit-scrollbar,
.app-content::-webkit-scrollbar { width: 8px; }
.cv-page main::-webkit-scrollbar-track,
.app-content::-webkit-scrollbar-track { background: transparent; }
.cv-page main::-webkit-scrollbar-thumb,
.app-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}
.cv-page main::-webkit-scrollbar-thumb:hover,
.app-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}
