/* ==========================================================================
   MSB Stock Info - Main Layout
   ========================================================================== */
.msb-stock-info-wrapper {
    position: relative;
}

.msb-stock-info-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    font-family: inherit;
    width: 100%;
    margin: 0 auto;
}

/* --- Responsive Layout --- */
@media (max-width: 1024px) {
    .msb-stock-info-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }
    .msb-stock-grid-section {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .msb-stock-grid-section {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .msb-stock-grid-item {
        height: auto !important;
        min-height: 160px !important;
    }
    .grid-item-title {
        font-size: 14px !important;
    }
    .grid-item-value {
        font-size: 18px !important;
    }
}

/* ==========================================================================
   Chart Section
   ========================================================================== */
.msb-stock-chart-section {
    grid-column: span 2;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 420px;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.msb-stock-chart-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.msb-stock-chart-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.msb-chart-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.msb-chart-render-area {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.msb-chart-y-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 12px;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* --- Legend --- */
.msb-stock-legends {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

/* ==========================================================================
   Grid Section & Items
   ========================================================================== */
.msb-stock-grid-section {
    grid-column: span 4;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-content: flex-start;
}

.msb-stock-grid-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 202px; /* 202*2 + 16(gap) = 420px matching chart height */
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.msb-stock-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.grid-item-title {
    color: #666 !important;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 500;
    text-align: left;
    display: block;
}

.grid-item-value-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 10px;
}

.grid-item-value {
    font-size: 22px;
    font-weight: 600;
    color: #0b1a3d;
    line-height: 1.2;
}

.grid-item-unit {
    font-size: 14px;
    font-weight: 400;
    color: #777;
    margin-top: 4px;
}

/* ==========================================================================
   DatePicker (Bootstrap Datepicker & Custom Wrapper)
   ========================================================================== */
.msb-stock-date-picker-wrapper {
    margin-bottom: 24px;
}

.msb-datepicker-container {
    display: flex;
    align-items: center;
    border: 1.5px solid #E5EAF5;
    border-radius: 8px;
    padding: 0 8px;
    background: #fff;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    overflow: hidden; /* Prevent child overflow from masking border */
}

.msb-datepicker-container:hover {
    border-color: #D1D9E8;
}

.msb-stock-datepicker {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 16px;
    color: #333;
    width: 120px;
    background: transparent !important;
    cursor: pointer;
    padding: 0 !important;
    text-align: left;
    height: 44px; /* Match container height */
    line-height: 44px; /* Center text vertically */
    margin: 0;
}

.msb-stock-datepicker:focus {
    background: transparent !important;
}

.msb-stock-datepicker::placeholder {
    color: #AAB4C8;
}

.msb-datepicker-separator {
    color: #001538;
    font-weight: 500;
    margin: 0 12px;
    user-select: none;
    height: 44px;
    display: flex;
    align-items: center;
}

.msb-datepicker-container .calendar-icon {
    margin-left: auto;
    display: flex;
    align-items: center;
    color: #001538;
    cursor: pointer;
    padding-left: 12px;
}

/* --- Bootstrap Datepicker Theme Overrides --- */
.datepicker {
    position: absolute !important;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    font-family: inherit;
    z-index: 999999 !important;
    background: #fff;
    width: 250px !important; 
    max-width: 250px !important;
}

.datepicker-dropdown {
    top: 0;
    left: 0;
    padding: 4px;
}

/* Arrow orientation arrows */
.datepicker-dropdown.datepicker-orient-top:before {
    bottom: -7px; border-top: 7px solid rgba(0,0,0,0.15); border-bottom: 0;
}
.datepicker-dropdown.datepicker-orient-top:after {
    bottom: -6px; border-top: 6px solid #fff; border-bottom: 0;
}
.datepicker-dropdown.datepicker-orient-bottom:before {
    top: -7px; border-bottom: 7px solid rgba(0,0,0,0.15); border-top: 0;
}
.datepicker-dropdown.datepicker-orient-bottom:after {
    top: -6px; border-bottom: 6px solid #fff; border-top: 0;
}

/* .datepicker table tr td.active, 
.datepicker table tr td.active:hover {
    background-color: #00B14F !important;
    background-image: none;
    border-radius: 8px;
    color: #fff !important;
}

.datepicker table tr td.today {
    background-color: #f0f0f0;
    border-radius: 8px;
} */

/* ==========================================================================
   Loading & Skeletons
   ========================================================================== */
@keyframes msb-shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.msb-loading-text {
    opacity: 0.5;
}
