:root {
    --success-color: #2eb85c;
    --info-color: #39f;
    --warning-color: #f9b115;
    --danger-color: #e55353;
    /* Base font size reduced to 75% of typical 16px */
    font-size: 12px;
}


/* Strong direct selector to override any existing styles */
#price-chart,
.chart-container,
.chart-container canvas,
div.chart-container {
    height: 150px !important; /* Force 50% of original height */
    max-height: 150px !important;
}

/* Target the card body containing the chart */
.card-body:has(.chart-container),
.card-body:has(canvas#price-chart) {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}


/* Main container width control */
.container-fluid {
    max-width: 900px; /* 75% of original 1200px */
    margin: 0 auto;
}

/* Card styling enhancements */
.card {
    box-shadow: 0 3px 4.5px rgba(0, 0, 0, 0.1); /* 75% of original shadow */
    border-radius: 0.225rem; /* 75% of 0.3rem */
    border: none;
}

.card-header {
    border-bottom: none;
    padding: 0.5625rem 0.9375rem; /* 75% of original padding */
}

/* Graham score in header styling */
#graham-score, #graham-percent {
    font-weight: 600;
}

#graham-description {
    font-size: 0.675rem; /* 75% of 0.9rem */
    opacity: 0.9;
}

/* Metric values */
h4[id$="-ratio"],
h4[id$="-equity"],
h4[id="roe"],
h4[id="profit-margin"],
h4[id="dividend-yield"],
h4[id="beta"] {
    font-size: 1.125rem; /* 75% of 1.5rem */
    font-weight: 600;
}

/* Chart period buttons styling */
.btn-group .btn-sm {
    font-size: 0.6rem; /* 75% of 0.8rem */
    padding: 0.1875rem 0.375rem; /* 75% of original padding */
}

/* Chart container styling */
.chart-container {
    position: relative;
    height: 180px; /* 60% of original 300px */
    width: 100%;
}

/* Reduce vertical spacing around the chart */
.card-body:has(.chart-container) {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

/* Recent search items */
.recent-search-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.recent-search-item:hover {
    background-color: #e9ecef;
}

/* Header customization */
.header {
    background-color: white;
    box-shadow: 0 1.5px 3.75px rgba(0, 0, 0, 0.05); /* 75% of original shadow */
}

.header-brand h3 {
    color: #3399ff;
    font-weight: 600;
    font-size: 1.31rem; /* 75% of typical h3 */
}

/* Responsive adjustments for Graham criteria header */
@media (max-width: 992px) {
    .card-header.bg-dark {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .card-header.bg-dark div {
        margin-top: 0.375rem; /* 75% of 0.5rem */
    }
    
    .container-fluid {
        max-width: 100%;
        padding-left: 11.25px; /* 75% of 15px */
        padding-right: 11.25px; /* 75% of 15px */
    }
}

/* Custom centered layout for large screens */
@media (min-width: 1400px) {
    body {
        background-color: #f5f7fb;
    }
    
    .container-fluid {
        max-width: 855px; /* 75% of 1140px */
    }
    
    .body {
        padding: 0 15px; /* 75% of 20px */
    }
}

/* Enhance metric display on value tab */
.text-center h4 {
    font-size: 1.125rem; /* 75% of 1.5rem */
    margin-bottom: 0.375rem; /* 75% of 0.5rem */
}

/* Style for Graham criteria table */
#graham-criteria-table td {
    padding: 0.5625rem 0.9375rem; /* 75% of original padding */
    vertical-align: middle;
}

/* Style for the value text */
#graham-criteria-items .text-medium-emphasis {
    font-size: 0.675rem; /* 75% of 0.9rem */
    margin-left: 6px; /* 75% of 8px */
}

/* Make the criteria badges more distinct */
#graham-criteria-items .badge {
    font-size: 0.6rem; /* 75% of 0.8rem */
    padding: 0.2625rem 0.375rem; /* 75% of original padding */
    min-width: 18px; /* 75% of 24px */
}

/* Adjust all CoreUI components to 75% size */
.card {
    margin-bottom: 0.75rem; /* 75% of typical card margin */
}

.card-body {
    padding: 0.75rem; /* 75% of typical padding */
}

