/* Path: uvicon-technologies/assets/css/uvicon-uvi-builder.css */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- GLOBAL RESET & LAYOUT --- */
.uvi-dashboard-container {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    background-color: #F8F9FA; /* Very Light Grey */
    display: flex;
    font-family: 'Inter', sans-serif;
    color: #1F2937;
    z-index: 99999;
    overflow: hidden;
}

/* --- LEFT PANEL (Sidebar) --- */
.uvi-left-panel {
    width: 380px;
    background: #FFFFFF;
    border-right: 1px solid #E5E7EB;
    display: flex; flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
    z-index: 20;
    height: 100%;
}

/* 1. Header */
.uvi-header {
    height: 70px;
    padding: 0 24px;
    border-bottom: 1px solid #F3F4F6;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}

.uvi-brand { display: flex; align-items: center; gap: 12px; }
.uvi-logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #003d3f, #005f63);
    color: #FFC050;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 61, 63, 0.2);
}

.uvi-brand-text h3 { margin: 0; font-size: 16px; font-weight: 700; color: #111; letter-spacing: -0.5px; }
.uvi-version { font-size: 10px; color: #9CA3AF; font-weight: 600; background: #F3F4F6; padding: 2px 6px; border-radius: 4px; }

/* 2. Chat Area */
.uvi-chat-area {
    flex-grow: 1; padding: 24px; overflow-y: auto; background: #FFFFFF;
}
.uvi-message { display: flex; gap: 16px; margin-bottom: 24px; animation: slideUp 0.3s ease-out; }
.uvi-message.user-msg { flex-direction: row-reverse; }

.uvi-avatar {
    width: 36px; height: 36px; background: #F3F4F6; border-radius: 12px;
    padding: 6px; border: 1px solid #E5E7EB; flex-shrink: 0;
}
.uvi-avatar img { width: 100%; height: 100%; object-fit: contain; }

.uvi-bubble {
    background: #F9FAFB; padding: 14px 18px; border-radius: 0 16px 16px 16px;
    font-size: 14px; line-height: 1.6; color: #374151; border: 1px solid #F3F4F6;
    max-width: 85%; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.user-msg .uvi-bubble {
    background: #003d3f; color: #FFFFFF; border: none;
    border-radius: 16px 0 16px 16px;
    box-shadow: 0 4px 12px rgba(0, 61, 63, 0.15);
}

/* 3. Controls Area (Input) */
.uvi-controls-area {
    padding: 20px 24px; background: #FFFFFF; position: relative;
    border-top: 1px solid #F3F4F6;
    flex-shrink: 0;
}

.uvi-active-tools-container {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; min-height: 0;
}
.uvi-tool-badge {
    background: #fff; color: #eee; border: 1px solid #FCD34D;
    font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
    display: flex; align-items: center; gap: 6px; animation: popIn 0.2s;
}
.uvi-remove-tool { cursor: pointer; opacity: 0.6; }
.uvi-remove-tool:hover { opacity: 1; color: #B45309; }

/* --- INPUT WRAPPER --- */
.uvi-input-wrapper {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    gap: 8px;
}
.uvi-input-wrapper:focus-within {
    border-color: #003d3f;
    box-shadow: 0 4px 16px rgba(0, 61, 63, 0.1);
    transform: translateY(-1px);
}

.uvi-row-input { width: 100%; }
.uvi-main-input {
    width: 100%; border: none; outline: none; padding: 4px 0; font-size: 14px;
    background: transparent; color: #111; font-family: 'Inter', sans-serif;
}

.uvi-row-actions {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid #F9FAFB; padding-top: 8px;
}
.uvi-left-tools { display: flex; gap: 8px; align-items: center; }

.uvi-icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
    color: #6B7280; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.uvi-icon-btn:hover, .uvi-icon-btn.active { background: #F3F4F6; color: #003d3f; }

/* Pro Button */
.uvi-pro-wrapper { position: relative; margin-left: 4px; }
.uvi-pro-btn {
    background: #F3F4F6; border: none; color: #374151; font-size: 12px; font-weight: 600;
    padding: 6px 12px; border-radius: 20px; cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.uvi-pro-btn:hover, .uvi-pro-btn.active { background: #E5E7EB; color: #111; }
.uvi-pro-btn i { font-size: 10px; color: #9CA3AF; transition: transform 0.2s; }
.uvi-pro-btn.active i { transform: rotate(180deg); }

.uvi-send-btn {
    width: 34px; height: 34px; background: #FFC050; border: none; border-radius: 10px;
    color: #003d3f; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.1s; font-size: 14px;
}
.uvi-send-btn:hover { transform: scale(1.05); background: #FFD580; }

/* Menus */
.uvi-popup-menu {
    position: absolute; bottom: 85px; left: 24px;
    background: #FFFFFF; border: 1px solid #E5E7EB;
    border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 240px; display: none; overflow: hidden; animation: fadeUp 0.2s;
    z-index: 100;
}
.uvi-pro-dropdown { width: 160px; bottom: 50px; left: 80px; }
.uvi-popup-menu.wide-menu { width: 300px; max-height: 400px; }
.uvi-popup-menu.show { display: block; }

.menu-title { padding: 10px 16px; font-size: 11px; font-weight: 700; color: #9CA3AF; text-transform: uppercase; border-bottom: 1px solid #F3F4F6; }
.uvi-popup-menu ul { list-style: none; margin: 0; padding: 6px; }
.uvi-popup-menu li { padding: 10px 12px; font-size: 13px; color: #4B5563; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.uvi-popup-menu li:hover { background: #F9FAFB; color: #003d3f; }

.uvi-tool-list { padding: 6px; max-height: 300px; overflow-y: auto; }
.uvi-tool-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; cursor: pointer; transition: 0.1s; border: 1px solid transparent; }
.uvi-tool-item:hover { background: #F3F4F6; border-color: #E5E7EB; }
.tool-icon { width: 32px; height: 32px; background: #E0F2F1; color: #00695C; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tool-info { display: flex; flex-direction: column; flex-grow: 1; }
.tool-info .name { font-weight: 600; font-size: 13px; color: #1F2937; }
.tool-info .desc { font-size: 11px; color: #9CA3AF; }

/* --- UPDATED RIGHT PANEL (Workspace) --- */
.uvi-right-panel {
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    background: #F8F9FA;
    height: 100vh; /* Full Height */
    overflow: hidden; /* Prevent body scroll */
}

/* Editor Nav */
.uvi-editor-nav { 
    height: 60px; padding: 0 32px; background: #FFFFFF; 
    border-bottom: 1px solid #E5E7EB; 
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0; 
}

.uvi-tabs { display: flex; gap: 8px; background: #F3F4F6; padding: 4px; border-radius: 8px; }
.uvi-tab { padding: 6px 16px; font-size: 13px; font-weight: 500; color: #6B7280; cursor: pointer; border-radius: 6px; display: flex; align-items: center; gap: 6px; transition: 0.2s; }
.uvi-tab:hover { color: #111; }
.uvi-tab.active { background: #FFFFFF; color: #003d3f; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-weight: 600; }
.uvi-editor-actions { display: flex; gap: 10px; }
.action-btn { background: #003d3f; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* Workspace Body Fix */
.uvi-workspace-body {
    flex-grow: 1; 
    margin: 24px; 
    background: #FFFFFF;
    border: 1px solid #E5E7EB; border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    position: relative; 
    overflow-y: auto; /* Enable Scrolling inside the box */
    min-height: 0; /* Flexbox scroll fix */
}

.uvi-workspace-body::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(#E5E7EB 1px, transparent 1px);
    background-size: 24px 24px; opacity: 0.6; pointer-events: none;
    z-index: 0;
}
.uvi-empty-state { text-align: center; position: relative; z-index: 2; margin-top: 20%; }
.uvi-empty-state h3 { margin: 0 0 8px 0; font-size: 18px; color: #1F2937; }
.uvi-empty-state p { color: #6B7280; font-size: 14px; }

/* Final Render Content Formatting */
.uvi-final-render {
    padding: 20px;
    position: relative;
    z-index: 1;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }