/* Hero section (landing page) */
.hero-section {
    background: var(--green);
    color: var(--white);
    padding: var(--space-3xl) 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hero-section .hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: var(--space-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-section .search-box .search-input {
    background: var(--white);
    color: var(--ink);
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--space-lg);
}

.hero-feature-card {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.15);
    transition: background 0.2s ease;
}

.hero-feature-card:hover {
    background: rgba(255,255,255,0.15);
}

.hero-feature-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.hero-feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.hero-feature-card p {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.5;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.dashboard-section {
    margin-bottom: var(--space-lg);
}

.dashboard-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-section-title a {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Stock detail header */
.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-md);
}

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

.stock-header-ticker {
    font-size: 0.95rem;
    opacity: 0.8;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.stock-header-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

.stock-header-exchange {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.stock-header-price {
    text-align: right;
}

.stock-header-price-value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stock-header-price-change {
    font-size: 1rem;
    margin-top: var(--space-xs);
}

.stock-header-price-change.positive {
    color: #a8f0d0;
}

.stock-header-price-change.negative {
    color: #ffb3a0;
}

.stock-header-range {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: var(--space-sm);
}

/* Stock content (two column) */
.stock-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
    margin-top: calc(-1 * var(--space-xl));
    position: relative;
    z-index: 1;
}

.stock-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.stock-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Chart container */
.chart-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow);
}

.chart-controls {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.chart-controls button {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink-light);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chart-controls button:hover {
    background: var(--cream);
}

.chart-controls button.active {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.chart-area {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

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

/* Analysis header */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.analysis-score-display {
    text-align: center;
}

.analysis-score-display .score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.analysis-score-display .score-signal {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: var(--space-xs);
}

/* Criteria table (Levermann) */
.criteria-table {
    width: 100%;
    border-collapse: collapse;
}

.criteria-table th {
    background: var(--cream);
    font-weight: 600;
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
    color: var(--ink-light);
    border-bottom: 2px solid var(--line);
}

.criteria-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
    vertical-align: middle;
}

.criteria-table tbody tr:hover {
    background: var(--mint);
}

.criteria-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.criteria-score.score-positive {
    background: var(--mint);
    color: var(--green);
}

.criteria-score.score-zero {
    background: var(--cream);
    color: var(--muted);
}

.criteria-score.score-negative {
    background: var(--coral-light);
    color: var(--coral);
}

/* Valuation summary */
.valuation-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-xl);
}

.valuation-comparison {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.valuation-item {
    text-align: center;
}

.valuation-item-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.valuation-item-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ink);
}

.valuation-arrow {
    font-size: 1.5rem;
    color: var(--muted);
}

.valuation-upside {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-top: var(--space-md);
}

.valuation-bar {
    position: relative;
    height: 40px;
    background: var(--cream);
    border-radius: var(--radius);
    margin: var(--space-lg) 0;
    overflow: visible;
}

.valuation-bar-marker {
    position: absolute;
    top: -4px;
    width: 3px;
    height: 48px;
    border-radius: 2px;
    transform: translateX(-50%);
}

.valuation-bar-marker.current-price {
    background: var(--ink);
}

.valuation-bar-marker.fair-value {
    background: var(--green);
}

.valuation-bar-label {
    position: absolute;
    top: 52px;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Projection table (DCF) */
.projection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.projection-table th {
    background: var(--cream);
    font-weight: 600;
    text-align: right;
    padding: var(--space-sm) var(--space-md);
    color: var(--ink-light);
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}

.projection-table th:first-child {
    text-align: left;
}

.projection-table td {
    text-align: right;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.projection-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.projection-table tbody tr:hover {
    background: var(--mint);
}

/* Watchlist grid */
.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.watchlist-card {
    position: relative;
}

.watchlist-remove {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--muted);
    transition: all 0.15s ease;
    z-index: 2;
}

.watchlist-remove:hover {
    background: var(--red-light);
    color: var(--red);
    border-color: var(--red);
}

/* Search results */
.search-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.search-page-header {
    margin-bottom: var(--space-lg);
    padding-top: var(--space-xl);
}

/* Auth page */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-3xl) var(--space-lg);
    min-height: calc(100vh - 300px);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-xl);
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--ink);
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-card .auth-footer a {
    color: var(--green);
    font-weight: 500;
}

