body {
    font-family: 'Roboto', sans-serif;
    background-color: #f7f9fc;
    margin: 0;
    padding: 0;
}

h3 {
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

h2, h3 {
    margin: 5px 0;
}

._dash-loading {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    color: #0055a5;
    font-weight: 500;
    background: transparent;
}

/* --- OPEC Container (Mobile-First Base) --- */
.opec_container {
    font-family: 'Arial', sans-serif;
    max-width: 900px; /* Max-width for desktop */
    margin: 0 auto;
    padding: 10px; /* Reduced padding for mobile */
}

/* Allow full width on small screens */
@media (max-width: 768px) {
    .opec_container {
        padding: 0; 
    }
}

.graph-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px 15px; /* Slightly less padding on the sides for mobile */
}

/* --- Header and Controls (Key for Mobile Responsiveness) --- */
.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap; 
}

/* Media Query for Mobile Header: Stack elements vertically */
@media (max-width: 650px) {
    .graph-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px; 
    }

    .graph-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 15px;
    }
}

/* --- Change/Value Display --- */
.change-container {
    width: fit-content;
    display: flex;
    align-items: flex-end;
    border-radius: 6px;
    margin: 20px 0;
}

.value-arrow-container {
    display: flex;
    align-items: flex-end;
    margin-right: 5px;
}

.change-value {
    font-weight: bold;
    color: #333;
    font-size: 25px; 
    letter-spacing: .5px;
    margin-bottom: -5px;
}

.change-arrow {
    margin-right: 10px;
    font-size: 25px;
    margin-bottom: -3px;
}

.change-percent {
    font-size: 0.95em;
    letter-spacing: .5px;
}

.value-unit {
    font-size: 14px;
    color: #666;
    margin-left: 5px;
    align-self: flex-end;
    margin-bottom: 2px;
}

.header-top{
    display: flex;
    align-items: center;
}

.health-status-header{
    margin-left: auto;
    margin-right: 15px;
    font-size: 1rem;
    font-weight: bold;
}

/* Adjust for very small screens if necessary */
@media (max-width: 450px) {
    .change-value {
        font-size: 20px;
        margin-bottom: -3px;
    }
    .change-arrow {
        font-size: 18px;
        margin-right: 7px;
    }
    .change-percent {
        font-size: 0.9em;
    }

    .value-unit {
        font-size: 12px;
    }

    .header-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 100%;
        text-align: center;
    }

    .health-status-header {
        margin: 0 !important;   
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }

    .value-arrow-container {
        justify-content: center;
        display: flex;
        align-items: center;
    }

    .change-container {
        justify-content: center;
        text-align: center;
    }

    .graph-header{
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .graph-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }


    .terminal-dropdown{
        width: 95% !important;
        margin-top: 5px;
        margin-bottom: 10px;
    }

}




.change-percent {
    font-size: 0.95em;
    letter-spacing: .5px;
    color: #888 !important;
}

.change-container.positive .change-value,
.change-container.positive .change-arrow {
    color: #27ae60; 
}

.change-container.negative .change-value,
.change-container.negative .change-arrow {
    color: #e74c3c;
}

.graph-controls {
    display: flex;
    align-items: center;
}

/* --- Time Range Buttons --- */
.time-range-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.time-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.time-btn:hover {
    background: #f5f5f5;
}

.time-btn.active {
    background: #1f77b4;
    color: white;
    border-color: #1f77b4;
}

/* --- Chart Type Buttons --- */
.chart-type-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-left: 15px; /* Default desktop margin */
}

/* Adjustment for when the buttons are stacked on mobile */
@media (max-width: 650px) {
    .chart-type-btns {
        margin-left: 0;
        margin-top: 5px;
    }
}

.chart-type-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    outline: none;
}

.chart-btn{
    outline: none;
    border: none;
}

.chart-type-btn:hover {
    background: #f5f5f5;
}

.chart-type-btn.active {
    background: #1f77b4;
    color: white;
    border-color: #1f77b4;
}

.chart-type-btn i {
    font-size: 14px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Comment and Footer --- */
.graph-comment {
    font-size: 14px;
    color: #555;
    margin: 30px 0;
    letter-spacing: .4px;
    padding: 0px 30px;
}

/* Reduce padding for the comment on mobile */
@media (max-width: 650px) {
    .graph-comment {
        padding: 0 5px; 
    }
}

.graph-footer {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
    text-align: right;
}

.data-source {
    font-weight: bold;
    color: #666;
}

.current-year {
    margin-left: 10px;
}


.health-status-header{
    margin-left: auto;
    margin-right: 15px;
    font-size: 1rem;
    font-weight: bold;
}