/* ============================================================
   Elementor WebGL Nature & Atmosphere – Styles
   ============================================================ */

/* ── Widget container ───────────────────────────────────────── */
.ewna-widget {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
    /* Default height (overridden inline by PHP) */
    height: 400px;
}

.ewna-widget.ewna-fullscreen {
    height: 100vh !important;
    min-height: 300px;
}

/* ── Canvas ─────────────────────────────────────────────────── */
.ewna-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    touch-action: none; /* allow custom touch handling */
}

/* ── Loader / Spinner ───────────────────────────────────────── */
.ewna-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    z-index: 10;
    pointer-events: none;
}

.ewna-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ewna-spin 0.8s linear infinite;
}

@keyframes ewna-spin {
    to { transform: rotate(360deg); }
}

/* ── Controls overlay (Growth reset button) ─────────────────── */
.ewna-controls {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 20;
    display: flex;
    gap: 8px;
}

.ewna-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}

.ewna-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

.ewna-btn:active {
    transform: scale(0.96);
}

.ewna-btn-reset::before {
    content: "↺";
    font-size: 15px;
    line-height: 1;
}

/* ── Elementor editor preview placeholder ───────────────────── */
.elementor-editor-active .ewna-widget::after {
    content: attr(data-mode-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    display: none; /* only shown while canvas loads */
}

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 767px) {
    .ewna-widget:not(.ewna-fullscreen) {
        height: 260px;
    }

    .ewna-controls {
        bottom: 8px;
        right: 8px;
    }

    .ewna-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .ewna-widget:not(.ewna-fullscreen) {
        height: 200px;
    }
}

/* ── Ripple & Parallax: click hint overlay ──────────────────── */
.ewna-ripple-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20;
    /* Pulse animation to attract attention */
    animation: ewna-hint-pulse 2.4s ease-in-out infinite;
    transition: opacity 0.4s;
}

.ewna-ripple-hint.ewna-hint-hidden {
    opacity: 0;
}

.ewna-ripple-hint__icon {
    font-size: 16px;
    animation: ewna-hint-tap 2.4s ease-in-out infinite;
    display: inline-block;
}

@keyframes ewna-hint-pulse {
    0%, 100% { opacity: 0.85; }
    50%       { opacity: 0.55; }
}

@keyframes ewna-hint-tap {
    0%, 80%, 100% { transform: scale(1); }
    40%           { transform: scale(1.25) translateY(-2px); }
}

/* ── Ripple cursor: show pointer on ripple widgets ──────────── */
.ewna-widget[data-mode="ripple"] .ewna-canvas,
.ewna-widget .ewna-canvas {
    cursor: crosshair;
}

@media (max-width: 767px) {
    .ewna-ripple-hint {
        font-size: 12px;
        padding: 6px 14px;
        bottom: 12px;
    }
}

/* ── Transition mode: button overlay ───────────────────────── */
.ewna-controls--transition {
    bottom: 50%;
    right: 50%;
    transform: translate(50%, 50%);
}
.ewna-btn-transition::before { content: "⇄"; font-size: 15px; }

/* ── Scroll-Reveal: hide initially when scroll-reveal active ── */
.ewna-widget[data-scroll-reveal="1"] {
    /* JS controls opacity via uReveal uniform; no CSS opacity needed */
}
