/**
 * vici-style.css
 *
 * VICICHAT CORE UI STYLING
 * Aesthetic: Deep Purple Glassmorphism / Futuristic Tech
 * Version: 3.0.0 - Midnight Amethyst Opaque Bubble Alternative
 * Project: Vicilook Ecosystem
 */

/* ==========================================================================
   VICILOOK CONTENT SHIELD DEFENSE BOUNDARIES
   ========================================================================== */

/* Prevent structural layout text and community data highlight scraping */
body, 
#vici-app-container, 
.vici-glass-card, 
.vici-msg-bubble,
.vici-neighbor-card {
    -webkit-user-select: none;  /* Safari */
    -moz-user-select: none;     /* Firefox */
    -ms-user-select: none;      /* IE10+/Edge */
    user-select: none;          /* Standard UI Engine rule */
}

/* Permit text inputs and chat typing channels to capture keyboard selection naturally */
input, 
textarea, 
.vici-input {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Global protection for community avatars and design assets against raw layout drags */
img, 
.vici-main-logo,
.vici-neighbor-avatar img,
.vici-chat-avatar img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none; /* Disables contextual long-press saving on touch displays */
}

/* ==========================================================================
   CORE APPLICATION THEME RULES
   ========================================================================== */

:root {
    --vici-bg: #0f0c29;
    --vici-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --vici-purple: #6c5ce7;
    --vici-neon: #a29bfe;
    --vici-neon-rgb: 162, 155, 254; 
    --vici-tag-cyan: #00d2ff;
    --vici-error: #ff7675;
    --vici-glass: rgba(255, 255, 255, 0.08);
    --vici-glass-border: rgba(255, 255, 255, 0.15);
    --vici-transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    
    /* SURGICAL UPDATE: HUD Text Size adjusted to 8px */
    --vici-hud-text-size: 8px; 
}

#vici-app-container {
    font-family: 'Inter', sans-serif;
    background: var(--vici-gradient);
    min-height: 800px;
    
    /* --- SEAMLESS EDGES --- */
    border-radius: 0;
    border: none;
    box-shadow: none;
    
    padding: 30px;
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- IMAGE SHIELD: THE INVISIBLE WALL --- */
.vici-img-protected-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.vici-img-protected-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: rgba(255,255,255,0);
    cursor: default;
}

.vici-no-download {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-touch-callout: none !important;
}

/* --- PHASE 1: BRANDING & Y-AXIS ANCHOR --- */
.vici-gateway-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.vici-main-logo {
    display: block;
    max-width: 180px;
    height: auto;
    margin-top: 10px;
    margin-bottom: 50px;
    filter: drop-shadow(0 0 15px rgba(162, 155, 254, 0.5));
    flex-shrink: 0;
    transition: var(--vici-transition);
}

.vici-main-logo:hover {
    filter: drop-shadow(0 0 25px rgba(162, 155, 254, 0.8));
    transform: scale(1.02);
}

.vici-globe-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 0;
}

.vici-globe-wrapper h2 {
    margin: 25px 0 12px 0;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.vici-globe-wrapper p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 320px;
    color: var(--vici-neon);
}

/* 1. GLASSMORPHISM COMPONENTS */
.vici-glass-card {
    background: var(--vici-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--vici-glass-border);
    border-radius: 30px;
    padding: 30px;
    margin: 15px auto;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-sizing: border-box;
    transition: var(--vici-transition);
}

.vici-glass-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 2. AVATAR SCOPING & PROTECTION */
.vici-neighbor-avatar, .vici-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--vici-neon);
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 15px;
    background: #000;
    position: relative;
    box-shadow: 0 0 15px rgba(162, 155, 254, 0.2);
}

.vici-neighbor-avatar img, 
.vici-chat-avatar img,
.vici-camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 3. NEIGHBOR LIST LAYOUT */
.vici-neighbor-card {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 15px;
    border-radius: 20px;
    transition: var(--vici-transition);
    cursor: pointer;
}

.vici-neighbor-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vici-neighbor-name {
    font-weight: 800;
    color: #fffff;
    font-size: 14px;
    margin-bottom: 2px;
}

.vici-neighbor-bio {
    font-size: 11px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3.1. NEIGHBOR ACTIONS (BLOCK/CHAT STACK) */
.vici-neighbor-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: auto;
    align-items: flex-end;
    min-width: 70px;
}

.vici-block-btn {
    background: transparent;
    color: var(--vici-error);
    border: 1px solid rgba(255, 118, 117, 0.2);
    width: 100%;
    height: 22px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 7px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--vici-transition);
    /* SURGICAL FIX: Flex Alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.05em;
}

.vici-block-btn:hover {
    background: rgba(255, 118, 117, 0.1);
    border-color: var(--vici-error);
}

/* 4. PHASE 5: CHAT WINDOW HEADER */
.vici-chat-header {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
}

.vici-chat-avatar {
    width: 40px;
    height: 40px;
    margin-left: 10px;
}

