/* PA Professional Support Chat - Public Styles */

:root {
    /* LIGHT THEME (Default) */
    --pa-chat-bg: #ffffff;
    --pa-chat-bg-alt: #f9fafb;
    --pa-chat-text: #111827;
    --pa-chat-text-muted: #64748b;
    --pa-chat-border: #f3f4f6;
    --pa-chat-header-bg: #ffffff;
    --pa-chat-footer-bg: #f9fafb;
    --pa-chat-bubble-visitor-bg: #384355;
    --pa-chat-bubble-visitor-text: #ffffff;
    --pa-chat-bubble-agent-bg: #f3f4f6;
    --pa-chat-bubble-agent-text: #1f2937;
    --pa-chat-input-bg: #ffffff;
    --pa-chat-input-text: #1f2937;
    --pa-chat-input-border: #e2e8f0;
    --pa-chat-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --pa-chat-card-bg: #ffffff;
    --pa-chat-card-hover: #cbd5e1; /* Even darker Gray Slate-300 */
    --pa-chat-header-grad: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --pa-brand-primary: #3c485d;
    --pa-brand-glow: rgba(60, 72, 93, 0.2);
}

.pa-theme-dark {
    /* DARK THEME */
    --pa-chat-bg: #0f172a; /* Deep Slate Blue - Much darker as requested */
    --pa-chat-bg-alt: #1e293b; 
    --pa-chat-text: #f8fafc; 
    --pa-chat-text-muted: #cbd5e1; 
    --pa-chat-border: rgba(255, 255, 255, 0.1);
    --pa-chat-header-bg: #0f172a;
    --pa-chat-footer-bg: #0f172a; /* Match main background to reduce "thickness" */
    --pa-chat-bubble-visitor-bg: #334155;
    --pa-chat-bubble-visitor-text: #f8fafc;
    --pa-chat-bubble-agent-bg: #1e293b;
    --pa-chat-bubble-agent-text: #f1f5f9;
    --pa-chat-input-bg: #1e293b;
    --pa-chat-input-text: #f1f5f9;
    --pa-chat-input-border: #334155;
    --pa-chat-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --pa-chat-card-bg: rgba(255, 255, 255, 0.05); 
    --pa-chat-card-hover: rgba(255, 255, 255, 0.1);
    --pa-chat-header-grad: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

/* HIGH SPECIFICITY READABILITY FIXES FOR DARK MODE */
.pa-theme-dark .pa-chat-step-text,
.pa-theme-dark .pa-specialist-msg,
.pa-theme-dark .pa-specialist-role,
.pa-theme-dark .pa-form-group-clean label,
.pa-theme-dark .pa-specialist-text-col span,
.pa-theme-dark .pa-chat-footer-text,
.pa-theme-dark .pa-chat-privacy-simple,
.pa-theme-dark .pa-thought-bubble {
    color: var(--pa-chat-text-muted) !important;
}

.pa-theme-dark .pa-thought-bubble {
    background-color: var(--pa-chat-bg-alt) !important;
    border-color: var(--pa-chat-border) !important;
}

.pa-theme-dark .pa-chat-theme-btn {
    color: #ffffff !important; /* White for dark mode */
}

/* DARK MODE CONTRAST FIXES */
.pa-theme-dark .pa-ac-name,
.pa-theme-dark .pa-chat-agent-name,
.pa-theme-dark .pa-success-heading,
.pa-theme-dark h2.pa-chat-welcome-title,
.pa-theme-dark .pa-msg-intro .pa-msg-bubble {
    color: #ffffff !important;
}

.pa-theme-dark .pa-chat-footer {
    background-color: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 2px 20px !important; /* Absolute minimal padding */
    min-height: 0 !important;
}

.pa-theme-dark .pa-chat-footer-text {
    color: #64748b !important;
    margin-bottom: 2px !important; /* Minimal margin */
}

.pa-theme-dark .pa-chat-footer-links {
    color: #cbd5e1 !important;
    font-size: 11px !important; /* Slightly smaller for elegance */
}

.pa-theme-dark .pa-chat-brand-text,
.pa-theme-dark .pa-success-subheading-clean,
.pa-theme-dark .pa-msg-meta,
.pa-theme-dark .pa-ac-status {
    color: var(--pa-chat-text-muted) !important;
}

.pa-theme-dark .pa-input-wrapper {
    background-color: var(--pa-chat-input-bg) !important;
    border-color: var(--pa-chat-input-border) !important;
}

.pa-theme-dark .pa-chat-input-field {
    color: var(--pa-chat-input-text) !important;
}

.pa-theme-dark .pa-chat-input-field::placeholder {
    color: var(--pa-chat-text-muted) !important;
    opacity: 0.6;
}

.pa-theme-dark .pa-chat-date-divider span,
.pa-theme-dark .pa-chat-system-notice span {
    background-color: var(--pa-chat-bg-alt) !important;
    color: var(--pa-chat-text-muted) !important;
    border: 1px solid var(--pa-chat-border) !important;
}

.pa-theme-dark .pa-agent-card-modern {
    background: var(--pa-chat-bg-alt) !important;
    border-color: var(--pa-chat-border) !important;
}

.pa-theme-dark .pa-typing-bubble {
    background-color: var(--pa-chat-bg-alt) !important;
}

.pa-chat-container, .pa-chat-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    background-color: var(--pa-chat-bg) !important; /* Force new background color */
    color: var(--pa-chat-text);
}

.pa-chat-widget * {
    box-sizing: border-box;
}

h2.pa-chat-welcome-title {
    font-size: 15px; /* Slightly smaller font */
    font-weight: 700;
    line-height: 1.3;
    color: var(--pa-chat-text);
    margin: 0 0 16px 0; /* Reduced margin */
    text-align: center;
}

