/* CommunityScale Chart Styles */

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/roboto-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/roboto-latin-ext-400.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
        U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
        U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
        U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/static/fonts/roboto-latin-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/static/fonts/roboto-latin-ext-500.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
        U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
        U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
        U+A720-A7FF;
}

/* Chart container */
.cs-chart {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Chart header */
.cs-chart-header {
    margin-bottom: 8px;
}

.cs-chart-title {
    font-size: 18px;
    font-weight: 500;
    color: #000000;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.cs-chart-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* Chart body (SVG container) */
#chart-body, [data-cs-role="body"] {
    width: 100%;
    min-height: 200px;
}

#chart-body svg, [data-cs-role="body"] svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Chart footer */
.cs-chart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 0;
}

.cs-chart-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 12px;
}

.cs-chart-actions a {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.cs-chart-actions a:hover {
    text-decoration: underline;
}

.cs-chart-actions .separator {
    color: #333;
    margin: 0 2px;
}

.cs-chart-brand {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #1a365d;
    text-decoration: none;
}

.cs-chart-brand:hover {
    text-decoration: underline;
}

/* Tooltip */
#tooltip, [data-cs-role="tooltip"] {
    position: absolute;
    display: none;
    background: rgba(255, 255, 255, 0.85);
    color: #000000;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    z-index: 1000;
    max-width: 250px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#tooltip strong, [data-cs-role="tooltip"] strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

/* Error state */
.cs-error {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Embed popup */
.cs-embed-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.cs-embed-popup.visible {
    display: flex;
}

.cs-embed-popup-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cs-embed-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cs-embed-popup-title {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
    margin: 0;
}

.cs-embed-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cs-embed-popup-close:hover {
    color: #333;
}

.cs-embed-code-wrapper {
    display: flex;
    gap: 8px;
}

.cs-embed-code {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    resize: none;
    height: 80px;
}

.cs-embed-copy {
    background: #1a365d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cs-embed-copy:hover {
    background: #2d4a7c;
}

.cs-embed-copy.copied {
    background: #2e7d32;
}

/* Download dropdown */
.cs-download-wrapper {
    position: relative;
    display: inline-block;
}

.cs-download-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    z-index: 100;
    padding: 4px 0;
}

.cs-download-menu.visible {
    display: block;
}

.cs-download-menu a {
    display: block;
    padding: 6px 12px;
    font-size: 12px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.cs-download-menu a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.cs-download-menu hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #eee;
}

/* Noscript fallback */
.cs-noscript {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    background: #f5f5f5;
    border-radius: 4px;
}
