/* ========================================
   Lawyer Search (fal-) Styles
   ======================================== */

/* Default CSS variables (can be overridden by host app) */
:root {
    --uvp-primary: #80114C;
    --uvp-primary-dark: #4a1a51;
    --uvp-primary-light: #8b3594;
    --uvp-secondary: #a41e4d;
    --uvp-accent: #d4a5c9;
    --uvp-text: #333333;
    --uvp-text-light: #666666;
    --uvp-border: #e0e0e0;
    --uvp-border-focus: #6b2574;
    --uvp-background: #ffffff;
    --uvp-background-light: #f8f5f9;
    --uvp-error: #dc3545;
    --uvp-success: #28a745;
    --uvp-info: #6b2574;
}

.fal-container {
    display: flex;
    gap: 2rem;
    min-height: calc(100vh - 140px);
}

/* Left Side - Chat */
.fal-chat-section {
    flex: 0 0 65%;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - 140px);
    position: sticky;
    top: 80px;
}

.fal-chat-header {
    padding: 3rem 2rem 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.fal-chat-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.fal-new-chat-btn {
    background: var(--uvp-background-light);
    color: var(--uvp-primary);
    border: 1px solid var(--uvp-border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.fal-new-chat-btn:hover:not(:disabled) {
    background: var(--uvp-accent);
    border-color: var(--uvp-primary);
}

.fal-new-chat-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fal-chat-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    font-weight: 800;
    color: var(--uvp-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.fal-chat-header p {
    color: #666;
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.5;
}

.fal-quick-prompts {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.fal-prompt-chip {
    background: white;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #e5e5e5;
    color: var(--uvp-primary);
    font-weight: 500;
}

.fal-prompt-chip:hover {
    background: var(--uvp-primary);
    color: white;
    border-color: var(--uvp-primary);
}

.fal-chat-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #f8f5f9;
    min-height: 0;
}

.fal-message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.875rem;
    animation: falFadeIn 0.2s ease;
}

@keyframes falFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fal-message.bot {
    justify-content: flex-start;
}

.fal-message.user {
    justify-content: flex-end;
}

.fal-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.fal-message.bot .fal-message-avatar {
    background: var(--uvp-primary);
}

.fal-message.user .fal-message-avatar {
    background: #666;
}

.fal-message-content {
    max-width: 65%;
    padding: 0.875rem 1.125rem;
    border-radius: 10px;
    line-height: 1.6;
    font-size: 0.9375rem;
}

.fal-message.bot .fal-message-content {
    background: white;
    border: 1px solid #e5e5e5;
    color: #0a0a0a;
}

.fal-message.user .fal-message-content {
    background: var(--uvp-primary);
    color: white;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--uvp-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Disabled state for prompt chips */
.fal-prompt-chip.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Disabled state for input and button */
.fal-chat-input input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.fal-chat-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Quick reply buttons (Yes/No etc) */
.fal-quick-replies {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #f8f5f9;
    justify-content: flex-start;
}

.fal-quick-reply-btn {
    background: white;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--uvp-primary);
    color: var(--uvp-primary);
    font-weight: 500;
}

.fal-quick-reply-btn:hover {
    background: var(--uvp-primary);
    color: white;
}

.fal-chat-input-container {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e5e5e5;
}

.fal-chat-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.fal-chat-input input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    font-family: inherit;
    background: #f8f5f9;
}

.fal-chat-input input:focus {
    outline: none;
    border-color: var(--uvp-primary);
    background: white;
}

.fal-chat-input button {
    padding: 0.875rem 1.5rem;
    background: var(--uvp-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fal-chat-input button:hover {
    background: #7d2d87;
}

.fal-chat-input button:active {
    transform: scale(0.98);
}

/* Right Side - Sidebar */
.fal-sidebar {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fal-sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    transition: border-color 0.15s ease;
}

.fal-sidebar-card:hover {
    border-color: #d4d4d4;
}

.fal-sidebar-card h3 {
    color: var(--uvp-primary);
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Featured Lawyer Cards */
.fal-lawyer-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    transition: all 0.15s ease;
    cursor: pointer;
    background: white;
}

.fal-lawyer-card:hover {
    border-color: var(--uvp-primary);
    background: #f8f5f9;
}

.fal-lawyer-card:last-child {
    margin-bottom: 0;
}

.fal-lawyer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--uvp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.fal-lawyer-info {
    flex: 1;
}

.fal-lawyer-name {
    font-weight: 600;
    color: #0a0a0a;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.fal-lawyer-specialty {
    color: #666;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.fal-lawyer-rating {
    color: #0a0a0a;
    font-size: 0.8125rem;
    font-weight: 500;
}

.fal-badge {
    display: inline-block;
    background: var(--uvp-primary);
    color: white;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-left: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ad Banner */
.fal-ad-banner {
    background: var(--uvp-primary);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fal-ad-banner h4 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.fal-ad-banner p {
    margin-bottom: 1.25rem;
    opacity: 0.9;
    font-size: 0.9375rem;
}

.fal-ad-banner button {
    background: white;
    color: var(--uvp-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9375rem;
}

.fal-ad-banner button:hover {
    background: #f5f5f5;
}

.fal-ad-banner button:active {
    transform: scale(0.98);
}

@media (max-width: 1200px) {
    .fal-container {
        flex-direction: column;
    }

    .fal-chat-section {
        flex: none;
        position: relative;
        top: 0;
        height: auto;
        min-height: 500px;
        max-height: 70vh;
    }

    .fal-sidebar {
        flex: none;
    }
}

@media (max-width: 768px) {
    .fal-container {
        gap: 1rem;
        padding-bottom: 70px;
    }

    .fal-chat-section {
        height: calc(100vh - 100px);
        min-height: 400px;
        max-height: calc(100vh - 100px);
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .fal-chat-header h1 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .fal-chat-header {
        padding: 0.75rem 1rem;
    }

    .fal-chat-header p {
        font-size: 0.875rem;
        margin-bottom: 0;
    }

    .fal-quick-prompts {
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .fal-prompt-chip {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .fal-chat-messages {
        padding: 1rem;
        padding-bottom: 80px;
        flex: 1;
        overflow-y: auto;
        background: #f8f5f9;
    }

    .fal-message {
        gap: 0.5rem;
    }

    .fal-message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.625rem;
    }

    .fal-message-content {
        max-width: 85%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .fal-chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        background: white;
        border-top: 1px solid #e5e5e5;
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .fal-chat-input input {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .fal-chat-input button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .fal-sidebar {
        display: none;
    }

    .fal-sidebar-card {
        padding: 1rem;
        border-radius: 8px;
    }

    .fal-sidebar-card h3 {
        font-size: 1rem;
    }

    .fal-ad-banner {
        padding: 1.25rem;
        border-radius: 8px;
    }

    .fal-ad-banner h4 {
        font-size: 1.125rem;
    }

    .fal-ad-banner p {
        font-size: 0.875rem;
    }
}
