/* Chat Bubble Styling - Refined */

.message-container {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
    /* Removed gap, margin on wrapper will handle spacing */
}

.hidden {
    display: none;
}

/* Styles for the new message wrapper */
.message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px; /* Space between message groups */
    width: 100%; /* Allow wrapper to take up most width */
}

/* Styles for the new message header */
.message-header {
    font-size: 0.75rem; /* Smaller font size */
    color: #666;      /* Grey color */
    margin-bottom: 3px; /* Space below header */
    padding: 0 5px;    /* Slight horizontal padding to align with bubble edge */
    font-weight: normal; /* Ensure base header text is normal weight */
}

/* Target the strong tag within the header for the sender name */
.message-header strong {
    font-weight: 600; /* Make the sender name bold (or use 'bold') */
    /* Optional: Add a subtle margin if needed */
    /* margin-right: 4px; */ 
}

/* Align agent messages (header and bubble) to the left */
.message-wrapper.agent {
    align-items: flex-start;
}
/* Align user messages (header and bubble) to the right */
.message-wrapper.user {
    align-items: flex-end;
}
/* Ensure header text aligns correctly for user */
.message-wrapper.user .message-header {
    text-align: right;
}

/* No longer need the centered .message-time */

.agent-message, .user-message {
    max-width: 85%; 
    /* Reduced padding */
    padding: 8px 12px; 
    border-radius: 18px; 
    font-size: 0.95rem; 
    font-weight: 500; 
    line-height: 1.45; 
    word-wrap: break-word; 
    overflow-wrap: break-word;
    text-align: left; 
}

.agent-message {
    background: #f0f0f0; 
    color: #333;
    border: none; 
    /* align-self handled by wrapper */
}

/* Styling for lists inside agent messages */
.agent-message ul {
    padding-left: 25px; 
    margin-top: 8px;
    margin-bottom: 4px;
}

.agent-message li {
    margin-bottom: 5px; 
}

.user-message {
    background: #D1E8FF; 
    color: #111; 
    /* align-self handled by wrapper */
}

/* New Integration Message Style */
.integration-message {
    background-color: #D1E8FF; 
    color: #111; /* Black text for content */
    border-radius: 18px;
    padding: 10px 12px 10px 25px; /* Adjust padding: top right(changed to 12px) bottom left */
    font-size: 0.95rem;
    line-height: 1.45;
    position: relative; /* Needed for positioning the vertical bar */
    overflow: hidden; /* Ensure bar doesn't overflow rounded corners */
    max-width: 85%; /* Keep similar width constraint */
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
}

/* Vertical blue bar */
.integration-message::before {
    content: '';
    position: absolute;
    left: 8px; /* Position from the left edge */
    top: 8px;  /* Position from the top */
    bottom: 8px; /* Position from the bottom */
    width: 4px; /* Width of the bar */
    background-color: #007aff; /* Blue color like screenshot */
    border-radius: 2px; /* Slightly rounded ends for the bar */
}

/* Style for the title line */
.integration-message .integration-title {
    color: #007aff; /* Blue color for title */
    font-weight: 600; /* Bold title */
    margin-bottom: 4px; /* Space below title */
    font-size: 0.9rem; /* Slightly smaller title font */
}

/* Style for the content line (inherits color from .integration-message) */
.integration-message .integration-content {
    font-weight: 400; /* Regular weight for content */
}

.agent-message-image {
    max-width: 80%; /* Keep image width contained */
    /* align-self handled by wrapper if needed, or keep here */
    align-self: flex-start; 
    margin-bottom: 0; /* Remove bottom margin if inside a wrapper */
    border-radius: 15px; 
    overflow: hidden; 
}

/* If image is inside a wrapper, apply rounding there too */
.message-wrapper .agent-message-image {
     border-radius: 15px;
     overflow: hidden;
     /* Adjust max-width as needed */
     max-width: 85%;
}

/* New Call Action Box Styling - Matched to agent-message */
.call-action-box {
    /* Background matches agent message */
    background-color: #f0f0f0; 
    /* Removed border */
    /* border: 1px solid rgba(0, 0, 0, 0.05); */ 
    /* Matched border-radius */
    border-radius: 18px; 
    /* Matched padding */
    padding: 8px 12px; 
    /* Matched max-width */
    max-width: 85%; 
    /* Removed specific width settings */
    /* width: fit-content; */ 
    /* min-width: 250px; */ 
    line-height: 1.5;
}

.call-action-header {
    display: flex;
    align-items: center;
    /* Adjusted margin slightly as subtitle is removed */
    margin-bottom: 8px; 
}

/* Updated icon style for SVG */
.call-action-icon {
    /* display: none; */ /* Remove display: none */
    /* Increased size */
    width: 24px;  
    height: 24px; 
    margin-right: 8px; /* Adjust spacing if needed */
    vertical-align: middle; /* Helps align SVG with text */
    fill: #007aff; /* This should now work if SVG uses currentColor */
    /* Remove styles used for the block */
    /* background-color: #ff9800; */
    /* border-radius: 3px; */
}

.call-action-title {
    /* Updated color to blue */
    color: #007aff; 
    font-weight: 700; /* Bold title */
    font-size: 1rem; /* Title font size */
}

.call-action-body {
    /* Container for subtitle and text */
}

/* .call-action-subtitle can be removed or left, as it's removed from HTML */
/*
.call-action-subtitle {
    color: #ff9800; 
    font-weight: 700; 
    font-size: 0.9rem; 
    display: block; 
    margin-bottom: 5px; 
}
*/

.call-action-text {
    color: #333; /* Standard text color */
    font-weight: 400; /* Normal weight */
    font-size: 0.9rem; /* Text font size */
    margin: 0; /* Remove default paragraph margin */
}

/* Optional: Fake chart styles */
.fake-chart {
    height: 120px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    position: relative;
}

.fake-chart::before {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 60px;
    background: linear-gradient(90deg, 
        #ddd 0%, #ddd 10%, 
        #aaa 10%, #aaa 20%,
        #ddd 20%, #ddd 30%,
        #aaa 30%, #aaa 40%,
        #0062E6 40%, #0062E6 50%,
        #0062E6 50%, #0062E6 60%,
        #0062E6 60%, #0062E6 70%,
        #0062E6 70%, #0062E6 80%,
        #33AEFF 80%, #33AEFF 90%,
        #33AEFF 90%, #33AEFF 100%
    );
    clip-path: polygon(
        0% 100%, 
        10% 70%, 
        20% 80%, 
        30% 60%,
        40% 50%,
        50% 30%,
        60% 40%,
        70% 20%,
        80% 30%,
        90% 20%,
        100% 10%,
        100% 100%
    );
}

/* New General Action Box Styling */
.action-box {
    background-color: #f0f0f0; 
    border-radius: 18px; 
    padding: 8px 12px; 
    max-width: 85%; 
    line-height: 1.5;
    margin-bottom: 8px;
}

.action-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px; 
}

.action-icon {
    width: 24px;  
    height: 24px; 
    margin-right: 8px;
    vertical-align: middle;
    fill: #007aff;
}

.action-title {
    color: #007aff; 
    font-weight: 700;
    font-size: 1rem;
}

.action-body {
    /* Container for action content */
}

.action-text {
    color: #333;
    font-weight: 400;
    font-size: 0.9rem;
    margin: 0;
}

/* Call Status - For system notifications */
.call-status {
    background-color: #f0f0f0;
    color: #007aff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 85%;
    text-align: center;
    margin: 8px 0;
} 