/**
 * ViGo Nexus - ViGGi AI Floating Island Sheet (iOS 18 Glassmorphism)
 * Trimmed Micro-Modular Design (< 150 Lines for Token Efficiency).
 *
 * @package ViGo_Nexus
 */

/* 1. Frosted Glass Backdrop Overlay */
.vn-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.35s;
}

.vn-sheet-overlay.vn-active {
    opacity: 1;
    visibility: visible;
}

/* 2. Floating Island Card (Detached iOS 18 Design) */
.vn-bottom-sheet {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: 440px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    padding: 16px 20px 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 999999;
    transform: translateY(115%);
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    box-sizing: border-box;
}

.vn-bottom-sheet.vn-open {
    transform: translateY(0);
}

.vn-ambient-top-glow {
    display: none !important;
}

.vn-sheet-handle-pill {
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 10px;
    margin: 0 auto 14px;
}

/* 3. Header & Siri Intelligence Orb */
.vn-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.vn-brand-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vn-siri-orb {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #1A56DB, #38bdf8, #818cf8, #c084fc, #1A56DB);
    animation: vnSiriRotate 4s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 18px rgba(26, 86, 219, 0.45);
}

.vn-orb-glow {
    width: 76%;
    height: 76%;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: inset 0 0 8px rgba(26, 86, 219, 0.25);
}

@keyframes vnSiriRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vn-header-texts {
    display: flex;
    flex-direction: column;
}

.vn-brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.2px;
}

.vn-pro-badge {
    font-size: 9px;
    font-weight: 800;
    color: #ffffff;
    background: #1A56DB;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.vn-brand-subtitle {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.vn-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s;
}

.vn-close-btn:hover {
    background: #e2e8f0;
}

/* 4. Section Header */
.vn-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.vn-status-online {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #10b981;
    font-weight: 600;
}

.vn-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* 5. 2-Column Action Tiles Grid */
.vn-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-bottom: 14px;
}

.vn-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.vn-tile:active {
    transform: scale(0.97);
}

.vn-tile.vn-selected {
    background: #1A56DB;
    border-color: #1A56DB;
    box-shadow: 0 6px 16px rgba(26, 86, 219, 0.28);
}

.vn-tile-text {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    transition: color 0.2s;
}

.vn-tile.vn-selected .vn-tile-text {
    color: #ffffff;
}

.vn-tile-chevron {
    font-size: 14px;
    color: #94a3b8;
    transition: color 0.2s;
}

.vn-tile.vn-selected .vn-tile-chevron {
    color: #ffffff;
}

/* 6. Apple Intelligence Dynamic Answer Card */
.vn-ai-answer-card {
    display: none;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.9));
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 14px;
    animation: vnCardPop 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes vnCardPop {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

.vn-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.vn-card-icon {
    font-size: 13px;
    color: #1A56DB;
}

.vn-card-badge {
    font-size: 10px;
    font-weight: 700;
    color: #1A56DB;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.vn-ai-thinking {
    display: none;
    align-items: center;
    gap: 8px;
}

.vn-think-text {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.vn-wave-bar {
    width: 3px;
    height: 12px;
    background: #1A56DB;
    border-radius: 3px;
    animation: vnWave 0.9s ease-in-out infinite;
}

.vn-wave-bar:nth-child(2) { animation-delay: 0.15s; }
.vn-wave-bar:nth-child(3) { animation-delay: 0.3s; }

@keyframes vnWave {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

.vn-ai-answer-text {
    display: none;
    font-size: 12.5px;
    line-height: 1.5;
    color: #1e293b;
    font-weight: 500;
    margin: 0;
}

/* 7. CTA Specialist Pill Button (1.5s Metallic Sheen) */
.vn-human-action-section {
    width: 100%;
}

.vn-talk-human-btn {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 52px !important;
    background: linear-gradient(135deg, #1A56DB 0%, #1545b0 100%) !important;
    border: none !important;
    border-radius: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    cursor: pointer !important;
    box-shadow: 0 8px 24px -4px rgba(26, 86, 219, 0.45) !important;
    transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1) !important;
    box-sizing: border-box !important;
}

.vn-talk-human-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -70%;
    width: 55%;
    height: 200%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.28) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    animation: vnShimmerSheen 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes vnShimmerSheen {
    0% { left: -70%; }
    30%, 100% { left: 150%; }
}

.vn-talk-human-btn:active {
    transform: scale(0.98) !important;
    box-shadow: 0 4px 12px -2px rgba(26, 86, 219, 0.35) !important;
}

.vn-btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vn-wa-icon-wrap {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vn-btn-label {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    letter-spacing: -0.2px !important;
}

.vn-btn-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

/* 8. Smooth Pop-In Delay State */
.vn-floating-trigger.vn-delayed-hide {
    opacity: 0 !important;
    transform: scale(0.3) !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.vn-floating-trigger.vn-delayed-show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    animation: vnDelayedPopIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes vnDelayedPopIn {
    0% { opacity: 0; transform: scale(0.3); }
    100% { opacity: 1; transform: scale(1); }
}