/* PREMIUM LIGHT-GREY ATHLETIC AESTHETIC - STYLES.CSS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Color System - Premium Light Grey matching runningwithrock.com */
    --bg-main: #F7F8F9;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    
    --text-primary: #222222;
    --text-secondary: #575760;
    --text-muted: #8E8E93;
    
    --color-accent: #1E73BE;      /* Running with Rock Athletic Blue */
    --color-active: #1E73BE;      /* Active blue state */
    --color-success: #10B981;     /* Emerald Green */
    --color-pr: #D97706;          /* Deep Gold */
    --color-bq: #2563EB;          /* Athletic Blue */
    --color-danger: #EF4444;      /* Red */
    
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    
    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles & Reset */
.rre-widget-container {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.rre-widget-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Scrollbar styling inside widget */
.rre-widget-container ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.rre-widget-container ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}
.rre-widget-container ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
.rre-widget-container ::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* Header Section */
.rre-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 16px;
}

.rre-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #4F46E5);
    border-radius: 2px;
}

.rre-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 50%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.rre-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Stats Bar */
.rre-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.rre-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.rre-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.rre-stat-card:hover::before {
    transform: translateX(100%);
}

.rre-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(30, 115, 190, 0.2);
    box-shadow: 0 4px 20px rgba(30, 115, 190, 0.05);
}

.rre-stat-val {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rre-stat-val.accent { color: var(--color-accent); }
.rre-stat-val.gold { color: var(--color-pr); }
.rre-stat-val.blue { color: var(--color-bq); }

.rre-stat-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Layout Grid */
.rre-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .rre-layout {
        grid-template-columns: 1fr;
    }
}

/* Filters Panel */
.rre-filters-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--glass-shadow);
}

.rre-filter-section-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 4px;
}

.rre-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rre-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rre-input, .rre-select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.rre-input::placeholder {
    color: var(--text-muted);
}

.rre-input:focus, .rre-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(30, 115, 190, 0.15);
}

/* Custom Checkbox Container */
.rre-checkbox-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 4px;
}

.rre-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.rre-checkbox-label:hover {
    color: var(--text-primary);
}

.rre-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-input);
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.rre-checkbox:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.rre-checkbox:checked::after {
    content: '✓';
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
}

.rre-reset-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    margin-top: 8px;
}

.rre-reset-btn:hover {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.05);
}

/* Tabs System */
.rre-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 8px;
}

.rre-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rre-tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.03);
}

.rre-tab-btn.active {
    color: var(--color-accent);
    background-color: rgba(30, 115, 190, 0.08);
}

/* Main Display Area */
.rre-main-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rre-view-content {
    display: none;
}

.rre-view-content.active {
    display: block;
}

/* SVG CHARTS CONTAINER */
.rre-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.rre-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: var(--glass-shadow);
}

.rre-chart-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rre-chart-legend {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rre-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.rre-svg-canvas {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Chart Tooltip - Standard dark tooltip overlay matching premium operating systems */
.rre-chart-tooltip {
    position: fixed;
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: #FFFFFF;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    transition: opacity 0.15s ease;
    opacity: 0;
    white-space: normal;
    max-width: 240px;
    width: 240px;
}

/* Scatter plot point hover styling */
.rre-scatter-dot {
    transition: r 0.2s, fill-opacity 0.2s;
    cursor: pointer;
}
.rre-scatter-dot:hover {
    r: 7 !important;
    fill-opacity: 1 !important;
}

/* Bar Chart Hover */
.rre-bar-rect {
    transition: fill-opacity 0.2s;
    cursor: pointer;
}
.rre-bar-rect:hover {
    fill-opacity: 0.95 !important;
}

/* Report Cards Grid */
.rre-cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rre-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.rre-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.rre-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.rre-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 50%;
    max-width: 50%;
}

.rre-card-race {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rre-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rre-meta-sep {
    color: var(--text-muted);
}

.rre-subreddit-tag {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Outcome Badges */
.rre-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 50%;
    max-width: 50%;
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .rre-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .rre-card-title-group {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .rre-badges {
        flex: 1 1 100%;
        max-width: 100%;
        justify-content: flex-start;
    }
}

.rre-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rre-badge.time { background: rgba(30, 115, 190, 0.08); color: var(--color-accent); border: 1px solid rgba(30, 115, 190, 0.15); }
.rre-badge.time.success { background: rgba(16, 185, 129, 0.08); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.15); }
.rre-badge.time.unknown { background: rgba(217, 119, 6, 0.08); color: var(--color-pr); border: 1px solid rgba(217, 119, 6, 0.15); }
.rre-badge.time.danger { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.15); }
.rre-badge.pr { background: rgba(16, 185, 129, 0.08); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.15); }
.rre-badge.bq { background: rgba(16, 185, 129, 0.08); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.15); }
.rre-badge.goal { background: rgba(16, 185, 129, 0.08); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.15); }
.rre-badge.miles { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); border: 1px solid var(--border-color); }
.rre-badge.pacing { background: rgba(16, 185, 129, 0.08); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.15); }
.rre-badge.danger { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.15); }
.rre-badge.shoe { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); border: 1px solid var(--border-color); }
.rre-badge.plan { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); border: 1px solid var(--border-color); }