/* Analysis cards (overview) */
.analysis-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.analysis-method-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-xl);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.analysis-method-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--line);
}

.analysis-method-icon {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.analysis-method-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--ink);
}

.analysis-method-card p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    flex: 1;
}

.analysis-method-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--line);
}

/* Methodology section */
.methodology-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-xl);
    margin-top: var(--space-lg);
}

.methodology-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.methodology-section p {
    font-size: 0.95rem;
    color: var(--ink-light);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.methodology-section p:last-child {
    margin-bottom: 0;
}

/* Assumptions card */
.assumptions-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.assumptions-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

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

.assumptions-list dt {
    font-size: 0.9rem;
    color: var(--muted);
}

.assumptions-list dd {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

/* Sensitivity note */
.sensitivity-note {
    background: var(--yellow-light);
    border: 1px solid var(--yellow);
    border-radius: var(--radius);
    padding: var(--space-md);
    font-size: 0.9rem;
    color: #866300;
    margin: var(--space-lg) 0;
}

/* Multiples sections */
.multiples-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.multiples-section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.multiples-comparison {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.multiples-metric {
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.multiples-metric-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: var(--space-xs);
}

.multiples-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Error state */
.error-card {
    background: var(--red-light);
    border: 1px solid var(--red);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    margin: var(--space-lg) 0;
}

.error-card h3 {
    color: var(--red);
    margin-bottom: var(--space-sm);
}

.error-card p {
    color: var(--ink-light);
}

/* Overview table */
.overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    white-space: nowrap;
}

.overview-table thead th {
    background: var(--cream);
    font-weight: 600;
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    color: var(--ink-light);
    border-bottom: 2px solid var(--line);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.overview-table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.overview-table tbody tr:hover {
    background: var(--mint);
}

.overview-table .text-right {
    text-align: right;
}

.overview-table .text-center {
    text-align: center;
}

.overview-table .positive {
    color: var(--green);
    font-weight: 500;
}

.overview-table .negative {
    color: var(--red);
    font-weight: 500;
}

.overview-table .ticker-link {
    font-weight: 700;
    color: var(--green);
    text-decoration: none;
}

.overview-table .ticker-link:hover {
    text-decoration: underline;
}

.overview-table .stock-name-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-table .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
}

.overview-table .badge-green {
    background: var(--mint);
    color: var(--green);
}

.overview-table .badge-yellow {
    background: var(--yellow-light);
    color: #866300;
}

.overview-table .badge-red {
    background: var(--red-light);
    color: var(--red);
}

/* Responsive */
@media (max-width: 1024px) {
    .stock-content {
        grid-template-columns: 1fr;
    }

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

    .watchlist-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-cards {
        grid-template-columns: 1fr;
    }

    .stock-header {
        flex-direction: column;
    }

    .stock-header-price {
        text-align: left;
    }

    .stock-header-price-value {
        font-size: 1.75rem;
    }

    .stock-header-name {
        font-size: 1.5rem;
    }

    .valuation-comparison {
        flex-direction: column;
        gap: var(--space-md);
    }

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

    .search-results {
        grid-template-columns: 1fr;
    }

    .assumptions-list {
        grid-template-columns: 1fr;
    }

    .projection-table {
        font-size: 0.8rem;
    }

    .projection-table th,
    .projection-table td {
        padding: var(--space-xs) var(--space-sm);
    }
}

@media (max-width: 480px) {
    .hero-features {
        grid-template-columns: 1fr;
    }
}
