/* Custom styles for ProInvestors.ai */

/* DCF Calculation Display Styles */
#calculation-details-card.expanded-details {
    position: relative;
    z-index: 10;
    border: 1px solid #007bff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#calculation-details-card.expanded-details .calculation-details-body {
    max-height: 500px;
    overflow-y: auto;
    padding: 1.25rem;
    background-color: #f8f9fa;
}

.calculation-details-body {
    transition: max-height 0.3s ease;
    overflow-y: hidden;
    max-height: 240px;
}

.calculation-details-body h6 {
    color: #0056b3 !important;
    font-weight: 500 !important;
    margin-top: 0.75rem;
}

.calculation-details-body .ps-2 {
    padding-left: 1rem !important;
}

.calculation-details-body p {
    margin-bottom: 0.5rem;
}

/* General styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    color: #212529;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Fix for washed-out text */
p, h1, h2, h3, h4, h5, h6, .card-title, .card-text, .nav-link, .btn, .form-label, 
.table th, .table td, .list-group-item {
    color: #212529 !important; /* Ensure strong contrast */
    font-weight: normal; /* Default font weight */
}

/* Preserve special color elements */
.price-change-positive, .price-up {
    color: #28a745 !important; /* Green for positive changes */
}

.price-change-negative, .price-down {
    color: #dc3545 !important; /* Red for negative changes */
}

/* Make headers stand out */
h1, h2, h3, .card-title {
    font-weight: 600 !important; /* Semibold for headers */
}

/* Ensure strong contrast for text */
.text-muted {
    color: #6c757d !important; /* Darker muted text */
}

main {
    flex-grow: 1;
}

/* Override card styles for light theme */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Search results dropdown */
.search-results-container {
    position: relative;
}

#search-results {
    position: absolute;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
}

/* Stock display */
.stock-container {
    margin-bottom: 2rem;
}

#company-name {
    margin-bottom: 0.5rem;
}

#stock-price {
    font-weight: bold;
}

/* Chart container */
#chart-container {
    position: relative;
    width: 100%;
}

/* News section */
.news-item {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--bs-dark);
    padding-bottom: 1rem;
}

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

/* Financial statement tables */
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* Style improvements for light theme appearance */
.list-group-item {
    border-color: rgba(0, 0, 0, 0.125);
}

/* Price change colors */
.price-up {
    color: var(--bs-success);
}

.price-down {
    color: var(--bs-danger);
}

/* Image handling in news cards */
.object-fit-cover {
    object-fit: cover;
}

/* ProInvestors.ai DCF Comparison Styles */
.comparison-table {
    width: 100%;
    table-layout: fixed; /* This forces the table to respect column widths */
}

.comparison-table th,
.comparison-table td {
    width: 25%; /* Equal width for all columns */
    vertical-align: middle;
    text-align: center;
    padding: 0.5rem;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left; /* Parameter names align left */
    font-weight: 500;
}

.comparison-table th {
    vertical-align: middle;
    font-weight: 600;
    background-color: #f8f9fa;
}

.comparison-table .table-primary td {
    font-weight: bold;
}

.user-input-cell {
    padding: 0.3rem !important;
    text-align: center;
}

.user-dcf-input {
    min-width: 70px;
    text-align: right;
}

/* Parameter row styling when visible */
.parameter-row {
    display: none;
}

.parameter-row td {
    width: 25%;
    text-align: center;
    vertical-align: middle;
}

.parameter-row td:first-child {
    text-align: left;
}

.parameter-row[style*="display: table-row"] td {
    width: 25% !important;
}

/* Custom badge for Pro features */
.badge.bg-primary {
    background-color: #5a67d8 !important;
    font-weight: 500;
}

/* Toggle switch for adjustment mode */
.form-check.form-switch {
    margin-bottom: 0.5rem;
}

/* Logo size overrides */
.navbar-brand {
    padding: 0 !important;
    margin-right: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.logo-image {
    height: 40px !important;
    width: auto !important;
    max-height: 40px !important;
}

.footer-logo {
    height: 30px !important;
    width: auto !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card-title {
        font-size: 1.1rem;
    }
    
    #chart-container {
        height: 300px !important;
    }
    
    .comparison-table th, 
    .comparison-table td {
        font-size: 0.85rem;
        padding: 0.4rem;
    }
    
    .user-dcf-input {
        min-width: 40px;
        font-size: 0.8rem;
    }
    
    /* Smaller logo on mobile */
    .logo-image {
        height: 30px !important;
    }
    
    .footer-logo {
        height: 24px !important;
    }
}
