/* =========================================================================
   Cheaper-Alternatives Banner & Nearby-Stations Block
   Styles für die Detailseite einer Ladestation.
   Design-Sprache lehnt sich an die LadeSofort Flutter-App an.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1) "Günstiger in der Nähe" Banner (im Tab "Details")
   ------------------------------------------------------------------------- */

.cheaper-alt {
    --ca-accent: #10B981;
    --ca-accent-dark: #059669;
    --ca-bg: #ECFDF5;
    --ca-border: #A7F3D0;
    --ca-text: #064E3B;

    background:
        linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%) !important;
    border: 1px solid var(--ca-border) !important;
    border-radius: 16px !important;
    padding: 18px !important;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
}

.cheaper-alt__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.cheaper-alt__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ca-accent) !important;
    color: #ffffff !important;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.cheaper-alt__icon svg {
    width: 24px;
    height: 24px;
}

.cheaper-alt__title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cheaper-alt__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ca-text) !important;
    margin: 0;
    line-height: 1.2;
}

.cheaper-alt__subtitle {
    font-size: 0.8125rem;
    color: #047857 !important;
    margin: 0;
    line-height: 1.2;
}

.cheaper-alt__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.cheaper-alt__chip {
    appearance: none;
    border: 1px solid var(--ca-border);
    background: #ffffff;
    color: var(--ca-text);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cheaper-alt__chip:hover {
    background: #ffffff;
    border-color: var(--ca-accent);
    transform: translateY(-1px);
}

.cheaper-alt__chip.is-active {
    background: var(--ca-accent);
    border-color: var(--ca-accent);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.cheaper-alt__panels {
    position: relative;
}

.cheaper-alt__card {
    display: none;
    position: relative;
    background: #ffffff !important;
    border: 1px solid var(--ca-border) !important;
    border-radius: 12px;
    padding: 14px 44px 14px 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cheaper-alt__card.is-active {
    display: block;
}

.cheaper-alt__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.18);
    border-color: var(--ca-accent) !important;
}

.cheaper-alt__card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a !important;
    margin-bottom: 8px;
    line-height: 1.3;
}

.cheaper-alt__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.cheaper-alt__pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #F1F5F9;
    color: #334155;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.cheaper-alt__pill--connector {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    padding: 3px 10px 3px 6px;
}

.cheaper-alt__pill-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.cheaper-alt__pill-svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.cheaper-alt__price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cheaper-alt__price {
    color: var(--ca-accent-dark) !important;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.cheaper-alt__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--ca-accent);
    color: #ffffff !important;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.cheaper-alt__chevron {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--ca-accent) !important;
    display: flex;
    align-items: center;
}


/* -------------------------------------------------------------------------
   2) "Ladestationen in der Nähe" – Block am Seitenende
      (innerhalb des Container-Wrappers, daher gleiche Breite wie Tabs+Sidebar)
   ------------------------------------------------------------------------- */

.nearby-stations {
    margin-top: 2.5rem !important;
    margin-bottom: 2.5rem !important;
    padding-top: 1.75rem !important;
    border-top: 1px solid #E2E8F0 !important;
    color: #0f172a !important;
}

.nearby-stations__head {
    margin-bottom: 1.5rem !important;
}

.nearby-stations__title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 0.5rem 0 !important;
    line-height: 1.2 !important;
}

.nearby-stations__subtitle {
    color: #475569 !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
}