.row {
    margin-right: -9px; /* 75% of standard Bootstrap row margins */
    margin-left: -9px;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12, 
.col-sm, .col-md, .col-lg, .col-xl, .col-xxl,
.col-sm-1, .col-sm-2 {
    padding-right: 9px;
    padding-left: 9px;
}

/* Adjust Typography */
h1, .h1 { font-size: 2.025rem; } /* 75% of 2.7rem or default h1 */
h2, .h2 { font-size: 1.65rem; }  /* 75% of 2.2rem or default h2 */
h3, .h3 { font-size: 1.31rem; }  /* 75% of 1.75rem or default h3 */
h4, .h4 { font-size: 1.125rem; } /* 75% of 1.5rem */
h5, .h5 { font-size: 0.9375rem; } /* 75% of 1.25rem */
h6, .h6 { font-size: 0.75rem; } /* 75% of 1rem */

/* Adjust spacing utilities */
.m-1 { margin: 0.1875rem !important; }
.m-2 { margin: 0.375rem !important; }
.m-3 { margin: 0.75rem !important; }
.m-4 { margin: 1.125rem !important; }
.m-5 { margin: 2.25rem !important; }

.mt-1 { margin-top: 0.1875rem !important; }
.mt-2 { margin-top: 0.375rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1.125rem !important; }
.mt-5 { margin-top: 2.25rem !important; }

/* Similar adjustments for mb, ml, mr, mx, my, etc. */

.p-1 { padding: 0.1875rem !important; }
.p-2 { padding: 0.375rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1.125rem !important; }
.p-5 { padding: 2.25rem !important; }

.pt-1 { padding-top: 0.1875rem !important; }
.pt-2 { padding-top: 0.375rem !important; }
.pt-3 { padding-top: 0.75rem !important; }
.pt-4 { padding-top: 1.125rem !important; }
.pt-5 { padding-top: 2.25rem !important; }

/* Similar adjustments for pb, pl, pr, px, py, etc. */

/* Adjust form controls */
.form-control {
    height: calc(1.5em + 0.75rem + 2px); /* 75% of typical height */
    padding: 0.28125rem 0.5625rem; /* 75% of typical padding */
    font-size: 0.75rem; /* 75% of 1rem */
}

.form-control-sm {
    height: calc(1.5em + 0.5625rem + 2px); /* 75% of small control */
    padding: 0.21rem 0.42rem; /* 75% of small padding */
    font-size: 0.65625rem; /* 75% of small font */
}

.form-control-lg {
    height: calc(1.5em + 1.125rem + 2px); /* 75% of large control */
    padding: 0.42rem 0.84rem; /* 75% of large padding */
    font-size: 0.9375rem; /* 75% of large font */
}

/* Adjust buttons */
.btn {
    padding: 0.28125rem 0.5625rem; /* 75% of typical padding */
    font-size: 0.75rem; /* 75% of 1rem */
}

.btn-sm {
    padding: 0.21rem 0.42rem; /* 75% of small padding */
    font-size: 0.65625rem; /* 75% of small font */
}

.btn-lg {
    padding: 0.42rem 0.84rem; /* 75% of large padding */
    font-size: 0.9375rem; /* 75% of large font */
}

/* Adjust badges */
.badge {
    padding: 0.25em 0.4em; /* Keep em units but reduce base font size */
    font-size: 75%; /* Already relative to parent, maintain this */
}

/* Adjust dropdown menus */
.dropdown-menu {
    padding: 0.375rem 0; /* 75% of typical padding */
    font-size: 0.75rem; /* 75% of 1rem */
}

.dropdown-item {
    padding: 0.1875rem 1.125rem; /* 75% of typical padding */
}

/* Adjust tables */
.table th, .table td {
    padding: 0.5625rem; /* 75% of typical padding */
}

/* Adjust alerts */
.alert {
    padding: 0.75rem 1.125rem; /* 75% of typical padding */
    margin-bottom: 0.75rem; /* 75% of typical margin */
}

/* Adjust modals */
.modal-header {
    padding: 0.75rem; /* 75% of typical padding */
}

.modal-body {
    padding: 0.75rem; /* 75% of typical padding */
}

.modal-footer {
    padding: 0.75rem; /* 75% of typical padding */
}

/* Preserve original status colors */
.status-success {
    color: var(--success-color);
}

.status-warning {
    color: var(--warning-color);
}

.status-danger {
    color: var(--danger-color);
}

/* Section headers - preserve colors but adjust padding */
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-danger,
.card-header.bg-dark,
.card-header.bg-graham-strong,
.card-header.bg-graham-moderate,
.card-header.bg-graham-weak {
    padding: 0.5625rem 0.9375rem; /* 75% of original padding */
}

.card-header.bg-primary {
    background-color: #3399ff !important;
}

.card-header.bg-success {
    background-color: var(--success-color) !important;
}

.card-header.bg-info {
    background-color: var(--info-color) !important;
}

.card-header.bg-danger {
    background-color: var(--danger-color) !important;
}

.card-header.bg-dark {
    background-color: #21262d !important;
}

.card-header.bg-graham-strong {
    background-color: var(--success-color) !important;
}

.card-header.bg-graham-moderate {
    background-color: var(--warning-color) !important;
}

.card-header.bg-graham-weak {
    background-color: var(--danger-color) !important;
    
}


.card-header.value-metrics-header {
    background-color: #3399ff !important; /* Default blue */
}

/* If P/E ratio > 15 or P/B ratio > 1.5 or Current Ratio < 2 or Debt/Equity > 0.5 */
.card-header.value-metrics-warning {
    background-color: #f9b115 !important; /* Warning yellow */
}

.card-header.value-metrics-danger {
    background-color: #e55353 !important; /* Danger red */
}

/* Profitability & Growth card - adjust colors based on profitability metrics */
.card-header.profitability-header {
    background-color: #2eb85c !important; /* Default success green */
}

/* If ROE < 15% or Profit Margin < 10% or Dividend Yield < 2% */
.card-header.profitability-warning {
    background-color: #f9b115 !important; /* Warning yellow */
}

.card-header.profitability-danger {
    background-color: #e55353 !important; /* Danger red */
}

/* Risk Factors card - adjust colors based on risk assessment */
.card-header.risk-header-safe {
    background-color: #2eb85c !important; /* Safe green */
}

.card-header.risk-header-warning {
    background-color: #f9b115 !important; /* Warning yellow */
}

.card-header.risk-header-danger {
    background-color: #e55353 !important; /* Danger red */
}


/* Add to your styles.css file */

/* Execution time display styling */
#execution-time {
    font-size: 0.75rem;
    color: #6c757d;
    padding: 0.375rem 0;
    border-top: 1px dotted #dee2e6;
    border-bottom: 1px dotted #dee2e6;
    margin-bottom: 0.75rem;
}