/* 1. Widget Container (Floating) */
.pa-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    height: 680px; /* Slightly taller for the extra gaps */
    min-height: 550px;
    max-height: 90vh; /* More vertical room */
    background-color: var(--pa-chat-bg);
    border-radius: 20px; /* Slightly more rounded for premium look */
    box-shadow: var(--pa-chat-shadow);
    overflow: hidden;
    z-index: 999999;
    display: none;
    flex-direction: column;
    animation: paFadeInUp 0.3s ease-out;
    border: 1px solid var(--pa-chat-border);
}

@keyframes paFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .pa-chat-widget {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
    
    .pa-teaser-card-inner {
        width: auto !important;
        max-width: 85vw;
    }
    
    .pa-teaser-title {
        font-size: 14px !important;
    }
}

/* 2. Header */
.pa-chat-header {
    background-color: var(--pa-chat-bg);
    color: var(--pa-chat-text);
    padding: 16px 20px 12px 20px; /* Reduced top/bottom to save height */
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--pa-chat-border);
    border-radius: 20px 20px 0 0;
}

.pa-chat-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pa-chat-shield-icon {
   width: 20px;
    height: 20px;
    color: #384355;/* Tailwind blue-600 */
}

.pa-chat-brand-text {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #64748b; /* Slate-500 */
    text-transform: uppercase;
}

.pa-chat-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 9999px;
    color: #94a3b8;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pa-chat-close-btn:hover, .pa-chat-theme-btn:hover {
    background-color: var(--pa-chat-border);
    color: var(--pa-chat-text);
}

.pa-chat-theme-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #4b5563 !important; /* Dark grey for light mode */
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    outline: none !important;
}

.pa-chat-theme-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.05);
}

.pa-chat-theme-btn svg {
    width: 20px !important;
    height: 20px !important;
    display: block;
}

/* 3. Content Area */
.pa-chat-content {
    flex: 1;
    overflow-y: auto !important;
    background-color: var(--pa-chat-bg) !important; 
    display: flex;
    flex-direction: column;
    height: 0; /* Important for flex-grow to work corectly in some browsers */
}

/* Custom Scrollbar */
.pa-chat-content::-webkit-scrollbar {
    width: 6px;
}
.pa-chat-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.pa-chat-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Welcome View */
.pa-chat-view-welcome {
    padding: 24px 20px 40px 20px; /* Extra bottom padding for the 4th card */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 500px; /* Keep welcome screen tall and impressive */
}

/* Ensure Form View also maintains height */
.pa-chat-view-form {
    min-height: 500px;
}

/* Agent Profile */
.pa-chat-avatar-container {
    width: 60px !important; /* Slightly smaller to save space */
    height: 60px !important;
    position: relative;
    margin: 0 auto 8px auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    /* Create a premium subtle rim effect */
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 2px;
    z-index: 5;
}

.pa-chat-avatar-ring {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
    border: 2px solid white;
    overflow: hidden;
    position: relative;
}

.pa-chat-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.pa-chat-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background-color: #22c55e; /* green-500 */
    border: 2px solid var(--pa-chat-bg);
    border-radius: 50%;
    z-index: 10;
}

.pa-bottom-info {
    padding: 16px 20px;
    background-color: var(--pa-chat-border);
    border-top: 1px solid var(--pa-chat-border);
    text-align: center;
}

.pa-chat-agent-name {
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    text-align: center;
    margin: 0 0 2px 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.pa-chat-agent-role {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.pa-chat-status-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b; /* Default to muted/offline color */
    font-weight: 600;
    margin-bottom: 20px;
}

/* If there's an 'online' indicator or text, we can highlight it. 
   Assuming the plugin might use a specific string or we can target it. */
.pa-chat-status-text .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #94a3b8; /* Offline dot */
}

/* Success/Online state (if we can detect it, otherwise we'll keep it neutral for now) */
.pa-chat-status-text.online {
    color: #22c55e;
}
.pa-chat-status-text.online .dot {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* Buttons */
.pa-chat-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Airy gap */
    padding: 0 4px 30px 4px !important;
}

.pa-chat-btn {
    width: 100%;
    background-color: var(--pa-chat-card-bg);
    border: 1px solid var(--pa-chat-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px; /* Rounder premium corners */
    padding: 18px 20px; /* Very airy buttons */
    margin-bottom: 0; /* Gap handles this now */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    color: var(--pa-chat-text) !important;
    text-align: left !important;
}

.pa-chat-btn:hover {
    background-color: var(--pa-chat-card-hover) !important;
    transform: translateY(-4px) scale(1.04) !important;
    border-color: var(--pa-chat-text-muted) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    z-index: 10;
    animation: none !important; 
}

/* SEQUENTIAL AUTO-ANIMATION (Dark Pop) */
@keyframes paDarkPop {
    0%, 25%, 100% { 
        background-color: var(--pa-chat-card-bg); 
        transform: scale(1);
        border-color: var(--pa-chat-border);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    }
    5%, 20% { 
        background-color: var(--pa-chat-card-hover); 
        transform: scale(1.04);
        box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
        border-color: var(--pa-chat-text-muted);
        z-index: 5;
    }
}

.pa-chat-btn:nth-child(1) { animation: paDarkPop 16s infinite 0s; }
.pa-chat-btn:nth-child(2) { animation: paDarkPop 16s infinite 4s; }
.pa-chat-btn:nth-child(3) { animation: paDarkPop 16s infinite 8s; }
.pa-chat-btn:nth-child(4) { animation: paDarkPop 16s infinite 12s; }

/* Cancel animations when mouse is over the container area */
.pa-chat-actions:hover .pa-chat-btn {
    animation: none !important;
}

.pa-chat-btn-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-align: left !important;
}

