/*
 * File: chat-style.css
 * Description: Styles for AI Chatbot
 * Version: 1.0.0
 */

/* =========================================
   1. VARIABLES
   ========================================= */
:root {
    --vidnok-glass: rgba(255, 255, 255, 0.05); 
    --vidnok-border: rgba(255, 255, 255, 0.15); 
    --vidnok-primary: #a855f7;  /* Purple */
    --vidnok-secondary: #ec4899; /* Pink */
    --vidnok-text-main: #f8fafc;
    --vidnok-text-muted: #cbd5e1;
    --bg-dark: #0f172a;
    --input-bg: rgba(0, 0, 0, 0.3);
}

/* =========================================
   2. RESET & BASICS
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--vidnok-text-main);
    line-height: 1.6;
    margin: 0; padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex; flex-direction: column;
}

a { text-decoration: none; transition: 0.3s; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
.wp-site-blocks > footer, .site-footer, #colophon { display: none !important; }

/* Utilities */
.vidnok-hidden { display: none !important; }
.vidnok-w-full { width: 100%; }

/* =========================================
   3. BACKGROUND ANIMATION
   ========================================= */
.vidnok-fixed-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 50% 50%, #2e1065 0%, #0f172a 100%);
    z-index: -999; pointer-events: none;
}
.vidnok-fixed-bg::before { 
    content: ''; position: absolute; width: 60vw; height: 60vh; 
    background: #a855f7; top: -10%; left: -10%; border-radius: 50%; 
    filter: blur(100px); opacity: 0.5; z-index: -1; animation: vidnokPulse 8s infinite alternate; 
}
.vidnok-fixed-bg::after { 
    content: ''; position: absolute; width: 60vw; height: 60vh; 
    background: #ec4899; bottom: -10%; right: -10%; border-radius: 50%; 
    filter: blur(100px); opacity: 0.5; z-index: -1; animation: vidnokPulse 8s infinite alternate; 
}

@keyframes vidnokPulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.7; }
}

/* =========================================
   4. HEADER
   ========================================= */
.vidnok-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 70px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 30px; z-index: 1000;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--vidnok-border);
}

.vidnok-logo a { font-size: 1.4rem; font-weight: 800; color: white; text-transform: uppercase; display: flex; align-items: center; }
.vidnok-logo img { height: 35px; width: auto; }

.vidnok-nav { display: flex; gap: 25px; position: absolute; left: 50%; transform: translateX(-50%); }
.vidnok-nav a { color: var(--vidnok-text-muted); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; }
.vidnok-nav a:hover, .vidnok-nav a.active { color: white; text-shadow: 0 0 15px var(--vidnok-primary); }

.v-cta-btn {
    background: rgba(255,255,255,0.1); border: 1px solid var(--vidnok-border);
    padding: 8px 15px; border-radius: 50px; color: white; font-weight: 700; font-size: 0.8rem;
    display: flex; align-items: center; gap: 6px; cursor: pointer; transition: 0.3s;
}
.v-cta-btn:hover { background: var(--vidnok-primary); border-color: var(--vidnok-primary); }

.vidnok-dash-header-pc { display: flex; align-items: center; gap: 10px; }

.vidnok-mobile-trigger { display: none; }

/* Mobile Header Adjustments */
@media (max-width: 900px) {
    .vidnok-nav, .v-cta-btn { display: none !important; }
    .vidnok-header { padding: 0 20px; justify-content: flex-start; }
    .vidnok-mobile-trigger { display: flex; align-items: center; z-index: 1002; }
    .vidnok-logo { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; z-index: 1001; }
    
    .vidnok-dash-header-pc { display: none !important; }

    .vidnok-menu-btn {
        background: rgba(255,255,255,0.1); border: 1px solid var(--vidnok-border);
        border-radius: 8px; cursor: pointer; padding: 8px 12px; color: white; font-size: 1.2rem;
    }
}

/* =========================================
   5. SIDEBAR (MOBILE & COMMON STYLES)
   ========================================= */
.vidnok-sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px);
    z-index: 2000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.vidnok-sidebar-overlay.active { opacity: 1; visibility: visible; }

.vidnok-mobile-sidebar {
    position: fixed; top: 0; left: 0; height: 100%; width: 300px;
    background: radial-gradient(circle at 0% 0%, #4c1d95 0%, #0f172a 100%);
    border-right: 1px solid var(--vidnok-border);
    z-index: 2001; transform: translateX(-100%); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 30px; display: flex; flex-direction: column;
}
.vidnok-mobile-sidebar.active { transform: translateX(0); }

.vidnok-sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--vidnok-border); padding-bottom: 20px; margin-bottom: 20px;
}
.v-menu-title { font-weight: 800; color: white; letter-spacing: 1px; }
.v-close-btn { color: white; font-size: 1.5rem; cursor: pointer; }

/* Sidebar Links */
.vidnok-sidebar-links { display: flex; flex-direction: column; gap: 12px; }
.vidnok-sidebar-links a {
    display: flex; align-items: center; gap: 15px;
    padding: 14px 20px; border-radius: 12px;
    color: var(--vidnok-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}
.vidnok-sidebar-links a:hover, .vidnok-sidebar-links a.active {
    background: rgba(168, 85, 247, 0.25); color: white; border-color: var(--vidnok-primary);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2); transform: translateX(5px);
}
.vidnok-sidebar-links a i { width: 24px; text-align: center; color: white; }

/* =========================================
   6. CHAT LAYOUT
   ========================================= */
.vidnok-container {
    max-width: 1400px; margin: 0 auto; width: 100%;
    padding: 100px 20px 20px; height: 100vh;
    display: flex; gap: 30px;
}

/* Left Sidebar (Desktop History) */
.vidnok-chat-sidebar {
    width: 320px; flex-shrink: 0;
    background: var(--vidnok-glass); 
    border: 1px solid var(--vidnok-border);
    border-radius: 24px; display: flex; flex-direction: column; overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.vidnok-sidebar-section-title {
    padding: 20px; font-size: 0.8rem; font-weight: 800; color: var(--vidnok-text-muted);
    border-bottom: 1px solid var(--vidnok-border); text-transform: uppercase; letter-spacing: 1px;
}

.vidnok-new-chat-btn {
    margin: 20px; padding: 15px; border-radius: 16px; font-weight: 700;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(217, 70, 239, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.4); color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.3s;
    text-transform: uppercase; letter-spacing: 1px;
}
.vidnok-new-chat-btn:hover { 
    background: linear-gradient(135deg, var(--vidnok-primary), var(--vidnok-secondary)); 
    border-color: transparent; box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.vidnok-history-list-wrapper { flex: 1; overflow-y: auto; padding: 0 15px 15px; }
.vidnok-history-item {
    padding: 15px; margin-bottom: 8px; border-radius: 12px;
    cursor: pointer; transition: 0.3s; font-size: 0.95rem; color: var(--vidnok-text-muted);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.02); border: 1px solid transparent;
}
.vidnok-history-item:hover { background: rgba(255,255,255,0.08); color: white; }
.vidnok-history-item.active { 
    background: rgba(168, 85, 247, 0.2); color: white; border-color: var(--vidnok-primary); 
    font-weight: 600;
}
.vidnok-delete-chat-btn { opacity: 0; transition: 0.3s; color: #ef4444; }
.vidnok-history-item:hover .vidnok-delete-chat-btn { opacity: 1; }

/* Chat Panel */
.vidnok-chat-panel {
    flex: 1; 
    background: var(--vidnok-glass); 
    border: 1px solid var(--vidnok-border);
    border-radius: 24px; display: flex; flex-direction: column; overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.vidnok-chat-header-inner {
    height: 70px; padding: 0 30px; border-bottom: 1px solid var(--vidnok-border);
    display: flex; align-items: center; justify-content: space-between;
}
.v-chat-info { display: flex; align-items: center; gap: 15px; }
.v-status-dot { width: 10px; height: 10px; background: #4ade80; border-radius: 50%; box-shadow: 0 0 10px #4ade80; }
.vidnok-chat-header-inner h3 { font-size: 1.2rem; font-weight: 700; color: white; margin: 0; }

.vidnok-mobile-history-btn { display: none; background: none; border: none; color: white; font-size: 1.4rem; cursor: pointer; }
.vidnok-icon-btn { background: none; border: none; color: #ef4444; font-size: 1.2rem; cursor: pointer; opacity: 0.7; transition: 0.3s; }
.vidnok-icon-btn:hover { opacity: 1; transform: scale(1.1); }

/* Messages Area */
.vidnok-chat-messages {
    flex: 1; overflow-y: auto; padding: 30px;
    display: flex; flex-direction: column; gap: 30px; 
}

/* Welcome Screen */
.vidnok-welcome {
    margin: auto; text-align: center; color: var(--vidnok-text-muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;
}
.vidnok-welcome-icon {
    width: 100px; height: 100px; margin-bottom: 30px;
    background: rgba(255,255,255,0.05); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--vidnok-primary);
    border: 1px solid var(--vidnok-border);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
}
.vidnok-welcome h2 { font-size: 2rem; font-weight: 800; color: white; margin: 0; }

/* Bubbles & Rows */
.vidnok-msg-row { display: flex; width: 100%; margin-bottom: 20px; position: relative; }
.vidnok-msg-row.user { justify-content: flex-end; }
.vidnok-msg-row.assistant { justify-content: flex-start; margin-bottom: 45px; }

.vidnok-bubble {
    max-width: 80%; padding: 15px 25px; border-radius: 20px;
    font-size: 1rem; line-height: 1.6; position: relative; word-wrap: break-word;
}
.vidnok-msg-row.user .vidnok-bubble {
    background: linear-gradient(135deg, var(--vidnok-primary), var(--vidnok-secondary));
    color: white; border-bottom-right-radius: 4px;
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.3);
}
.vidnok-msg-row.assistant .vidnok-bubble {
    background: rgba(0, 0, 0, 0.4); color: var(--vidnok-text-muted);
    border: 1px solid var(--vidnok-border); border-bottom-left-radius: 4px;
}

/* Voice Button */
.vidnok-voice-btn {
    position: absolute; bottom: -35px; left: 0;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.1); border: 1px solid var(--vidnok-border);
    color: var(--vidnok-text-muted); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s; font-size: 12px;
}
.vidnok-voice-btn:hover { background: var(--vidnok-primary); color: white; }

/* Input Area */
.vidnok-input-wrapper {
    padding: 25px; border-top: 1px solid var(--vidnok-border); background: rgba(0,0,0,0.2);
}
.vidnok-chat-form {
    display: flex; gap: 15px; align-items: center;
    background: var(--input-bg); border: 1px solid var(--vidnok-border);
    padding: 10px 20px; border-radius: 50px; transition: 0.3s;
}
.vidnok-chat-form:focus-within { border-color: var(--vidnok-primary); box-shadow: 0 0 20px rgba(168, 85, 247, 0.2); }

.vidnok-user-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: white; font-size: 1.1rem; resize: none; max-height: 100px;
}
.vidnok-file-label { cursor: pointer; color: var(--vidnok-text-muted); font-size: 1.3rem; transition: 0.3s; }
.vidnok-file-label:hover { color: white; }

.vidnok-send-btn {
    width: 45px; height: 45px; border-radius: 50%;
    background: linear-gradient(135deg, var(--vidnok-primary), var(--vidnok-secondary));
    border: none; color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: 0.3s; font-size: 1.2rem;
}
.vidnok-send-btn:hover { transform: scale(1.1); box-shadow: 0 0 20px rgba(236, 72, 153, 0.5); }

/* Responsive adjustments */
@media (max-width: 900px) {
    .vidnok-chat-sidebar { display: none; }
    .vidnok-container { padding: 80px 15px 15px; gap: 0; }
    .vidnok-mobile-history-btn { display: block; }
}

/* =========================================
   7. IMAGE HANDLING
   ========================================= */

/* --- Input Area Preview --- */
.vidnok-input-wrapper .vidnok-chat-form .vidnok-img-preview {
    width: 50px;
    height: 50px;
    flex-shrink: 0;           
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;       
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    display: flex;            
    align-items: center;
    justify-content: center;
}

.vidnok-input-wrapper .vidnok-chat-form .vidnok-img-preview img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Close Button */
.vidnok-input-wrapper .vidnok-chat-form .vidnok-preview-close {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); color: #ef4444; border: none;
    opacity: 0; cursor: pointer; transition: 0.2s ease-in-out;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.vidnok-input-wrapper .vidnok-chat-form .vidnok-img-preview:hover .vidnok-preview-close { opacity: 1; }

/* --- Chat Area Message Image --- */
.vidnok-chat-messages .vidnok-bubble img {
    max-width: 100%; height: auto; max-height: 280px; 
    border-radius: 10px; margin-top: 5px; object-fit: contain; display: block;
}

.vidnok-chat-messages .vidnok-bubble.image-only {
    background: transparent; padding: 0; box-shadow: none; border: none;
}

/* Footer */
.vidnok-custom-footer {
    text-align: center; padding: 40px; color: var(--vidnok-text-muted);
    border-top: 1px solid var(--vidnok-border); margin-top: auto;
    font-size: 0.9rem; background: rgba(15, 23, 42, 0.3);
}