/* R8 Global Wizard Cortex - Crystal Glass UI (V2) */

:root {
    --crystal-surface: rgba(255, 255, 255, 0.15);
    --crystal-border: rgba(255, 255, 255, 0.4);
    --crystal-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    --text-primary: #1d1d1f;
    --text-secondary: #555;
    --accent-gold: #cfb53b;
}

[x-cloak] {
    display: none !important;
}

/* Backdrop - The Canvas */
.r8-overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(200, 200, 200, 0.1);
    /* Heavy Blur on the world behind via Alpine Transition */
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Opacity handled by Alpine x-show */
}

/* The Main Frame */
.r8-glass-frame {
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    border-radius: 40px;
    border: 1px solid var(--crystal-border);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.2),
        /* Inner bezel */
        0 20px 80px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    align-items: center;
    justify-content: flex-start;
    /* MOVED UP: Changed from center */
    padding-top: 8vh;
    /* Moved even higher to fit more icons */
    position: relative;
    overflow-y: auto; /* Enable Scroll */
    -webkit-overflow-scrolling: touch; /* Smooth iOS Scroll */
}

.r8-overlay-backdrop.is-open .r8-glass-frame {
    transform: scale(1);
}

/* The Capsule Search - Centerpiece */
.r8-capsule-container {
    width: 100%;
    max-width: 600px;
    position: relative;
    margin-bottom: 3rem;
    z-index: 20;
}

.r8-capsule-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    padding: 1.5rem 2.5rem;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
    text-align: center;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.05),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.r8-capsule-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-weight: 200;
}

.r8-capsule-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* Service Icons Grid */
.r8-crystal-grid {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 10;
}

.r8-crystal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    group: transition;
    transition: transform 0.3s ease;
}

.r8-crystal-item:hover {
    /* transform: translateY(-5px); -- REMOVED per user request (keeps text static) */
}


.r8-icon-box {
    width: 130px;
    /* Increased from 100 */
    height: 130px;
    /* Increased from 100 */
    /* REMOVED: border-radius, background, border, box-shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Ensure the image fills the new larger space */
.r8-icon-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    /* Add shadow to image since box is gone */
    opacity: 1 !important;
    /* FORCE VISIBILITY */
}

.r8-crystal-item:hover .r8-icon-box {
    /* REMOVED: background change */
    transform: scale(1.25);
    /* Dramatic Zoom */
    filter: drop-shadow(0 15px 25px rgba(255, 255, 255, 0.4));
    /* Stronger Glow */
}

.r8-crystal-label {
    font-size: 1.1rem;
    /* Slightly larger */
    font-weight: 700;
    /* Bold */
    color: #000000;
    /* FIXED: Black text for max contrast */
    /* GENIUS SOLUTION: Luminous Halo (Backlight) 
       Creates a soft white glow BEHIND the text to ensure legibility on ANY background. */
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 5px rgba(255, 255, 255, 0.6);
    /* Clean look */
    letter-spacing: 0.5px;
    margin-top: 15px;
    /* More spacing */
    text-align: center;
}

/* Close Button */
.r8-glass-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.r8-glass-close:hover {
    background: #fff;
    color: #000;
}

/* Floating Action Button (FAB) - Glass Capsule */
.r8-fab-trigger {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: auto;
    width: auto;
    /* Extended */
    height: 56px;
    padding: 0 1.5rem 0 1.25rem;
    /* Space for text */
    border-radius: 100px;
    /* Capsule Shape */
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    color: #333;
}

.r8-fab-trigger:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255, 255, 255, 0.45);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    color: #000;
}

.r8-fab-trigger svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.r8-fab-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    background: linear-gradient(90deg, #333 0%, #000 50%, #333 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    animation: r8-text-shimmer 4s linear infinite;
}

@keyframes r8-text-shimmer {
    to {
        background-position: 200% center;
    }
}

/* Pulse Animation for FAB */
/* Pulse Animation for FAB - SUBTLE & SAFE */
@keyframes r8-pulse-white {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }

    /* Gentle breathing instead of wobbly shadow */
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.r8-fab-trigger {
    animation: r8-pulse-white 3s infinite ease-in-out;
    /* Smooth breathing */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .r8-fab-trigger {
        bottom: 5.5rem;
        /* Above persistent bottom nav */
        left: 1.5rem;
        right: auto;
        height: 50px;
        padding: 0 1.25rem 0 1rem;
    }

    .r8-fab-text {
        font-size: 0.85rem;
    }
}