/* === BBA Berater-Karte Frontend Styles === */

.bba-karte-wrapper {
    position: relative;
    font-family: sans-serif;
    clear: both;
}

@media (min-width: 768px) {
    .bba-karte-wrapper {
        display: grid;
        grid-template-columns: 1fr 275px;
    }
}

/* === Mobile Selectors === */
.bba-mobile-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.bba-mobile-selector select {
    width: 100%;
    padding: 8px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

/* Desktop: hide mobile selectors, show map */
@media (min-width: 768px) {
    .bba-mobile-selector {
        display: none;
    }
}

/* === Map Container === */
#bba-karte {
    display: none;
    position: relative;
    min-height: 508px;
    min-width: 400px;
    max-width: 640px;
    overflow: hidden;
}

@media (min-width: 768px) {
    #bba-karte {
        display: block;
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0 auto 0 10%;
    }
    .bba-panel {
        font-family: sans-serif;
        grid-column: 2;
        grid-row: 1;
        z-index: 1;
    }
}

#bba-karte img {
    border: none;
    margin: 0;
}

#bba-bayern {
    width: 400px;
    height: 404px;
    margin: 0;
    transform-origin: 0 0;
    transition: 0.3s ease-in;
}

.bba-overlay {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

#bba-kartemaps {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* === Panel Title === */
.bba-panel-title {
    color: #fff;
    font-weight: bold;
    background: #7aa228;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px 6px 0 0;
}

/* === PLZ Search === */
.bba-plz-search {
    padding: 8px 10px;
    background: #f5f7f0;
    border-bottom: 1px solid #e0e0e0;
}

/* === Region Label (result indicator) === */
.bba-panel-region {
    color: #fff;
    font-weight: bold;
    text-transform: capitalize;
    background: #7aa228;
    padding: 8px 10px;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.bba-plz-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

#bba-plz-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#bba-plz-input:focus {
    border-color: #7aa228;
    box-shadow: 0 0 0 2px rgba(122, 162, 40, 0.15);
}

#bba-plz-input::placeholder {
    color: #999;
}

#bba-plz-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    line-height: 1;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

#bba-plz-clear:hover {
    background: #eee;
    color: #333;
}

.bba-plz-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    min-height: 16px;
}

/* === Person Cards === */
.bba-person {
    background: white;
    transition: all 0.2s ease;
    padding: 6px 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
}

.bba-person.active {
    padding: 10px 14px;
}

@media (min-width: 768px) {
    .bba-person:hover {
        background: #fafcf5;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }
    .bba-person.active {
        background: white !important;
        border-left-color: #7aa228;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        transform: translateX(-20px);
    }
}

/* === Person Details (slide-down) === */
.bba-person-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.bba-person.active .bba-person-details {
    max-height: 400px;
}

/* === Person Name === */
.bba-person-name {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 1px 0;
    position: relative;
    line-height: 1.3;
}

.bba-person-name > span:first-child {
    flex: 1;
}

.bba-person-name::after {
    content: '\203A';
    font-size: 14px;
    color: #aaa;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    line-height: 1;
}

.bba-person.active .bba-person-name::after {
    transform: rotate(90deg);
    color: #7aa228;
}

.bba-person.active .bba-person-name > span:first-child {
    font-weight: 600;
    color: #333;
}

/* === Badge === */
.bba-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f4e4;
    color: #5a7a1a;
    white-space: nowrap;
    line-height: 1.4;
    margin-top: 6px;
}

/* === Person Header (Avatar + Address) === */
.bba-person-header {
    display: flex;
    gap: 12px;
    padding: 10px 0 8px;
    align-items: flex-start;
}

/* === Avatar === */
.bba-person-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
}

.bba-person-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === Address === */
.bba-person-address {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    padding-top: 4px;
}

/* === Contact Details === */
.bba-person-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.bba-contact-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.bba-contact-label {
    color: #888;
    font-size: 11px;
    min-width: 48px;
    flex-shrink: 0;
}

.bba-contact-row a {
    color: #7aa228;
    text-decoration: none;
    transition: color 0.15s;
}

.bba-contact-row a:hover {
    color: #5a7a1a;
    text-decoration: underline;
}

/* Contact row icons via label prefix */
.bba-telefon .bba-contact-label::before {
    content: '\260E\00a0';
}

.bba-mobil .bba-contact-label::before {
    content: '\1F4F1\00a0';
}

.bba-email .bba-contact-label::before {
    content: '\2709\00a0';
}

.bba-fax .bba-contact-label::before {
    content: '\1F4E0\00a0';
}

/* === Geschäftsstelle === */
.bba-geschaeftsstelle {
    margin-top: 15px;
}

.bba-gs-title {
    color: #fff;
    font-weight: bold;
    text-transform: capitalize;
    background: #7aa228;
    padding: 10px;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    border-radius: 6px 6px 0 0;
}

/* Geschäftsstelle highlight when no Berater found */
.bba-gs-highlight {
    animation: bba-gs-pulse 0.4s ease;
}

.bba-gs-highlight .bba-gs-title {
    background: #5a8a0a;
    box-shadow: 0 2px 12px rgba(122, 162, 40, 0.3);
}

@keyframes bba-gs-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* === Tooltip === */
.bba-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 100;
    transition: opacity 0.15s;
}