/* Quick Highlight Summary */
.rre-summary-block {
    background: rgba(0, 0, 0, 0.015);
    border-left: 3px solid var(--color-accent);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Expandable Section */
.rre-expand-btn {
    background: transparent;
    border: none;
    color: var(--color-accent);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    outline: none;
    transition: var(--transition-smooth);
}

.rre-expand-btn:hover {
    color: var(--text-primary);
}

.rre-expand-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.rre-card.expanded .rre-expand-icon {
    transform: rotate(180deg);
}

.rre-expanded-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.rre-card.expanded .rre-expanded-content {
    max-height: 800px;
    opacity: 1;
}

.rre-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.rre-detail-item {
    font-size: 0.82rem;
}

.rre-detail-label {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 2px;
}

.rre-detail-value {
    color: var(--text-primary);
}

/* Takeaways list */
.rre-takeaways-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rre-takeaway-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-pr);
    margin-bottom: 4px;
}

.rre-takeaway-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rre-takeaway-item {
    font-size: 0.82rem;
    line-height: 1.4;
    padding-left: 20px;
    position: relative;
    color: var(--text-primary);
}

.rre-takeaway-item::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent);
}

.rre-card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.rre-permalink-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.rre-permalink-btn:hover {
    color: var(--color-accent);
}

/* Pagination Control */
.rre-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.rre-page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: var(--glass-shadow);
}

.rre-page-btn:hover:not(:disabled) {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.rre-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rre-page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Empty State / No Results */
.rre-empty-state {
    text-align: center;
    padding: 48px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    box-shadow: var(--glass-shadow);
}

.rre-empty-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Loading Overlay */
.rre-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
}

.rre-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(30, 115, 190, 0.1);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@media (prefers-reduced-motion: reduce) {
    .rre-spinner {
        animation: none;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================== */
/* CUSTOM MULTI-SELECT DROPDOWN STYLING */
/* ========================================== */
.rre-multiselect-wrapper {
    position: relative;
    width: 100%;
}

.rre-ms-trigger {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: var(--transition-smooth);
    outline: none;
}

.rre-ms-trigger:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

.rre-multiselect-wrapper.open .rre-ms-trigger {
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(30, 115, 190, 0.15);
}

.rre-ms-selected-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90%;
}

.rre-ms-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.rre-multiselect-wrapper.open .rre-ms-arrow {
    transform: rotate(180deg);
}

.rre-ms-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 50;
    padding: 6px 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.rre-multiselect-wrapper.open .rre-ms-dropdown {
    display: block;
}

.rre-ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.rre-ms-option:hover {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.rre-ms-option input[type="checkbox"] {
    appearance: none;
    background-color: transparent;
    margin: 0;
    font: inherit;
    color: var(--color-accent);
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid #B2B2BE;
    border-radius: 0.15em;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rre-ms-option input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: var(--color-accent);
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.rre-ms-option input[type="checkbox"]:checked {
    border-color: var(--color-accent);
}

.rre-ms-option input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Premium Fullscreen Chart Overlay Modal */
.rre-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(247, 248, 249, 0.85); /* Premium Light Backdrop matching theme */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rre-chart-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.rre-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: calc((90vh - 80px) * 1.5 + 40px); /* Mathematically balances the card width to match a perfect 1.5x height body */
    height: 90vh;
    max-width: 95vw;
    max-height: 95vh;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.rre-chart-modal.open .rre-modal-content {
    transform: scale(1);
}

.rre-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    padding-left: 50px;  /* Aligns perfectly with the 50px left padding of the chart (Y-axis) */
    padding-right: 20px; /* Aligns perfectly with the 20px right padding of the chart (Right boundary) */
}

.rre-modal-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rre-modal-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rre-modal-close:hover {
    color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.08);
}

.rre-modal-body {
    flex: 1;
    width: 100%;
    height: 100%;
    aspect-ratio: 1.5 / 1; /* Enforces a perfect 3:2 rectangular container matching our dynamic dimensions */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.rre-modal-body svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

/* Premium Maximize Button Styling */
.rre-chart-expand-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    font-size: 1.05rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.rre-chart-expand-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background-color: rgba(30, 115, 190, 0.05);
}
