/* Dashboard Styles */

/* Sticky dashboard header */
.dashboard-container {
    position: relative;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.ma-toggle-btn {
    padding: 5px 10px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    background-color: #ffffff;
    color: #444;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.ma-toggle-btn:hover {
    transform: translateY(-1px);
    background-color: #f6f8fa;
    border-color: rgba(0,0,0,0.12);
}

.ma-toggle-btn.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(33,150,243,0.12);
}

.ma-toggle-btn.active:hover {
    transform: translateY(-1px) scale(1.01);
}

/* Subtle tweaks for section headings and spacing to improve hierarchy */
.section-header h3 {
    font-size: 20px;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.chart-controls {
    align-items: center;
}

/* Section header styles */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    margin-right: 10px;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px;
    color: #666;
    transition: color 0.2s;
    line-height: 1;
}

.toggle-btn:hover {
    color: #333;
}

/* Historical Price Chart styles */
.chart-section {
    margin-top: 0;
    margin-bottom: 20px;
}

.option-chart-section {
    margin-bottom: 20px;
}

.chart-container {
    width: 100%;
    height: 240px; /* reduced ~20% from 300px */
    min-height: 120px;
    max-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #fff;
    position: relative;
    resize: vertical;
    overflow: hidden;
}

#historicalPriceChart,
#optionHistoricalChart,
.option-historical-chart {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

/* Two-column dashboard layout: left column for quick info, right column for chart */
.dashboard-content {
    display: grid;
    grid-template-columns: minmax(240px, 25%) minmax(560px, 75%);
    gap: 20px;
    align-items: start;
    width: 100%;
    min-height: 560px;
}

/* Left column wrapper that groups non-graphical dashboard sections */
.dashboard-content .dashboard-left {
    grid-column: 1 / 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Dark themed left column */
.dashboard-content .dashboard-left {
    background: #2b2f6b; /* deep indigo/purple */
    color: #d1d5db; /* light grey text */
    padding: 18px;
    border-radius: 10px;
}

/* Make section headers and toggle buttons readable on dark background */
.dashboard-left .section-header h3 {
    color: #e6e6ea;
}
.dashboard-left .toggle-btn {
    color: #d1d5db;
}

/* Subtle card background inside left column for contrast */
.dashboard-left .section-content {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 10px;
    border-radius: 8px;
}

.dashboard-left .section-content .fundamental-card,
.dashboard-left .section-content .technical-card,
.dashboard-left .section-content .performance-card,
.dashboard-left .section-content .risk-card,
.dashboard-left .section-content .eqty-market-card,
.dashboard-left .section-content .eqty-option-card {
    background: transparent;
    box-shadow: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color-light);
}

.dashboard-left .section-content .eqty-option-card:last-child {
    border-bottom: none;
}

.option-info {
    flex: 1;
}

.eqty-option-category {
    margin: 1rem 0;
}

.eqty-option-category h4 {
    margin-bottom: 0.5rem;
}

.eqty-option-category-list h5 {
    margin: 0.75rem 0 0.25rem;
}

.option-activate-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.option-activate-btn:hover {
    background: var(--primary-color-dark);
}

.dashboard-content .chart-section {
    grid-column: 2 / 3;
    grid-row: 1 / -1;
}

.dashboard-content .dashboard-section:not(.chart-section) {
    grid-column: 1 / 2;
}

.chart-container {
    min-height: 384px; /* reduced ~20% from 480px */
    max-height: 640px; /* reduced ~20% from 800px */
}

.chart-section .chart-container {
    height: 480px;
    min-height: 480px;
    max-height: 720px;
}

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

.dashboard-content.chart-fullwidth .dashboard-section:not(.chart-section) {
    display: none;
}

.dashboard-content.chart-fullwidth .chart-section {
    grid-column: 1 / -1;
}

.expand-btn {
    margin-left: 8px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
}

.expand-btn:hover {
    color: #333;
}
