@font-face {
    font-family: 'Futura';
    src: url('/assets/fonts/futura-std/FuturaStd-Book.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Futura';
    src: url('/assets/fonts/futura-std/FuturaStd-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Open Dyslexic Propo';
    src: url('/assets/fonts/opendyslexic-propo/OpenDyslexicNerdFontPropo-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Open Dyslexic Propo';
    src: url('/assets/fonts/opendyslexic-propo/OpenDyslexicNerdFontPropo-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

:root {
    --current-font: 'Futura';
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    /* Basic background fallback just in case Mielo doesn't set it */
    background-color: #fafafa;
    color: var(--mie-text-fg, #242424);
}
@media (prefers-color-scheme: dark) {
    body {
        background-color: #242424;
    }
}

.mie.window {
    width: 400px;
    max-width: 90vw;
    height: auto;
    max-height: 90vh;
    border: 1px solid #cdc7c2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
@media (prefers-color-scheme: dark) {
    .mie.window {
        border-color: #1e1e1e;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
}

* {
    font-family: var(--current-font), system-ui, sans-serif !important;
}

.content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    justify-content: center;
    height: 100%;
}

/* Candidate voting list typography fixes */
.mie.row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    cursor: pointer;
}

.candidate-content {
    padding: 8px 4px;
    width: 100%;
}

.candidate-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 16px;
    color: var(--mie-text-fg, #242424) !important;
}

.candidate-block p, 
.candidate-block div, 
.candidate-block span {
    font-size: 14px;
    color: var(--mie-text-fg-muted, #777) !important;
    margin: 0;
}

.candidate-block a {
    color: var(--mie-text-fg, #242424);
    text-decoration: underline;
    font-size: 14px;
}


/* Modal Overlay & Dialog tweaks */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dialog-title {
    margin: 0;
    font-size: 20px;
}

.error-text {
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    font-weight: bold;
    color: #e01b24;
}

.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.results-list li.result-item {
    padding: 12px;
    background: #ebebeb;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
@media (prefers-color-scheme: dark) {
    .results-list li.result-item {
        background: #303030;
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
}

.result-name {
    color: inherit;
}

.result-votes {
    color: #5e5e5e;
    font-size: 13px;
}
@media (prefers-color-scheme: dark) {
    .result-votes { color: #9e9e9e; }
}

.result-bar-container {
    height: 8px;
    width: 100%;
    background-color: #cdc7c2;
    border-radius: 4px;
    overflow: hidden;
}
@media (prefers-color-scheme: dark) {
    .result-bar-container { background-color: #1e1e1e; }
}

.result-bar {
    height: 100%;
    background-color: #3584e4;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Font Toggle Button */
.font-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 1px solid #cdc7c2;
    background: #ebebeb;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--current-font), sans-serif !important;
    font-size: 14px;
    color: #242424;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1000;
}
@media (prefers-color-scheme: dark) {
    .font-toggle-btn {
        border-color: #1e1e1e;
        background: #303030;
        color: #ffffff;
    }
}

.font-toggle-btn:hover {
    background-color: #d6d6d6;
}
@media (prefers-color-scheme: dark) {
    .font-toggle-btn:hover {
        background-color: #3a3a3a;
    }
}

.font-toggle-btn .tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 4px 8px;
    background-color: #242424;
    color: #fafafa;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    font-family: var(--current-font), sans-serif !important;
}
@media (prefers-color-scheme: dark) {
    .font-toggle-btn .tooltip {
        background-color: #fafafa;
        color: #242424;
    }
}

.font-toggle-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}
