:root {
    --cred-bg: #F8FAFC;
    --cred-text-main: #0F172A;
    --cred-text-secondary: #475569;
    --cred-primary: #059669;
    --cred-primary-light: #6EE7B7;
    --cred-border: #E5E7EB;
    --cred-shadow-glass: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.ai-credibility-block-section {
    padding: 100px 0;
    background-color: var(--cred-bg);
}

.credibility-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: center;
}

/* --- Left Side: Content & Metrics --- */
.credibility-content-left {
    padding-right: 40px;
}

.content-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--cred-text-main);
}

.text-primary-dark {
    color: var(--cred-primary);
}

.content-subtitle {
    font-size: 1.1rem;
    color: var(--cred-text-secondary);
    margin-bottom: 30px;
}

.btn-primary-pill {
    display: inline-block;
    background: linear-gradient(90deg, var(--cred-primary-light) 0%, var(--cred-primary) 100%);
    color: var(--cred-text-main);
    font-weight: 700;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
    transition: all 0.3s ease;
}

.btn-primary-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.5);
    color: var(--cred-text-main);
}

/* Metrics */
.metrics-grid {
    display: flex;
    gap: 40px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--cred-border);
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--cred-text-main);
    display: block;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--cred-text-secondary);
}

/* --- Right Side: Chat Mockup (Glassmorphism) --- */
.credibility-chat-mockup {
    position: relative;
    padding: 20px;
}

.chat-window-glass {
    background: rgba(255, 255, 255, 0.9); /* Slightly more opaque */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: var(--cred-shadow-glass);
    height: 550px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tabs */
.chat-window-tabs {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 15px 0 15px;
    border-bottom: 1px solid var(--cred-border);
    flex-shrink: 0;
}

.chat-tab {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cred-text-secondary);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    margin-right: 15px;
}
.chat-tab i {
    margin-right: 8px;
    color: var(--cred-text-secondary);
}
.chat-tab.active {
    color: var(--cred-primary);
    border-bottom: 3px solid var(--cred-primary);
    margin-bottom: -1px;
}
.chat-tab.active i {
    color: var(--cred-primary);
}
.chat-tab .close-icon {
    margin-left: 10px;
    font-size: 0.8rem;
    color: var(--cred-text-secondary);
}
.tab-controls {
    margin-left: auto;
    color: var(--cred-text-secondary);
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Chat Body */
.chat-window-body {
    flex-grow: 1;
    padding: 20px 25px;
    overflow-y: auto;
    background: var(--cred-surface-alt);
}

.chat-message-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--cred-text-secondary);
}
.avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ai-avatar {
    background: var(--cred-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border-radius: 8px; /* Square off the avatar for a "bot" feel */
}

.chat-bubble {
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.5;
}

.user-bubble {
    background: var(--cred-primary-light);
    color: var(--cred-text-main);
    border-radius: 12px 12px 12px 0;
}

.ai-bubble {
    background: var(--cred-surface);
    color: var(--cred-text-main);
    border-radius: 0 12px 12px 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- Premium Chat Output Styling --- */
.ai-typing-output-container {
    padding-top: 2px;
}

.ai-status-and-tag {
    display: inline-flex; /* Keep elements inline */
    align-items: center;
    margin-bottom: 10px;
}

.ai-status-tag {
    /* Styles for "CodeGen AI /writer" */
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cred-primary);
    margin-right: 10px;
}

.ai-thinking-dots {
    display: none; /* JS toggles visibility */
    color: var(--cred-text-secondary);
    font-size: 1rem;
    margin-top: -2px; /* Alignment fix */
}
.ai-thinking-dots span {
    display: inline-block;
    width: 4px; height: 4px;
    background: var(--cred-text-secondary);
    border-radius: 50%;
    margin-right: 2px;
    animation: bounce 1s infinite;
}
.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }


#ai-typing-output p {
    margin: 8px 0;
    font-size: 1rem;
}
#ai-typing-output p:first-child {
    margin-top: 0;
}
#ai-typing-output p:last-child {
    margin-bottom: 0;
}
#ai-typing-output strong {
    color: var(--cred-primary);
}

.cursor-blink {
    display: none; /* Hide initially */
}


.chat-window-footer-mock {
    height: 20px;
    flex-shrink: 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .credibility-layout-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .credibility-content-left {
        padding-right: 0;
        text-align: center;
    }
    .content-title {
        font-size: 2.5rem;
    }
    .metrics-grid {
        justify-content: center;
    }
    .credibility-chat-mockup {
        padding: 0;
    }
}

/* --- Animations --- */
@keyframes bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-3px); opacity: 0.5; }
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}