.nearby-stations__grid {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .nearby-stations__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .nearby-stations__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.nearby-stations__item {
    display: flex !important;
    list-style: none !important;
}

/* Karten-Wrapper: Grid – Name-Block + Bild oben, Connector-Liste unten Vollbreite */
.nearby-station-card {
    display: grid !important;
    grid-template-columns: 1fr 96px;
    grid-template-areas:
        "head  media"
        "points points"
        "rating rating";
    gap: 10px 12px;
    width: 100% !important;
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 14px !important;
    padding: 14px !important;
    color: #0f172a !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nearby-station-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
    border-color: #10B981 !important;
}

.nearby-station-card:hover .nearby-station-card__media img {
    transform: scale(1.04);
}

.nearby-station-card__head {
    grid-area: head;
    min-width: 0;
}

.nearby-station-card__points {
    grid-area: points;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nearby-station-card__rating {
    grid-area: rating;
}

/* Bild rechts oben (mit kleinem Distance-Pill als Overlay) */
.nearby-station-card__media {
    position: relative;
    grid-area: media;
    width: 96px;
    height: 96px;
    border-radius: 10px;
    overflow: hidden;
    background: #F1F5F9;
}

.nearby-station-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.nearby-station-card__media.is-placeholder img {
    object-fit: cover;
    padding: 0;
    opacity: 0.55;
}

.nearby-station-card__name-block {
    min-width: 0;
}

.nearby-station-card__name {
    margin: 0 0 2px 0 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nearby-station-card__operator {
    color: #64748b !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    margin-bottom: 4px;
}

.nearby-station-card__distance {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #047857 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.nearby-station-card__distance svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.nearby-station-card__address {
    color: #64748b !important;
    font-size: 0.8125rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

/* Mini-Card pro Connector-Gruppe */
.ns-cp {
    display: grid !important;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #F8FAFC !important;
    border: 1px solid #EEF2F6 !important;
    border-radius: 10px;
    color: #0f172a !important;
}

.ns-cp__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 7px;
    flex-shrink: 0;
}

.ns-cp__icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.ns-cp__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.ns-cp__name {
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-cp__meta {
    font-size: 0.7rem !important;
    color: #64748b !important;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-cp__current {
    color: #475569 !important;
    font-weight: 600 !important;
}

.ns-cp__dot {
    color: #CBD5E1 !important;
    margin: 0 2px;
}

.ns-cp__price {
    color: #059669 !important;
    font-weight: 700 !important;
}

.ns-cp__live,
.ns-cp__count {
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.ns-cp__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.ns-cp__live--available {
    background: #ECFDF5 !important;
    color: #047857 !important;
    border-color: #A7F3D0 !important;
}

.ns-cp__live--partial {
    background: #FFFBEB !important;
    color: #B45309 !important;
    border-color: #FDE68A !important;
}

.ns-cp__live--busy {
    background: #FEF2F2 !important;
    color: #B91C1C !important;
    border-color: #FECACA !important;
}

.ns-cp__live--offline {
    background: #F1F5F9 !important;
    color: #64748B !important;
    border-color: #CBD5E1 !important;
}

.ns-cp__live.is-live .ns-cp__live-dot {
    animation: nearby-live-pulse 1.6s ease-in-out infinite;
}

.ns-cp__count {
    background: #F1F5F9 !important;
    color: #475569 !important;
    border-color: #E2E8F0 !important;
    padding: 3px 9px;
    font-weight: 700 !important;
}

.nearby-station-card__rating {
    display: block !important;
    color: #475569 !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    line-height: 1;
    padding-top: 10px;
    border-top: 1px dashed #E2E8F0;
}

.nearby-station-card__rating > * {
    vertical-align: middle;
    margin-right: 4px;
}

.nearby-station-card__rating > *:last-child {
    margin-right: 0;
}

.nearby-station-card__rating-value {
    color: #1E293B !important;
    font-weight: 700 !important;
}

.nearby-station-card__rating-count {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

/* Visuelle 5-Sterne-Anzeige (gestapelte SVG-Layer für saubere Halb-Sterne) */
.nearby-stars {
    position: relative;
    display: inline-block;
    width: 78px;       /* 5 * 14px Sterne + 4 * 2px Lücken = 78px */
    height: 14px;
    line-height: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

.nearby-stars__back,
.nearby-stars__front {
    display: block;
    width: 100%;
    height: 14px;
    line-height: 0;
    white-space: nowrap;
}

.nearby-stars__back {
    color: #E2E8F0 !important;
}

.nearby-stars__front {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    color: #FBBF24 !important;
}

.nearby-stars svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    margin-right: 2px;
    flex-shrink: 0;
    vertical-align: top;
}

.nearby-stars__back svg:last-child,
.nearby-stars__front svg:last-child {
    margin-right: 0;
}

/* Live-Verfügbarkeits-Badge */
.nearby-station-card__live {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    line-height: 1.2;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.nearby-station-card__live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    flex-shrink: 0;
}

.nearby-station-card__live--available {
    background: #ECFDF5 !important;
    color: #047857 !important;
    border-color: #A7F3D0 !important;
}

.nearby-station-card__live--partial {
    background: #FFFBEB !important;
    color: #B45309 !important;
    border-color: #FDE68A !important;
}

.nearby-station-card__live--partial .nearby-station-card__live-dot {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.nearby-station-card__live--busy {
    background: #FEF2F2 !important;
    color: #B91C1C !important;
    border-color: #FECACA !important;
}

.nearby-station-card__live--busy .nearby-station-card__live-dot {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.nearby-station-card__live--offline {
    background: #F1F5F9 !important;
    color: #64748B !important;
    border-color: #CBD5E1 !important;
}

.nearby-station-card__live--offline .nearby-station-card__live-dot {
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.18);
}

.nearby-station-card__live--points {
    background: #F8FAFC !important;
    color: #475569 !important;
    border-color: #E2E8F0 !important;
}

.nearby-station-card__live--points .nearby-station-card__live-dot {
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

/* Pulse nur bei echten Live-Daten */
.nearby-station-card__live.is-live .nearby-station-card__live-dot {
    animation: nearby-live-pulse 1.6s ease-in-out infinite;
}

@keyframes nearby-live-pulse {
    0%, 100% { transform: scale(1);   opacity: 1;   }
    50%      { transform: scale(1.3); opacity: 0.7; }
}
