/*!
 * ninetyone Info-Panel — Frontend
 * Version: 1.1.0
 */

/* ===================== PANEL ===================== */
.n91ip-panel {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 340px;
    max-height: 85vh;
    background: var(--n91ip-panel-bg, #f9f9f9);
    color: var(--n91ip-panel-fg, #333);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border-radius: 18px;
    /* Easing wird bei .is-animated überschrieben (smootheres open/close) */
    transition: right .35s ease, left .35s ease, bottom .35s ease, opacity .35s ease;
    z-index: 2147483000;
    overflow: hidden;
    overflow-y: auto;
}
.n91ip-panel.is-animated {
    transition: right .45s cubic-bezier(0.16, 1, 0.3, 1),
                left  .45s cubic-bezier(0.16, 1, 0.3, 1),
                bottom .45s cubic-bezier(0.16, 1, 0.3, 1),
                opacity .35s ease;
}

.n91ip-panel.n91ip-pos-right { right: -360px; left: auto; }
.n91ip-panel.n91ip-pos-left  { left: -360px;  right: auto; }
.n91ip-panel.n91ip-pos-right.is-open { right: 0; }
.n91ip-panel.n91ip-pos-left.is-open  { left: 0; }

/* ===================== CONTENT ===================== */
.n91ip-content {
    padding: 25px;
    font-size: 13px;
    line-height: 1.5;
}

.n91ip-section {
    display: none;
}
.n91ip-section.is-active {
    display: block;
}

.n91ip-section-heading {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--n91ip-heading-color, #143851);
    display: flex;
    align-items: center;
    gap: 8px;
}

.n91ip-section-body {
    margin-bottom: 12px;
}
.n91ip-section-body p:last-child {
    margin-bottom: 0;
}

/* Links im Section-Content */
.n91ip-section-body a {
    color: var(--n91ip-link-color, #143851);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .2s ease;
}
.n91ip-section-body a:hover,
.n91ip-section-body a:focus {
    color: var(--n91ip-link-hover-color, #e98946);
}

/* ===================== BUTTON ===================== */
/* Button — Optik (Farben/Rahmen/Radius/Padding/Hover) kommt aus dem geteilten .n91cs-btn-System
   (Normal/Outline). Hier nur die Info-Panel-eigenen Extras: Typo, Schatten, Lift-Effekt. */
.n91ip-btn {
    gap: 8px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: var(--n91ip-button-font-size, 14px);
    text-transform: var(--n91ip-button-text-transform, uppercase);
    letter-spacing: .5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
}
.n91ip-btn:hover,
.n91ip-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.n91ip-btn i {
    font-size: 1.2em;
}

/* ===================== TAB GROUP (DESKTOP) ===================== */
.n91ip-tab-group {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2147483000;
    transition: right .3s ease, left .3s ease;
}
.n91ip-tab-group.n91ip-pos-right { right: 20px; left: auto; }
.n91ip-tab-group.n91ip-pos-left  { left: 20px;  right: auto; }
.n91ip-tab-group.n91ip-pos-right.is-shifted { right: 360px; }
.n91ip-tab-group.n91ip-pos-left.is-shifted  { left: 360px; }

.n91ip-tab-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--n91ip-tab-bg, rgba(255,255,255,0.75)) !important;
    color: var(--n91ip-tab-fg, #143851) !important;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform .2s ease, background .25s ease, color .25s ease;
    border: none;
    outline: none;
    padding: 0;
    position: relative;
}

/* Glassmorph: Backdrop-Blur nur wenn aktiviert */
.n91ip-tab-group.is-glassmorph .n91ip-tab-item {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
.n91ip-tab-item:hover,
.n91ip-tab-item:focus,
.n91ip-tab-item.is-active {
    transform: scale(1.08);
    background: var(--n91ip-tab-bg-hover, var(--n91ip-tab-bg, rgba(255,255,255,0.95))) !important;
    color: var(--n91ip-tab-fg-hover, var(--n91ip-tab-fg, #143851)) !important;
}
.n91ip-tab-item .n91ip-tab-icon {
    font-size: 20px;
    line-height: 1;
}

/* ===================== STAGGERED FADE-IN (DESKTOP) ===================== */
@keyframes n91ip-tab-fade-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes n91ip-tab-fade-in-left {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.n91ip-tab-group.is-animated .n91ip-tab-item {
    animation: n91ip-tab-fade-in .55s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.n91ip-tab-group.n91ip-pos-left.is-animated .n91ip-tab-item {
    animation-name: n91ip-tab-fade-in-left;
}
.n91ip-tab-group.is-animated .n91ip-tab-item:nth-child(1) { animation-delay: .10s; }
.n91ip-tab-group.is-animated .n91ip-tab-item:nth-child(2) { animation-delay: .20s; }
.n91ip-tab-group.is-animated .n91ip-tab-item:nth-child(3) { animation-delay: .30s; }
.n91ip-tab-group.is-animated .n91ip-tab-item:nth-child(4) { animation-delay: .40s; }
.n91ip-tab-group.is-animated .n91ip-tab-item:nth-child(5) { animation-delay: .50s; }
.n91ip-tab-group.is-animated .n91ip-tab-item:nth-child(6) { animation-delay: .60s; }
.n91ip-tab-group.is-animated .n91ip-tab-item:nth-child(n+7) { animation-delay: .70s; }

/* Custom-Icon (Bild/SVG) statt FontAwesome */
.n91ip-icon-img {
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
    line-height: 1;
}
.n91ip-tab-item .n91ip-icon-img,
.n91ip-mobile-btn .n91ip-icon-img {
    position: absolute;
}

.n91ip-tab-item .n91ip-icon-close { display: none; }
.n91ip-tab-item.is-active .n91ip-icon-open { display: none; }
.n91ip-tab-item.is-active .n91ip-icon-close { display: inline-flex; }

/* Tooltip */
.n91ip-tab-item::after {
    content: attr(data-label);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}
.n91ip-pos-right .n91ip-tab-item::after { right: 65px; transform: translateX(10px); }
.n91ip-pos-left  .n91ip-tab-item::after { left:  65px; transform: translateX(-10px); }

.n91ip-tab-item:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* ===================== MOBILE BUTTON ===================== */
.n91ip-mobile-btn {
    display: none;
    position: fixed;
    width: 56px;
    height: 56px;
    color: var(--n91ip-tab-fg, #143851) !important;
    background: var(--n91ip-tab-bg, rgba(255,255,255,0.75)) !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2147483000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: none;
    outline: none;
    overflow: hidden;
}
.n91ip-mobile-btn.is-glassmorph {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
.n91ip-mobile-btn.is-open {
    background: var(--n91ip-tab-bg-hover, var(--n91ip-tab-bg, rgba(255,255,255,0.75))) !important;
    color: var(--n91ip-tab-fg-hover, var(--n91ip-tab-fg, #143851)) !important;
}
.n91ip-mobile-btn.n91ip-mpos-bottom-left  { bottom: var(--n91ip-mobile-offset-y, 20px); left:  var(--n91ip-mobile-offset-x, 20px); right: auto; }
.n91ip-mobile-btn.n91ip-mpos-bottom-right { bottom: var(--n91ip-mobile-offset-y, 20px); right: var(--n91ip-mobile-offset-x, 20px); left:  auto; }

/* Mobile-FAB Fade-In */
@keyframes n91ip-fab-fade-in {
    from { opacity: 0; transform: translateY(20px) scale(0.85); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.n91ip-mobile-btn.is-animated {
    animation: n91ip-fab-fade-in .5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    animation-delay: .25s;
}

.n91ip-mobile-btn .n91ip-mobile-icon {
    position: absolute;
    font-size: 22px;
}

.n91ip-mobile-btn .n91ip-icon-close {
    opacity: 0;
    pointer-events: none;
}
.n91ip-mobile-btn.is-open .n91ip-icon-cycle {
    animation: none;
    opacity: 0;
}
.n91ip-mobile-btn.is-open .n91ip-icon-close {
    opacity: 1;
    pointer-events: auto;
}

/* ===================== MOBILE LAYOUT ===================== */
@media (max-width: 767px) {
    .n91ip-tab-group {
        display: none !important;
    }

    .n91ip-mobile-btn {
        display: flex;
    }

    .n91ip-panel {
        top: auto;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        transform: none;
        border-radius: 0;
    }
    .n91ip-panel.n91ip-pos-right,
    .n91ip-panel.n91ip-pos-left {
        right: 0;
        left: 0;
        bottom: -100%;
        top: auto;
    }
    .n91ip-panel.n91ip-pos-right.is-open,
    .n91ip-panel.n91ip-pos-left.is-open {
        bottom: 0;
    }

    /* Mobile-Mode: alle Sections sichtbar mit Trennlinien */
    .n91ip-panel.is-mobile-mode .n91ip-section {
        display: block !important;
    }
    .n91ip-panel.is-mobile-mode .n91ip-section + .n91ip-section {
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        margin-top: 20px;
        padding-top: 20px;
    }

    .n91ip-content {
        padding-bottom: 120px;
    }
}

/* ===================== GLOBALE SCHRIFTEN (Master-Schalter → .n91cs-fonts) ===================== */
.n91ip-panel.n91cs-fonts { font-family: var(--n91cs-font-body, inherit); }
.n91ip-panel.n91cs-fonts .n91ip-section-heading { font-family: var(--n91cs-font-heading, inherit) !important; }