#execution-time .badge {
    font-size: 0.65rem;
    font-weight: normal;
    padding: 0.2rem 0.35rem;
}

/* Animate the fast badge */
@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

#execution-time .badge.bg-success {
    animation: pulse 1.5s infinite;
}

/* Make the clock icon a bit smaller */
#execution-time i.cil-clock {
    font-size: 0.7rem;
    margin-right: 0.2rem;
}

#execution-time i.cil-speedometer {
    font-size: 0.7rem;
}


.metric-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.metric-tooltip .tooltip-icon {
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    opacity: 0.7;
}

.metric-tooltip .tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    font-weight: normal;
}

.metric-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.metric-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Increase Graham score and description font sizes */
#graham-score, #graham-percent {
    font-weight: 600;
    font-size: 1.1rem; /* Increased from 0.675rem */
}

#graham-description {
    font-size: 1rem; /* Increased from 0.675rem */
    opacity: 0.9;
}

/* Make header text responsive */
@media (max-width: 768px) {
    #graham-score, #graham-percent {
        font-size: 0.95rem;
    }
    
    #graham-description {
        font-size: 0.85rem;
    }
}

/* Insider Transactions styling */
.insider-header {
    background-color: #3399ff !important; /* Default blue */
}

.insider-header.insider-positive {
    background-color: #2eb85c !important; /* Success green */
}

.insider-header.insider-very-positive {
    background-color: #1c9641 !important; /* Darker green */
}

.insider-header.insider-negative {
    background-color: #f9b115 !important; /* Warning yellow */
}

.insider-header.insider-very-negative {
    background-color: #e55353 !important; /* Danger red */
}

.insider-summary-section {
    background-color: #f9f9f9;
}

.insider-transaction {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.insider-transaction:last-child {
    border-bottom: none;
}

.transaction-acquisition {
    color: #2eb85c;
}

.transaction-disposal {
    color: #e55353;
}

.acquisition-badge, .disposal-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
}

.insider-toggle-container {
    background-color: #f1f1f1;
    cursor: pointer;
}

#insider-toggle {
    padding: 0.1rem 0.5rem;
    font-size: 0.7rem;
}

/* Value comparison badge styles */
#value-comparison {
    font-size: 0.7rem;
    font-style: italic;
}


.buy-value-badge, .sell-value-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    min-width: 120px;
    text-align: center;
}

.buy-value-badge.bg-success, .sell-value-badge.bg-danger {
    font-weight: bold;
}

/* Add a pulsing effect to highlight significant value discrepancies */
@keyframes pulse-highlight {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.sell-value-badge.bg-danger, .buy-value-badge.bg-success {
    animation: pulse-highlight 2s infinite;
}

/* 10 Years Stats table styling */
#ten-year-table {
    font-size: 0.875rem;
}

#ten-year-table th, #ten-year-table td {
    white-space: nowrap;
}

@media (max-width: 767px) {
    #ten-year-table {
        font-size: 0.75rem;
    }
    
    #ten-year-table th, #ten-year-table td {
        padding: 0.4rem;
    }
}

/* Color styling for year-over-year changes */
#ten-year-data .text-success {
    color: var(--success-color) !important;
}

#ten-year-data .text-danger {
    color: var(--danger-color) !important;
}

.bs-detector-label {
    font-size: 0.7rem; /* Makes this specific text smaller */
}

/* Top Stocks Sidebar Styling - Bootstrap Grid Version */

/* Top Stocks Sidebar Styling */
.top-stock-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.top-stock-item:hover {
    background-color: #f8f9fa;
}

.top-stock-item:last-child {
    border-bottom: none !important;
}

.top-stock-item .badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.3rem;
}

/* Remove old sidebar styles that are no longer needed */