/**
 * Frogger Banner Plugin – Frontend Styles
 * ────────────────────────────────────────
 * All selectors prefixed with .frogger-bn- to
 * prevent conflicts (IIFE + namespace + prefix strategy).
 */

/* ── Reset within our scope ── */
.frogger-bn-wrapper,
.frogger-bn-wrapper *,
.frogger-bn-wrapper *::before,
.frogger-bn-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ================================================================
   BANNER WRAPPER – Split Layout
   Left = 1/3 (33.333%)  |  Right = 2/3 (66.666%)
   "Left is 50% of the right" → 1:2 ratio
   ================================================================ */
.frogger-bn-wrapper {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 280px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    position: relative;
}

/* ── Left Panel (Text) ── */
.frogger-bn-left {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 35px;
    position: relative;
    z-index: 1;
}

.frogger-bn-h1,
.frogger-bn-h2,
.frogger-bn-h3,
.frogger-bn-p {
    margin: 0 0 12px;
    line-height: 1.3;
    word-wrap: break-word;
}

.frogger-bn-h1 { margin-bottom: 14px; }
.frogger-bn-h2 { margin-bottom: 10px; }
.frogger-bn-h3 { margin-bottom: 8px; }
.frogger-bn-p  { margin-bottom: 0; }

/* ── Right Panel (Carousels) ── */
.frogger-bn-right {
    flex: 0 0 66.666%;
    max-width: 66.666%;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px;
    justify-content: center;
    overflow: hidden;
}

/* ================================================================
   CAROUSEL CONTAINER (from triple.html)
   ================================================================ */
.frogger-bn-carousel {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    overflow: hidden;
    width: 100%;
    position: relative;
    cursor: grab;
    padding: 5px 0;
}

/* ── Carousel Cells ── */
.frogger-bn-cell {
    width: 130px;
    height: 70px;
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
    background-color: rgba(255,255,255,0.08);
    text-align: center;
    line-height: 70px;
    font-weight: bold;
    color: rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
    user-select: none;
    outline: none;
    border-radius: 6px;
    margin-right: 7px;
    transition: border-color 0.3s;
}

.frogger-bn-cell:hover {
    border-color: rgba(255,255,255,0.35);
}

.frogger-bn-cell:active {
    cursor: grabbing;
}

.frogger-bn-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.frogger-bn-cell.frogger-bn-loaded img {
    opacity: 1;
}

/* ── Loading Spinner ── */
.frogger-bn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-width: 3px;
    border-style: solid;
    border-radius: 50%;
    animation: froggerBnSpin 0.8s linear infinite;
    z-index: 1;
}

.frogger-bn-cell.frogger-bn-loaded .frogger-bn-spinner {
    display: none;
}

@keyframes froggerBnSpin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Callout Bubble (on click) ── */
.frogger-bn-callout {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #9c27b0;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.frogger-bn-callout::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #9c27b0;
}

/* ── Wobble Animation ── */
@keyframes froggerBnWobble {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(-5px) rotate(-5deg); }
    30%  { transform: translateX(4px) rotate(3deg); }
    45%  { transform: translateX(-3px) rotate(-3deg); }
    60%  { transform: translateX(2px) rotate(2deg); }
    75%  { transform: translateX(-1px) rotate(-1deg); }
    100% { transform: translateX(0); }
}

.frogger-bn-wobble {
    animation: froggerBnWobble 0.8s ease;
}

/* ── Bubble Rise Animation ── */
@keyframes froggerBnBubbleRise {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(var(--frogger-tx), var(--frogger-ty)) scale(1);
    }
}

.frogger-bn-bubble {
    position: absolute;
    background-color: #9c27b0;
    border-radius: 50%;
    pointer-events: none;
    animation: froggerBnBubbleRise 1s ease-out forwards;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .frogger-bn-wrapper {
        min-height: 240px;
    }
    .frogger-bn-left {
        padding: 20px 25px;
    }
    .frogger-bn-cell {
        width: 110px;
        height: 60px;
        line-height: 60px;
    }
}

/* Mobile – stack layout */
@media (max-width: 768px) {
    .frogger-bn-wrapper {
        flex-wrap: wrap;
        min-height: auto;
    }
    .frogger-bn-left {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 25px 20px;
        text-align: center;
    }
    .frogger-bn-right {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 10px 15px 20px;
    }
    .frogger-bn-cell {
        width: 100px;
        height: 55px;
        line-height: 55px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .frogger-bn-left {
        padding: 20px 15px;
    }
    .frogger-bn-cell {
        width: 80px;
        height: 45px;
        line-height: 45px;
    }
}