.pa-chat-btn-icon, .pa-chat-icon-box {
    width: 52px; /* Large premium icon backgrounds */
    height: 52px;
    min-width: 52px;
    background-color: var(--pa-chat-border) !important;
    color: var(--pa-chat-text) !important;
    border-radius: 16px; /* Modern squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Fixed placement */
}

.pa-chat-btn-icon i, 
.pa-chat-btn-icon svg,
.pa-chat-icon-box i {
    font-size: 26px !important; /* Scaled Icon */
}

.pa-chat-icon-box svg {
    width: 26px !important; 
    height: 26px !important;
    color: inherit !important;
    fill: currentColor;
}

.pa-chat-btn-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal; /* Allow text to wrap */
    text-align: left; /* Ensure left alignment for wrapped text */
}

.pa-chat-btn-content span:first-child {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pa-chat-text) !important;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    word-break: break-word; /* Allow long words to break if needed */
}

.pa-chat-arrow-icon {
    width: 16px;
    height: 16px;
    color: var(--pa-chat-text-muted) !important;
    opacity: 0.6;
    transition: all 0.2s;
}

.pa-chat-btn:hover .pa-chat-arrow-icon {
    color: var(--pa-chat-text) !important;
    opacity: 1;
    transform: translateX(3px);
}


/* 4. Footer */
.pa-chat-footer {
    background-color: var(--pa-chat-footer-bg);
    padding: 12px 20px; /* Reduced padding */
    border-top: 1px solid var(--pa-chat-border);
}

.pa-chat-footer-text {
    font-size: 10px;
    text-align: center;
    color: #9ca3af; /* gray-400 */
    margin-bottom: 8px;
    margin-top: 0;
}

.pa-chat-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pa-chat-text-muted); /* Corporate Blue */
}

.pa-chat-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.pa-chat-link:hover {
    color: #2b3342;
    text-decoration: underline;
}

.pa-chat-link svg {
    margin-right: 4px;
    width: 12px;
    height: 12px;
}


@keyframes paSlideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes paPulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.9);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* --- Reopen Teaser Card PREMIUM DESIGN --- */

.pa-chat-teaser-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Wrapper handles positioning, inner card handles look */
}

/* Main Pill Card - COMPACT */
.pa-teaser-card-inner {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 10px 10px 10px 48px; /* Balanced padding for avatar overlap */
    height: 60px; 
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.4), 
        0 10px 10px -5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: paSlideUpFade 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    z-index: 10;
    overflow: hidden; 
}

.pa-teaser-card-inner:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: linear-gradient(145deg, #252f3e 0%, #111827 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Shine Effect Animation */
@keyframes paShine {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 0.8; /* Much brighter start */
    }
    40% { /* Takes longer to cross (slower speed) */
        left: 200%;
        opacity: 0;
    }
    100% {
        left: 200%;
        opacity: 0;
    }
}

.pa-teaser-card-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 40%, 
        rgba(255, 255, 255, 0.7) 50%, /* Stronger white shine */
        rgba(255, 255, 255, 0.2) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    pointer-events: none; /* Let clicks pass through */
    animation: paShine 5s infinite ease-in-out; /* Slower loop (5s) */
    z-index: 15;
}

/* Row Container */
.pa-teaser-row {
    display: flex;
    align-items: center;
    position: relative;
    /* Ensure avatar is on top of card */
}

/* Avatar Wrapper - NOW OUTSIDE CARD */
.pa-teaser-avatar-wrapper {
    position: relative;
    width: 78px; 
    height: 78px;
    flex-shrink: 0;
    margin-right: -32px; /* DEEP Overlap */
    z-index: 20; 
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pa-teaser-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff; 
    background-color: #ffffff; 
}

.pa-teaser-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 18px; 
    height: 18px;
    background-color: #10b981;
    border: 3px solid #1e293b;
    border-radius: 50%;
    animation: paPulseGreen 2s infinite;
    z-index: 25;
}

/* Content Text */
.pa-teaser-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: normal; /* Fix alignment */
    padding-right: 12px;
}

.pa-teaser-subtitle {
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8; /* Slate-400 (Lighter gray) */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.pa-teaser-title {
    font-size: 17px;
    font-weight: 800; /* Extra Bold */
    margin: 0;
    color: white;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}



/* CTA Icon button - WHITE CIRCLE */
.pa-teaser-icon {
    width: 42px;
    height: 42px;
    background-color: var(--pa-chat-border); /* Light gray circle */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pa-chat-text); /* Dark Arrow */
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); /* Inner shadow for depth */
}

.pa-teaser-icon svg {
    width: 18px;
    height: 18px;
    margin-left: 2px;
}

/* --- Thought Bubbles Animations --- */
.pa-teaser-thoughts {
    position: absolute;
    bottom: 100%; /* Above the avatar */
    left: 50%; /* Center relative to avatar-wrapper */
    transform: translateX(-20%); /* Shift slightly to align tail with head */
    margin-bottom: 10px;
    width: max-content; /* Hug content */
    min-width: unset; 
    pointer-events: none;
    z-index: 30; /* Very high */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pa-thought-bubble {
    background-color: var(--pa-chat-bg-alt);
    color: #1f2937; /* Dark Gray for Light Mode */
    padding: 10px 16px;
    border-radius: 12px;
    white-space: nowrap; /* Prevent ugly wrapping */
    width: auto;
    border: 1px solid var(--pa-chat-border); /* Gold Border */
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: absolute;
    bottom: 0;
    left: 0;
    opacity: 0;
    transform-origin: bottom left;
}

/* The "Tail" of the bubble */
.pa-thought-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px; /* Push it down outside the bubble */
    left: 20px; /* Position horizontally */
    width: 0; 
    height: 0; 
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--pa-chat-border); /* Same color as border (simulating fill) */
}

