html,
body {
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #222;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

header {
    padding: 20px 24px 12px;
    background: #0f172a;
    color: #fff;
    display: flex;
}

header img {
    margin: 0;
    width: 80px;
}

header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    padding: 10px;
}

header p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.72);
}

.map-toolbar {
    padding: 0 20px 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.mode-toggle {
    display: inline-flex;
    gap: 12px;
    padding: 6px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    background: #f8fafc;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.mode-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    direction: rtl;
}

.mode-option input[type="radio"] {
    accent-color: #1d4ed8;
}

.map-layout {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
}

#map {
    flex: 1;
    min-height: 600px;
    border-radius: 8px;
    overflow: hidden;
}

#info-panel {
    width: 320px;
    max-width: 40vw;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    direction: rtl;
}

#info-panel h4 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

#info-content {
    flex: 1;
    overflow-y: auto;
}

#info-content .placeholder {
    margin: 0;
    color: #64748b;
}

#info-highlights {
    display: none;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-key {
    font-weight: 600;
    color: #0f172a;
    flex: 1;
}

.info-value {
    flex: 1;
    text-align: right;
    color: #334155;
    word-break: break-word;
}

#info-summary {
    margin: 0 0 12px;
    color: #475569;
    line-height: 1.6;
}

.panel-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.panel-field label {
    font-size: 12px;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-transform: uppercase;
    color: #0f172a;
}

.panel-select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.panel-select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}

.info-section {
    margin-top: 16px;
}

.info-section h5 {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0f172a;
}

#highlight-list,
#candidate-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#highlight-list li {
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
}

.candidate-item {
    padding: 10px 12px;
    background: #f1f5f9;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.candidate-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.candidate-item strong {
    display: block;
    font-weight: 600;
    color: #0f172a;
}

.candidate-modal {
    direction:rtl;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 999;
}

.candidate-modal.is-visible {
    display: flex;
}

.candidate-modal__content {
    position: relative;
    max-width: 420px;
    width: 100%;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.candidate-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    color: #f8fafc;
    font-size: 1.5rem;
    cursor: pointer;
}

.candidate-modal__header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.candidate-modal__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
}

.candidate-modal__subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: #cbd5f5;
}

.candidate-modal__section {
    background: rgba(30, 41, 59, 0.75);
    border-radius: 12px;
    padding: 1rem;
    line-height: 1.6;
}

.candidate-modal__section p {
    margin: 0 0 0.4rem;
}

.candidate-modal__section p:last-child {
    margin-bottom: 0;
}

.candidate-modal__bio {
    background: rgba(30, 41, 59, 0.55);
}

.candidate-item span {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-top: 2px;
}

.candidate-item .candidate-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #cbd5e1;
    margin-bottom: 6px;
}

.candidate-item.placeholder {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 0;
}

@media (max-width: 900px) {
    .map-layout {
        flex-direction: column;
    }

    #info-panel {
        width: 100%;
        max-width: none;
    }

    #map {
        min-height: 400px;
    }
}
