/**
 * VMO Business Wizard - Professional Text Formatting Fix
 * Fixes the terrible centered text and makes it readable like VS Code chat
 * Date: October 10, 2025
 */

/* ========================================
   CRITICAL FIX: LEFT-ALIGN ALL AI MESSAGES
   ======================================== */

/* Override the terrible centered styling */
.vmo-ai-message .vmo-message-content,
.vmo-wizard-conversation .vmo-ai-message .vmo-message-content,
.vmo-business-wizard-fullscreen .vmo-message-content {
    text-align: left !important;  /* ✅ NOT CENTERED! */
    margin: 0 !important;  /* Remove auto-centering */
    padding: 20px !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    font-weight: 400 !important;  /* Normal weight, not bold */
}

/* ========================================
   MESSAGE HEADERS + TIMESTAMPS
   ======================================== */

.vmo-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 6px 0;
}

.vmo-message-role {
    font-weight: 600;
    color: #ffffff;
}

.vmo-message-timestamp {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   PARAGRAPH FORMATTING (Like VS Code)
   ======================================== */

.vmo-message-content p,
.vmo-wizard-conversation p {
    margin: 0 0 14px 0 !important;  /* Space between paragraphs */
    text-align: left !important;
    line-height: 1.7 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
}

.vmo-message-content p:last-child {
    margin-bottom: 0 !important;  /* No space after last paragraph */
}

.vmo-message-content p:first-child {
    margin-top: 0 !important;
}

/* ========================================
   SECTION HEADERS (Bold Text)
   ======================================== */

.vmo-message-content strong,
.vmo-message-content b {
    display: inline-block;
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #00ffaa !important;
    text-align: left !important;
}

/* First strong element shouldn't have top margin */
.vmo-message-content strong:first-child,
.vmo-message-content b:first-child {
    margin-top: 0 !important;
}

/* ========================================
   LISTS (Bullet Points & Numbered)
   ======================================== */

.vmo-message-content ul,
.vmo-message-content ol {
    margin: 10px 0 14px 0 !important;
    padding-left: 28px !important;
    text-align: left !important;
    list-style-position: outside !important;
}

.vmo-message-content li {
    display: list-item !important;  /* ✅ CRITICAL: Force each item on new line */
    margin-bottom: 8px !important;
    margin-left: 20px !important;
    text-align: left !important;
    line-height: 1.6 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
}

.vmo-message-content li:last-child {
    margin-bottom: 0 !important;
}

/* Bullet point styling */
.vmo-message-content ul li {
    list-style-type: disc !important;
}

.vmo-message-content ul li::marker {
    color: #00ffaa !important;
}

/* Numbered list styling */
.vmo-message-content ol li {
    list-style-type: decimal !important;
}

.vmo-message-content ol li::marker {
    color: #00ffaa !important;
    font-weight: 700 !important;
}

/* Nested lists */
.vmo-message-content ul ul,
.vmo-message-content ol ul {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
    padding-left: 24px !important;
}

.vmo-message-content ul ul li {
    list-style-type: circle !important;
}

.vmo-message-content ul ul ul li {
    list-style-type: square !important;
}

/* ========================================
   INLINE CODE & EMPHASIS
   ======================================== */

.vmo-message-content code {
    background: rgba(0, 255, 255, 0.1) !important;
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 14px !important;
    color: #00ffff !important;
}

.vmo-message-content em,
.vmo-message-content i {
    font-style: italic !important;
    color: rgba(234, 255, 255, 0.9) !important;
}

/* ========================================
   LINE BREAKS & SPACING
   ======================================== */

.vmo-message-content br {
    content: "" !important;
    display: block !important;
    margin: 8px 0 !important;
}

/* Add space between different elements */
.vmo-message-content > * + * {
    margin-top: 12px !important;
}

.vmo-message-content > *:first-child {
    margin-top: 0 !important;
}

.vmo-message-content > *:last-child {
    margin-bottom: 0 !important;
}

/* ========================================
   HEADINGS (H1-H6)
   ======================================== */

.vmo-message-content h1,
.vmo-message-content h2,
.vmo-message-content h3,
.vmo-message-content h4,
.vmo-message-content h5,
.vmo-message-content h6 {
    text-align: left !important;
    margin: 16px 0 10px 0 !important;
    font-weight: 700 !important;
    color: #00ffaa !important;
}

.vmo-message-content h1 { font-size: 24px !important; }
.vmo-message-content h2 { font-size: 20px !important; }
.vmo-message-content h3 { font-size: 18px !important; }
.vmo-message-content h4 { font-size: 16px !important; }
.vmo-message-content h5 { font-size: 15px !important; }
.vmo-message-content h6 { font-size: 14px !important; }

/* First heading shouldn't have top margin */
.vmo-message-content > h1:first-child,
.vmo-message-content > h2:first-child,
.vmo-message-content > h3:first-child,
.vmo-message-content > h4:first-child {
    margin-top: 0 !important;
}

/* ========================================
   BLOCKQUOTES
   ======================================== */

.vmo-message-content blockquote {
    margin: 12px 0 !important;
    padding: 12px 16px !important;
    border-left: 4px solid #00ffaa !important;
    background: rgba(0, 255, 170, 0.05) !important;
    text-align: left !important;
}

.vmo-message-content blockquote p {
    margin: 0 !important;
    font-style: italic !important;
    color: rgba(234, 255, 255, 0.85) !important;
}

/* ========================================
   LINKS
   ======================================== */

.vmo-message-content a {
    color: #00ffff !important;
    text-decoration: underline !important;
    transition: color 0.2s ease !important;
}

.vmo-message-content a:hover {
    color: #00ffaa !important;
    text-decoration: none !important;
}

/* ========================================
   USER MESSAGES (Keep simple)
   ======================================== */

.vmo-user-message-content {
    text-align: left !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
}

.vmo-user-message-content p {
    margin: 0 !important;
    text-align: left !important;
}

/* ========================================
   WIZARD INTRO MESSAGE (Exception - Can stay centered)
   ======================================== */

.vmo-wizard-intro-large {
    text-align: center !important;  /* Only intro can be centered */
    max-width: 100% !important;
    background: rgba(0, 255, 154, 0.08) !important;
    border: 1px solid rgba(0, 255, 154, 0.15) !important;
}

.vmo-wizard-intro-large p,
.vmo-wizard-intro-large strong {
    text-align: center !important;
}

/* But regular intro messages should be left-aligned */
.vmo-ai-message:not(.vmo-wizard-intro-large) .vmo-message-content {
    text-align: left !important;
}

/* ========================================
   OVERRIDE ANY CONFLICTING STYLES
   ======================================== */

/* Force left alignment everywhere in wizard */
.vmo-business-wizard-fullscreen .vmo-wizard-conversation * {
    text-align: left !important;
}

/* Exception for centered intro */
.vmo-business-wizard-fullscreen .vmo-wizard-intro-large * {
    text-align: center !important;
}

/* Remove bold from all regular text */
.vmo-wizard-conversation p,
.vmo-wizard-conversation span:not(.vmo-wizard-label),
.vmo-wizard-conversation div {
    font-weight: 400 !important;
}

/* Only strong/b tags should be bold */
.vmo-wizard-conversation strong,
.vmo-wizard-conversation b {
    font-weight: 700 !important;
}

/* ========================================
   SCROLLBAR STYLING (Bonus)
   ======================================== */

.vmo-wizard-conversation::-webkit-scrollbar {
    width: 8px;
}

.vmo-wizard-conversation::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.vmo-wizard-conversation::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 170, 0.3);
    border-radius: 4px;
}

.vmo-wizard-conversation::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 170, 0.5);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .vmo-message-content,
    .vmo-user-message-content {
        max-width: 95% !important;
        padding: 16px !important;
        font-size: 14px !important;
    }
    
    .vmo-message-content p {
        font-size: 14px !important;
    }
    
    .vmo-message-content li {
        font-size: 14px !important;
    }
}

/* ========================================
   ANIMATION (Smooth message appearance)
   ======================================== */

.vmo-message {
    animation: vmo-message-fade-in 0.3s ease-out;
}

@keyframes vmo-message-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   FINAL OVERRIDES (Nuclear option)
   ======================================== */

/* If all else fails, force it! */
.vmo-wizard-conversation .vmo-ai-message .vmo-message-content,
.vmo-wizard-conversation .vmo-ai-message .vmo-message-content *:not(strong):not(b):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
    text-align: left !important;
}