/* 5. INPUT FIELDS & BUTTONS */
.vici-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--vici-glass-border);
    padding: 15px;
    border-radius: 15px;
    color: #fff;
    font-size: 14px;
    margin: 10px 0;
    box-sizing: border-box;
    transition: var(--vici-transition);
}

.vici-input:focus {
    outline: none;
    border-color: var(--vici-neon);
    background: rgba(0, 0, 0, 0.4);
}
.vici-btn-primary {
    background: var(--vici-purple);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 15px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    transition: var(--vici-transition);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
    /* SURGICAL FIX: Center Text */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vici-btn-primary:active {
    transform: scale(0.98);
}


.vici-chat-btn {
    background: var(--vici-neon);
    color: #0f0c29;
    border: none;
    width: 100%;
    height: 28px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--vici-transition);
    /* SURGICAL FIX: Center Text */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 5.1 PHASE 5 CHAT INPUT WRAPPER & UTILITY COHESION */
.vici-utility-tube-anchor {
    padding: 0 !important;      /* Strips JavaScript inline Y-axis padding defaults */
    margin-bottom: -4px;       /* Pulls input entry panel upward to eliminate gap */
}

.vici-chat-input-wrapper {
    margin-top: 0 !important;   /* Neutralizes any baseline top margin separation */
    padding: 6px 10px 12px 10px !important; /* Optimizes micro-padding footprint */
}

/* --- LOAD MORE / PAGINATION (BRANDED) --- */
.vici-load-more-btn {
    align-self: center;
    background: rgba(162, 155, 254, 0.05);
    border: 1px solid rgba(162, 155, 254, 0.2);
    color: var(--vici-neon);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    margin: 10px auto;
    transition: var(--vici-transition);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vici-load-more-btn:hover {
    background: rgba(162, 155, 254, 0.15);
    border-color: var(--vici-neon);
    box-shadow: 0 0 15px rgba(162, 155, 254, 0.2);
    transform: translateY(-2px);
}

/* 6. MESSAGES & BUBBLES - SURGICAL ALIGNMENT */
.vici-chat-body {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.vici-msg-bubble {
    padding: 12px 12px;
    border-radius: 20px;
    max-width: 82%;
    min-width: 82%;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative; 
    transition: background 0.3s ease, border 0.3s ease;
    /* SURGICAL FIX: Internal stack alignment */
    display: flex;
    flex-direction: column;
}

/* --- UPDATED: Unread State (Default) - Neon Green */
.vici-msg-bubble-self {
    border-bottom: 2px solid var(--vici-neon) !important; 
    box-shadow: 0 2px 8px rgba(var(--vici-neon-rgb), 0.4);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- UPDATED: Read State (Seen) - Laser Red */
.vici-msg-bubble-self.vici-read {
    border-bottom: 2px solid #ff003c !important;
    box-shadow: 0 2px 4px rgba(255, 0, 60, 0.2);
}

/* --- 6.1 FLOATING BUBBLE ACTIONS --- */
.vici-bubble-actions {
    display: none;
    position: absolute;
    top: -24px; /* Float above the bubble */
    z-index: 100;
}

.vici-msg-bubble-self .vici-bubble-actions { right: 8px; }
.vici-msg-bubble-them .vici-bubble-actions { left: 8px; }

.vici-msg-bubble.vici-actions-open .vici-bubble-actions {
    display: flex;
    animation: viciFadeIn 0.3s forwards;
}

.vici-act-column {
    display: flex;
    gap: 2px;
    background: rgba(15, 12, 41, 0.9);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--vici-neon);
    backdrop-filter: blur(5px);
}

.vici-act-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    transition: var(--vici-transition);
}

.vici-act-btn:hover { background: rgba(255,255,255,0.1); }
.vici-del:hover { color: var(--vici-error); }
.vici-edt:hover { color: var(--vici-purple); }
.vici-rep:hover { color: var(--vici-tag-cyan); }

/* --- SIMPLIFIED AUTO-SEEKER TRAVELING HUD --- */
.vici-traveling-overlay {
    position: absolute;
    top: 15px; 
    left: 50%;
    transform: translateX(-50%); 
    background: rgba(15, 12, 41, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--vici-neon);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--vici-neon);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    pointer-events: none;
    white-space: nowrap;
}

.vici-traveling-overlay span {
    font-size: var(--vici-hud-text-size);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: inline-block;
}

.vici-traveling-loader {
    width: var(--vici-hud-text-size);
    height: var(--vici-hud-text-size);
    border: 1.5px solid var(--vici-neon);
    border-top-color: transparent;
    border-radius: 50%;
    animation: viciRotate 0.6s linear infinite;
    flex-shrink: 0;
}

/* Neon Flash logic for Reply Jumps */
@keyframes viciJumpRef {
    0% { background: rgba(var(--vici-neon-rgb), 0.5); box-shadow: 0 0 20px var(--vici-neon); }
    100% { background: inherit; box-shadow: none; }
}

.vici-jump-active {
    animation: viciJumpRef 1.5s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid var(--vici-neon) !important;
}

/* --- THE INCOMING MESSAGE SHIELD (100% OPAQUE / MIDNIGHT AMETHYST) --- */
.vici-msg-bubble-them {
    background: #22163b !important;            /* Opaque deep cyber-amethyst profile */
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(162, 155, 254, 0.25); /* Subtle cyber accent rim */
    box-shadow: 4px 4px 15px rgba(0,0,0,0.3);
    
    backdrop-filter: none !important;          /* Eliminates fuzzy glass blur behind text */
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;                     /* Force 100% solid color layout rendering */
}

.vici-msg-bubble-self {
    background: #3b338a;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: -4px 4px 15px rgba(0,0,0,0.2);
}

/* --- REPLY & MENTION --- */
.vici-reply-context {
    display: block;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    border-left: 3px solid var(--vici-purple);
    opacity: 0.9;
    cursor: pointer;
    transition: background 0.2s ease;
    /* Ensure it occupies full internal width */
    width: 100%;
    box-sizing: border-box;
}

.vici-reply-context:hover {
    background: rgba(0, 0, 0, 0.45);
}

.vici-reply-sender {
    font-weight: 900;
    color: var(--vici-neon);
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    text-transform: uppercase;
}

.vici-glow-mention {
    color: var(--vici-tag-cyan);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
    cursor: pointer;
    text-decoration: none;
    transition: text-shadow 0.2s ease;
}

.vici-glow-mention:hover {
    text-shadow: 0 0 15px var(--vici-tag-cyan);
}

/* 7. GLOBE & CAMERA (ATMOSPHERIC BLOOM) */
.vici-css-globe {
    width: 200px !important;
    height: 200px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 30% 30%, var(--vici-neon), var(--vici-purple)) !important;
    margin: 0 auto !important;
    position: relative !important;
    overflow: visible !important; 
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.4) !important;
    transition: var(--vici-transition) !important;
    -webkit-tap-highlight-color: transparent;
}

#vici-trigger-gps.vici-glow-active {
    box-shadow: 0 0 50px var(--vici-neon), 0 0 100px var(--vici-purple) !important;
    animation: viciNeonBloom 1.2s ease-in-out infinite alternate !important;
}

#vici-trigger-gps.vici-glow-active .vici-spinner {
    filter: brightness(2) drop-shadow(0 0 10px white) !important;
    animation: viciRotate 20s linear infinite, viciPulseScale 1.2s ease-in-out infinite alternate !important;
}

@keyframes viciNeonBloom {
    0% {
        box-shadow: 0 0 30px var(--vici-neon), 0 0 60px var(--vici-purple) !important;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 60px var(--vici-neon), 0 0 120px var(--vici-purple), 0 0 150px rgba(162, 155, 254, 0.4) !important;
        transform: scale(1.05);
    }
}

@keyframes viciPulseScale {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.vici-spinner {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    pointer-events: none;
    animation: viciRotate 20s linear infinite !important;
}

@keyframes viciRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vici-camera-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 4px solid var(--vici-purple);
    overflow: hidden;
    background: #000;
}

/* 8. SCROLLBARS - TECH AESTHETIC */
.vici-chat-body::-webkit-scrollbar { width: 4px; }
.vici-chat-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
.vici-chat-body::-webkit-scrollbar-thumb { 
    background: var(--vici-purple); 
    border-radius: 10px; 
}

/* 9. UTILITY */
.vici-fade-in { animation: viciFadeIn 0.5s forwards; }
@keyframes viciFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vici-hidden { display: none !important; }

/* 10. PHASE 4 NEIGHBOR LIST - MESH SCROLL FIX */
.vici-phase-4-wrapper {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    position: absolute !important;
    top: 0;
    left: 0;
    overflow: hidden !important;
    box-sizing: border-box;
}

.vici-search-container {
    flex-shrink: 0;
    padding: 15px;
    z-index: 10;
}

#vici-neighbors-grid {
    flex: 1 !important; 
    overflow-y: auto !important;
    padding: 0 15px 20px 15px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#vici-neighbors-grid::-webkit-scrollbar { width: 3px; }
#vici-neighbors-grid::-webkit-scrollbar-track { background: transparent; }
#vici-neighbors-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

@media (max-width: 600px) {
    /* Maintained square edges on mobile for seamless integration */
    #vici-app-container { padding: 15px; border-radius: 0; } 
    .vici-glass-card { padding: 20px; }
    .vici-main-logo { max-width: 140px; margin-bottom: 30px; }
    .vici-css-globe { 
        width: 150px !important; 
        height: 150px !important; 
    }
    .vici-globe-wrapper h2 { font-size: 1.5rem; }
    .vici-chat-body { max-height: 360px; }
}

/* --- SENT / SEEN STATUS INDICATOR --- */
.vici-msg-bubble-self::after { content: "SENT"; font-size: 8px; font-weight: 900; color: #888888; position: absolute; bottom: 6px; right: 12px; letter-spacing: 0.5px; opacity: 0.7; }
.vici-msg-bubble-self.vici-read::after { content: "SEEN"; color: #888888; }