/* Inner tail to mask border overlay slightly (optional for perfect border look) */
.pa-thought-bubble::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 22px;
    width: 0; 
    height: 0; 
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--pa-chat-bg-alt); /* Match bg color */
    z-index: 1;
}

/* Bubble Animations - Pop effect 3-Cycle */
/* Total cycle time: 12s (4s per bubble) */

@keyframes paBubbleCycle1 {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); visibility: hidden; }
    3% { opacity: 1; transform: scale(1) translateY(0); visibility: visible; }
    30% { opacity: 1; transform: scale(1) translateY(0); visibility: visible; }
    33% { opacity: 0; transform: scale(0.9) translateY(-10px); visibility: hidden; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes paBubbleCycle2 {
    0%, 33% { opacity: 0; visibility: hidden; }
    36% { opacity: 1; transform: scale(1) translateY(0); visibility: visible; }
    63% { opacity: 1; transform: scale(1) translateY(0); visibility: visible; }
    66% { opacity: 0; transform: scale(0.9) translateY(-10px); visibility: hidden; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes paBubbleCycle3 {
    0%, 66% { opacity: 0; visibility: hidden; }
    69% { opacity: 1; transform: scale(1) translateY(0); visibility: visible; }
    96% { opacity: 1; transform: scale(1) translateY(0); visibility: visible; }
    100% { opacity: 0; transform: scale(0.9) translateY(-10px); visibility: hidden; }
}

.pa-thought-bubble.bubble-1 {
    animation: paBubbleCycle1 12s infinite ease-in-out;
}

.pa-thought-bubble.bubble-2 {
    animation: paBubbleCycle2 12s infinite ease-in-out;
}

.pa-thought-bubble.bubble-3 {
    animation: paBubbleCycle3 12s infinite ease-in-out;
}

@media (max-width: 480px) {
    .pa-chat-teaser-wrapper {
        bottom: 16px;
        right: 16px;
        left: 16px;
        align-items: center; /* Center on mobile */
    }
    .pa-teaser-card-inner {
        width: 100%;
        justify-content: space-between;
    }
}


/* --- FORM VIEW STYLES (CLEAN APP UI) --- */

.pa-chat-view-form {
    padding: 16px 24px 32px 24px;
    background-color: var(--pa-chat-bg); /* FORCE WHITE BG like reference */
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill container */
    animation: paFadeInRight 0.3s ease-out;
}

@keyframes paFadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Progress Line (Blue bar below header) */
.pa-chat-progress-line-container {
    margin-bottom: 24px;
    text-align: center;
}

.pa-chat-progress-line-bg {
    width: 100%;
    height: 4px;
    background-color: var(--pa-chat-border);
    border-radius: 2px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.pa-chat-progress-line-fill {
    height: 100%;
    background-color: #1d4ed8; /* Blue-700 (Vibrant Royal) */
    border-radius: 2px;
}

.pa-chat-step-text {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Specialist Intro (Avatar left, text right) */
.pa-specialist-intro {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
}

.pa-specialist-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.pa-specialist-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: #f3f4f6;
}

.pa-specialist-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #22c55e;
    border: 2px solid var(--pa-chat-bg);
    border-radius: 50%;
}

.pa-specialist-text-col {
    display: flex;
    flex-direction: column;
}

.pa-specialist-role {
    font-size: 11px;
    font-weight: 800;
    color: var(--pa-chat-text); /* Corporate Blue */
    text-transform: uppercase;
    margin-bottom: 4px;
}


.pa-specialist-msg {
    font-size: 14px;
    line-height: 1.4;
    color: var(--pa-chat-text-muted); /* Gray-600 */
    margin: 0;
    font-weight: 500;
}

/* Main Form Title */
.pa-form-title-main {
    font-size: 22px;
    font-weight: 800;
    color: var(--pa-chat-text); /* Gray-900 */
    margin: 0 0 24px 0;
    letter-spacing: -0.02em;
}

/* Form Fields (Clean/Underline Style) */
.pa-chat-form-clean {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pa-form-group-clean {
    margin-bottom: 24px;
    position: relative;
    display: flex; 
    flex-direction: column;
    /* Simulate underline with border-bottom */
    border-bottom: 1px solid var(--pa-chat-border); /* Gray-200 */
}

.pa-form-group-clean:focus-within {
     border-bottom-color: var(--pa-chat-text); /* Dark blue focus */
}

.pa-form-group-clean label {
    font-size: 15px; /* Bigger label/placeholder */
    color: var(--pa-chat-text-muted); /* Gray-400 */
    font-weight: 500;
    margin-bottom: 4px;
}

.pa-form-group-clean input {
    width: 100%;
    border: none;
    background: transparent;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 16px;
    color: var(--pa-chat-text); 
    font-weight: 500;
    outline: none;
    box-shadow: none; /* No shadow */
}

/* Specific Phone Gap to avoid flag overlap */
#pa-phone {
    padding-left: 95px !important;
}

/* Intl-Tel-Input Integration */
.iti {
    width: 100%;
    margin-bottom: 2px;
}

.iti__country-list {
    background-color: var(--pa-chat-bg) !important;
    color: var(--pa-chat-text) !important;
    border: 1px solid var(--pa-chat-border) !important;
    border-radius: 8px !important;
    box-shadow: var(--pa-chat-shadow) !important;
    z-index: 9999 !important;
}

.iti__country:hover, .iti__country.iti__highlight {
    background-color: var(--pa-chat-bg-alt) !important;
}

.iti__selected-dial-code {
    color: var(--pa-chat-text) !important;
    font-size: 14px;
}

.iti__arrow {
    border-top-color: var(--pa-chat-text-muted) !important;
}

.iti__arrow--up {
    border-bottom-color: var(--pa-chat-text-muted) !important;
}

.pa-form-group-clean input::placeholder {
    color: transparent; /* Hide standard placeholder if using label as placeholder logic (simple here) */
}

/* Solid Dark Blue Submit Button */
.pa-chat-submit-btn-solid {
    margin-top: auto; /* Push to bottom */
    width: 100%;
    background-color: var(--pa-chat-text); 
    color: var(--pa-chat-bg);
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: var(--pa-chat-shadow);
    transition: background-color 0.2s;
    margin-bottom: 16px;
}

.pa-chat-submit-btn-solid:hover {
    background-color: var(--pa-chat-text-muted); /* Even darker blue */
}

.pa-btn-arrow {
    width: 20px;
    height: 20px;
}

/* Simple Privacy Text */
.pa-chat-privacy-simple {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.4;
    margin: 0;
    padding: 0 16px;
}

/* Privacy Footer & Fake Input */
.pa-chat-form-footer {
    margin-top: auto; /* Push to bottom if flex container allows */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pa-fake-input-wrapper {
    background-color: var(--pa-chat-input-bg); /* Very light gray */
    border: 1px solid var(--pa-chat-input-border);
    border-radius: 999px; /* Pill shape */
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--pa-chat-text-muted); /* Disabled text color */
    cursor: not-allowed;
}

.pa-fake-placeholder {
    font-size: 14px;
    color: var(--pa-chat-text-muted);
}

.pa-lock-icon {
    width: 16px;
    height: 16px;
    color: var(--pa-chat-text-muted);
}

.pa-chat-privacy-text {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    margin: 0;
    line-height: 1.3;
    padding: 0 16px;
}



/* --- SUCCESS VIEW STYLES --- */

.pa-chat-view-success {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 30%, #fef3c7 60%, #fff7ed 100%);
    background-size: 400% 400%;
    animation: paGradientFlow 8s ease-in-out infinite;
    height: 100%;
    display: flex;
    flex-direction: column;
}

@keyframes paGradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Simple Header */
/* Simple Header */
.pa-success-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px 20px; /* Reduced to avoid clutter */
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.pa-success-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--pa-chat-text);
    padding: 4px;
}

.pa-success-title {
    font-size: 20px;
    font-weight: 800;
    color: #3c485d;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Bottom Tab Bar (REMOVED) */
/* .pa-bottom-nav styles deleted */

/* Success Content - Integrated Glass Surface */
.pa-success-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    margin: 0; /* Remove margin to fix scroll/width issues */
    border-radius: 0; /* Remove radius for full integration */
    border: none;
    box-shadow: none;
    animation: paFadeInContent 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.pa-success-content-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

@keyframes paFadeInContent {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Big Check Icon */
.pa-success-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pa-success-icon-circle {
    width: 80px;
    height: 80px;
    background-color: var(--pa-chat-text); 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pa-chat-bg);
    box-shadow: var(--pa-chat-shadow); 
    z-index: 2;
}

.pa-check-icon {
    width: 40px;
    height: 40px;
}

.pa-success-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #384355;
    opacity: 0.2;
    z-index: 1;
    animation: paPulseSuccess 2s infinite;
}

/* Typography */
.pa-success-heading {
    font-size: 22px;
    font-weight: 800;
    color: #384355;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.pa-success-subheading {
    display: none; /* Hide old subheading if present */
}

/* Styled Instruction Box */
.pa-success-desc {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    background-color: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: 0 0 32px 0;
    max-width: 90%;
    text-align: center;
}

@keyframes paPulseSuccess {
    0% { transform: scale(1); opacity: 0.4; }
    70% { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Status Card */
.pa-status-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    width: 100%;
    text-align: left;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.pa-status-header {
    display: flex;
    align-items: center; /* Vertically center icon and text */
    gap: 8px; /* Space between icon and text */
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.pa-status-header svg {
    width: 16px; /* FORCE small size */
    height: 16px; /* FORCE small size */
    flex-shrink: 0; /* Prevent shrinking */
    color: #384355; 
}

.pa-clock-icon {
    color: #384355; 
}

.pa-status-value {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.pa-status-progress-bg {
    width: 100%;
    height: 6px;
    background-color: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.pa-status-progress-bar {
    width: 60%;
    height: 100%;
    background-color: #384355; 
    border-radius: 3px;
}

/* Action Button */
.pa-btn-understood {
    width: 100%;
    background-color: #384355; 
    color: white;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.pa-btn-understood:hover {
    background-color: #2c3543;
    transform: translateY(-1px);
}


/* --- CONVERSATION VIEW STYLES --- */

.pa-chat-view-conversation {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f1f5f9; /* Chat background */
    animation: paFadeInRight 0.3s ease-out;
}

/* Header */
.pa-conversation-header {
    background-color: white;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pa-conv-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    margin-left: -8px;
}

.pa-conv-profile {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pa-conv-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    overflow: visible !important;
}

.pa-conv-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.pa-conv-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    background-color: #22c55e !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    z-index: 10 !important;
    box-sizing: content-box !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

.pa-conv-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pa-conv-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.pa-conv-meta {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pa-conv-role {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563; /* Gray-600 */
}

.pa-conv-separator {
    font-size: 8px;
    color: #94a3b8;
}

.pa-conv-status-text {
    font-size: 11px;
    color: #22c55e; /* Green-500 */
    font-weight: 600;
}

.pa-conv-actions {
    display: flex;
    gap: 8px;
}

.pa-conv-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #3b82f6; /* Blue icons */
    padding: 6px;
}

.pa-conv-action-btn:hover {
    background-color: #f1f5f9;
    border-radius: 50%;
}

.pa-theme-dark .pa-chat-action-btn, 
.pa-theme-dark .pa-chat-btn {
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4) !important;
}

.pa-theme-dark .pa-chat-action-btn:hover,
.pa-theme-dark .pa-chat-btn:hover {
    background-color: #334155 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.pa-theme-dark .pa-chat-header-logo img {
    filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(255,255,255,0.2));
}

.pa-theme-dark .pa-chat-icon-box {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

.pa-theme-dark .pa-chat-btn-text,
.pa-theme-dark .pa-chat-btn-content span {
    color: #f8fafc !important;
}

/* Chat Area */
.pa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pa-chat-date-divider {
    text-align: center;
    margin: 8px 0;
}

.pa-chat-date-divider span {
    background-color: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 99px;
}

/* Messages */
/* Messages */
/* Animation Removed to fix "latir" (beating) effect */

.pa-msg-row {
    display: flex;
    gap: 12px; /* Increased gap */
    max-width: 90%; /* Allow slightly wider but not full width */
    opacity: 1; /* Visible by default */
}

/* New Animation Class - DISABLED animation for now to be safe */
.pa-msg-anim {
    opacity: 1; /* Show immediately */
    /* animation: none; */
}

.pa-msg-incoming {
    align-self: flex-start;
}

.pa-msg-outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.pa-msg-avatar {
    width: 32px; /* Slightly larger avatar */
    height: 32px;
    border-radius: 50%;
    align-self: flex-end; 
    margin-bottom: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Intro / Welcome Message (Centered, no avatar) */
.pa-msg-intro {
    align-self: center !important;
    max-width: 100% !important;
    margin: 8px 0;
    justify-content: center !important;
}

.pa-msg-intro .pa-msg-content {
    align-items: center !important;
}

.pa-msg-intro .pa-msg-bubble {
    background-color: var(--pa-chat-bg) !important;
    color: #475569 !important;
    border-radius: 20px !important;
    border: 1px solid var(--pa-chat-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
    text-align: center !important;
    font-size: 14px;
    line-height: 1.6;
    padding: 20px 24px;
    max-width: 90%;
}

.pa-msg-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start; /* Ensure content aligns left */
}

.pa-msg-outgoing .pa-msg-content {
    align-items: flex-end; /* Outgoing aligns right */
}

.pa-msg-bubble {
    padding: 14px 18px; /* More breathing room */
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Softer shadow */
    text-align: left !important; /* FORCE Left Align */
    word-wrap: break-word; /* Prevent overflow */
}

/* Incoming Bubble */
.pa-msg-incoming .pa-msg-bubble {
    background-color: var(--pa-chat-bubble-agent-bg);
    color: var(--pa-chat-bubble-agent-text);
    border-radius: 18px 18px 18px 4px; /* Rounder corners */
    border: 1px solid var(--pa-chat-border);
}

/* Outgoing Bubble */
.pa-msg-outgoing .pa-msg-bubble {
    background-color: var(--pa-chat-bubble-visitor-bg);
    color: var(--pa-chat-bubble-visitor-text);
    border-radius: 18px 18px 4px 18px; /* Rounder corners */
    text-align: left; /* Still left align text inside bubble usually looks better, or inherit */
}

.pa-msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: -4px; /* Pull up into bubble or keep below? Mockup has time below or inside. Sticking to below for clarity in CSS logic first, but user image has time OUTSIDE and BELOW. */
}

/* Fix: Time is OUTSIDE bubble in mockup */
.pa-msg-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.pa-msg-incoming .pa-msg-time {
    margin-left: 4px;
}

.pa-msg-outgoing .pa-msg-time {
    text-align: right;
    margin-right: 4px;
}

.pa-read-receipt {
    width: 14px;
    height: 14px;
    color: #3b82f6; /* Blue ticks */
}

/* Typing Animation */
.pa-typing-bubble {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.pa-typing-dots {
    display: flex;
    gap: 4px;
}

.pa-typing-dots span {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: paTypingBounce 1.4s infinite ease-in-out both;
}

.pa-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.pa-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes paTypingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* --- CONVERSATION VIEW (LIVE CHAT) --- */
.pa-chat-view-conversation {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pa-conversation-header {
    padding: 12px 16px;
    background-color: var(--pa-chat-bg);
    border-bottom: 1px solid var(--pa-chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pa-chat-messages {
    flex: 1;
    overflow-y: auto !important;
    padding: 20px 16px;
    background-color: var(--pa-chat-bg-alt);
    background-image: radial-gradient(var(--pa-chat-border) 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Input Footer */
.pa-chat-input-footer {
    background-color: var(--pa-chat-bg);
    padding: 16px 20px;
    border-top: 1px solid var(--pa-chat-border);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

.pa-input-attach-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
}

.pa-input-wrapper {
    flex: 1;
    background-color: #f8fafc;
    border-radius: 24px;
    padding: 2px 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.pa-input-wrapper:focus-within {
    background-color: #ffffff;
    border-color: #384355;
    box-shadow: 0 0 0 3px rgba(56, 67, 85, 0.1);
}

.pa-chat-input-field {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    font-size: 15px;
    color: #1e293b;
    padding: 10px 0 !important;
    font-family: inherit;
    box-shadow: none !important; /* Remove any theme box shadows */
}

.pa-chat-input-field::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.pa-input-send-btn {
    background-color: #384355;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(56, 67, 85, 0.25);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pa-input-send-btn:hover {
    background-color: #2c3543;
    transform: scale(1.05);
}

.pa-input-send-btn:active {
    transform: scale(0.92);
}

/* Subtle icon inside send */
.pa-input-send-btn svg {
    transform: translateX(1px); /* Slight adjustment for visual center */
}


/* Bottom Tab Bar */
.pa-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: white;
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.pa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #94a3b8; /* Slate-400 */
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.pa-nav-item.active {
    color: #2563eb; /* Blue-600 */
}

.pa-nav-item svg {
    width: 24px;
    height: 24px;
}




/* --- FLOATING ASSISTANT LAUNCHER --- */
.pa-floating-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998; /* Below widget (999999) */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.pa-floating-avatar-container {
    position: relative;
    width: 60px;
    height: 60px;
    animation: paLevitate 3s ease-in-out infinite;
}

.pa-floating-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2;
}

/* Pulse Ring Effect */
.pa-pulse-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 1px solid var(--pa-primary-color, #2563eb);
    opacity: 0;
    z-index: 1;
}

.pa-pulse-ring:nth-child(1) { animation: paPulseRing 2s linear infinite; }
.pa-pulse-ring:nth-child(2) { animation: paPulseRing 2s linear infinite 0.5s; }

/* Status Dot on Floating Avatar */
.pa-floating-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 3;
}

/* Tooltip / Speech Bubble */
.pa-floating-tooltip {
    position: absolute;
    right: 110%; /* Left of avatar */
    top: 50%;
    transform: translateY(-50%);
    background: white;
    color: #1e293b;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s;
    margin-right: 12px;
}

/* Show tooltip on larger screens or auto after delay via JS class */
.pa-floating-launcher:hover .pa-floating-tooltip,
.pa-floating-tooltip.px-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ANIMATIONS */
@keyframes paLevitate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes paPulseRing {
    0% { transform: scale(0.8); opacity: 0.5; border-width: 2px; }
    100% { transform: scale(2.2); opacity: 0; border-width: 0; }
}


/* Hide Generic Launcher Styles if we replace it */


/* --- FLOATING HOUSE MASCOT (Interactive) --- */
.pa-chat-view-welcome {
    position: relative;
    /* Ensure container has some right padding if needed for mascot, or mascot overlays */
    overflow: hidden; /* Or visible? If mascot goes out bounds. Let's keep visible for now */
    overflow: visible; 
}

.pa-floating-mascot {
    position: absolute;
    right: 2px; /* Float inside the content area */
    top: 180px; /* Starting position aligned with first button area */
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
    pointer-events: none; /* Let clicks pass */
    transition: all 0.3s;
    animation: paMascotPatrol 8s ease-in-out infinite alternate;
}

.pa-mascot-body {
    position: relative;
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    transform-origin: center bottom;
    animation: paMascotBounce 2s ease-in-out infinite;
}

.pa-mascot-body svg {
    width: 100%;
    height: 100%;
    /* Custom House Colors if SVG is inline */
}

/* The Pointing Hand */
.pa-mascot-hand {
    position: absolute;
    left: -20px;
    top: 50%;
    font-size: 24px;
    transform: translateY(-50%);
    animation: paHandPoint 1s ease-in-out infinite;
}

/* Tooltip */
.pa-mascot-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    color: #1e293b;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    white-space: nowrap;
    margin-bottom: 5px;
    opacity: 0;
    animation: paTooltipFade 8s infinite; /* Sync with patrol */
}

.pa-mascot-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 20px;
    width: 8px;
    height: 8px;
    background: #fff;
    transform: rotate(45deg);
}

/* ANIMATIONS */

/* Move Up and Down along the buttons */
@keyframes paMascotPatrol {
    0% { top: 180px; } /* Near Button 1 */
    33% { top: 250px; } /* Near Button 2 */
    66% { top: 320px; } /* Near Button 3 */
    100% { top: 380px; } /* Near Button 4 */
}

/* Bounce for liveliness */
@keyframes paMascotBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(5deg); }
}

/* Pointing Logic - Poke left */
@keyframes paHandPoint {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}

/* Tooltip visibility cycle */
@keyframes paTooltipFade {
    0%, 5% { opacity: 0; transform: translateY(5px); }
    10%, 40% { opacity: 1; transform: translateY(0); } /* Show for a while */
    45%, 100% { opacity: 0; transform: translateY(5px); } /* Hide as it moves */
}

/* Mobile Adjustments */
@media (max-width: 380px) {
    .pa-floating-mascot {
        right: -5px;
        transform: scale(0.8);
    }
}


/* Update Success View Spacing */
.pa-success-heading {
    margin-top: 10px;
    margin-bottom: 8px;
    font-size: 18px; /* Slightly larger */
}

.pa-success-desc {
    margin-bottom: 24px; /* More space before simulation card */
    font-size: 14px;
}

.pa-simulation-wrapper {
    margin-top: 10px; /* Ensure separation */
}

/* --- NEW SUCCESS VIEW DESIGN (Halo + Clean Card) --- */
.pa-success-icon-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pa-icon-halo {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--pa-brand-glow) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    animation: paPulseGlow 3s infinite ease-in-out;
}

@keyframes paPulseGlow {
    0%, 100% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.pa-icon-circle {
    position: relative;
    width: 60px;
    height: 60px;
    background: var(--pa-brand-primary);
    border-radius: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 12px 20px -5px rgba(60, 72, 93, 0.4);
    animation: paIconAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes paIconAppear {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.pa-check-icon {
    width: 40px;
    height: 40px;
}

.pa-deco-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 3;
}

.dot-orange {
    background-color: #ffb366; /* Soft orange */
    top: 10px;
    right: 20px;
}

.dot-blue {
    background-color: #a5b4fc; /* Light purple/blue */
    bottom: 20px;
    left: 20px;
}

/* Text Styles */
.pa-success-heading {
    font-size: 22px !important;
    font-weight: 800;
    color: #1e293b;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.pa-success-subheading-clean {
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    text-align: center;
    margin: 0 0 10px 0;
}

.pa-success-desc-clean {
    font-size: 14px;
    color: #475569;
    text-align: center;
    max-width: 300px;
    margin: 0 auto 20px auto;
    line-height: 1.6;
}

/* Agent Card Modern with Glow and Glass */
.pa-agent-card-modern {
    background: rgba(255, 255, 255, 0.95); /* More opaque */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 
        0 12px 25px -10px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 310px; /* Safer width for small phones */
    min-width: 280px;
    margin: 8px auto;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pa-agent-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.1);
}

.pa-agent-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    background-size: 200% 100%;
    animation: paShimmer 3s infinite linear;
}

.pa-ac-avatar-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.pa-ac-img {
    width: 100%;
    height: 100%;
    border-radius: 14px; /* Squircle-ish */
    object-fit: cover;
}

.pa-ac-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: #22c55e; /* Green */
    border: 2px solid white;
    border-radius: 50%;
}

.pa-ac-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pa-ac-badge {
    background-color: #dcfce7; /* Green-100 */
    color: #166534; /* Green-800 */
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.pa-ac-name {
    font-size: 15px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0;
    line-height: 1.2;
}

.pa-ac-status {
    font-size: 9px;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* Simple Loader for Screen 1 */
/* Main Loader for Assignment Simulation */
.pa-loader-spinner {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    margin: 0 auto 24px auto;
    display: block;
    animation: paSpinUI 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.2));
    position: relative;
    box-sizing: border-box;
}

@keyframes paSpinUI {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@-webkit-keyframes paSpinUI {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

/* Loader handled solely by the main element rotation */

.pa-simulation-wrapper {
    margin: 8px 0;
    padding: 0;
    width: 100%;
}

.pa-sim-screen-1 {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 32px 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 20px 40px -12px rgba(0, 0, 0, 0.1),
        0 8px 16px -8px rgba(0, 0, 0, 0.05);
    transition: all 0.5s ease;
    width: 100%;
    margin: 8px 0;
}

/* Dark mode override for simulation screen */
.pa-theme-dark .pa-sim-screen-1 {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.pa-sim-screen-2 {
    width: 100%;
    min-height: 120px;
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    margin: 0;
    transition: all 0.4s ease;
}

.pa-sim-text-clean {
    font-size: 17px;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 12px;
    animation: paTextPulse 2s infinite ease-in-out;
}

.pa-theme-dark .pa-sim-text-clean {
    color: #f8fafc !important;
}

@keyframes paTextPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pa-sim-progress-bg {
    width: 80%;
    height: 4px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    margin: 28px auto 8px auto;
    overflow: hidden;
    position: relative;
}

.pa-sim-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    background-size: 200% 100%;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    animation: paShimmer 3s infinite linear;
}

/* Dark mode for progress bar */
.pa-theme-dark .pa-sim-progress-bg {
    background: rgba(255, 255, 255, 0.05) !important;
}

@keyframes paShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes paSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- TYPING INDICATOR --- */
#pa-typing-indicator {
    margin-top: 8px;
}

.pa-typing-bubble {
    background-color: #f1f5f9;
    padding: 12px 16px;
    border-radius: 0 16px 16px 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

.pa-typing-dot {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: paTypeBounce 1.4s infinite ease-in-out both;
}

.pa-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.pa-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes paTypeBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* System Notices & Date Dividers */
.pa-chat-date-divider, .pa-chat-system-notice {
    text-align: center;
    margin: 4px 0; /* Reduced to avoid double spacing with container gap */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.pa-chat-date-divider span, .pa-chat-system-notice span {
    background-color: #f1f5f9;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    border: 1px solid #e2e8f0;
}

.pa-chat-system-notice span {
    color: #475569;
    text-transform: none;
    font-size: 11px;
    background-color: #f8fafc;
}

/* Cleaned up Voice Recording Styles */

/* Audio Player Styles (Restored for Playback only) */
.pa-voice-note-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    min-width: 140px;
}

.pa-vn-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.pa-msg-incoming .pa-vn-play-btn {
    background-color: #e2e8f0;
    color: #64748b;
}

.pa-vn-progress-wrap {
    flex: 1;
    height: 4px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.pa-msg-incoming .pa-vn-progress-wrap {
    background-color: #cbd5e1;
}

.pa-vn-bar {
    width: 0%;
    height: 100%;
    background-color: white;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.pa-msg-incoming .pa-vn-bar {
    background-color: #64748b;
}

.pa-vn-transcription {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
    font-style: italic;
}

/* Send Button Styles */
.pa-input-send-btn {
    background-color: #3b82f6; /* Blue-500 */
    color: white;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 12px; /* Squircle shape matching reference */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px; /* Space from input */
}

.pa-input-send-btn:hover {
    background-color: #2563eb; /* Blue-600 */
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.pa-input-send-btn:active {
    transform: scale(0.95);
}

.pa-input-send-btn:disabled {
    background-color: #f1f5f9; /* Slate-100 */
    color: #94a3b8; /* Slate-400 */
    cursor: default;
    transform: none;
    box-shadow: none;
}
