/**
 * i18n styles – LTR overrides, language toggle, Inter font
 */

/* ── Inter font for English mode ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Language toggle button ── */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 28px;
    padding: 0 8px;
    border-radius: 14px;
    border: 1px solid var(--border-color, #2a2a3a);
    background: var(--bg-tertiary, #1a1a25);
    color: var(--text-secondary, #94a3b8);
    font-family: 'Inter', 'Heebo', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-toggle:hover {
    background: var(--bg-hover, #252535);
    border-color: var(--accent-primary, #6366f1);
    color: var(--text-primary, #f8fafc);
}

/* ── Mobile top-bar toggle adjustments ── */
.top-bar .lang-toggle {
    border-color: var(--border, #2a2a3a);
    background: transparent;
    margin-right: 4px;
}

/* ── Mobile info button ── */
.info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--accent, #6366f1);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent, #6366f1);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.info-toggle:active {
    background: rgba(99, 102, 241, 0.3);
    transform: scale(0.92);
}

/* ── About bottom sheet content ── */
.about-sheet h3 {
    font-size: 1rem;
    margin: 16px 0 8px;
    color: var(--text-primary, #f0f0f5);
}

.about-sheet h3:first-child {
    margin-top: 0;
}

.about-sheet p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 8px;
}

.about-sheet a {
    color: var(--accent, #6366f1);
    text-decoration: none;
}

.about-sheet a:hover {
    text-decoration: underline;
}

.about-sheet .bmc-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #FFDD00;
    color: #000;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 8px;
}

.about-sheet .bmc-inline img {
    width: 20px;
    height: 20px;
}

/* ── LTR overrides ── */
[dir="ltr"] {
    text-align: left;
}

/* Desktop nav – flip margins */
[dir="ltr"] .view-switcher {
    direction: ltr;
}

/* Election pills – flip auto-margin side */
[dir="ltr"] .election-pills {
    margin-right: 0;
    margin-left: auto;
}

/* Desktop election cards – flip flow arrow */
[dir="ltr"] .flow-arrow {
    transform: scaleX(-1);
}

[dir="ltr"] .nav-arrow {
    transform: scaleX(-1);
    display: inline-block;
}

/* Desktop footer – flip methodology padding */
[dir="ltr"] .methodology-section ul {
    padding-right: 0;
    padding-left: 24px;
}

/* Desktop modal close – flip position */
[dir="ltr"] .modal-close {
    left: auto;
    right: 16px;
}

/* Desktop methodology link – flip margin */
[dir="ltr"] .methodology-link {
    margin-right: 0;
    margin-left: 8px;
}

/* nav-sep kept for backwards compat */
.nav-sep {
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
    margin: 0 0.1rem;
    align-self: center;
}

/* ── Shared BMC button ── */
.bmc-button {
    position: fixed;
    bottom: 18px;
    left: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 90px;
    padding: 12px 8px;
    background: #FFDD00;
    border-radius: 12px;
    color: #000;
    font-family: 'Heebo', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 9999;
}

.bmc-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.bmc-button .bmc-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.bmc-button img {
    width: 28px;
    height: 28px;
}

.bmc-button span {
    font-size: 0.7rem;
    line-height: 1.3;
    text-align: center;
}

.bmc-close {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: #333;
    color: #fff;
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.bmc-button:hover .bmc-close {
    opacity: 0.8;
}

.bmc-close:hover {
    opacity: 1 !important;
    background: #555;
}

/* BMC button – flip position */
[dir="ltr"] .bmc-button {
    left: auto;
    right: 18px;
}

[dir="ltr"] .bmc-close {
    right: auto;
    left: -6px;
}

/* Desktop legend – flip alignment */
[dir="ltr"] .legend-container.legend-from {
    text-align: left;
}

[dir="ltr"] .legend-container.legend-to {
    text-align: right;
}

/* Mobile: transition pills flip */
[dir="ltr"] .transition-pills {
    margin-right: 0;
    margin-left: auto;
}

/* d'Hondt: flip vote adjust buttons */
[dir="ltr"] .vote-adjust-btns.right {
    order: -1;
}

[dir="ltr"] .vote-adjust-btns.left {
    order: 1;
}

/* Search input placeholder direction */
[dir="ltr"] .search-input {
    text-align: left;
}

/* Tooltip direction */
[dir="ltr"] .tooltip {
    direction: ltr;
    text-align: left;
}

/* Scatter axis controls */
[dir="ltr"] .axis-controls {
    direction: ltr;
}
