/* New search button enhancements */
.btn-primary {
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-primary-rgb), 0.3);
}


/* Bottom search section styling */
.border-top {
    border-color: rgba(var(--bs-primary-rgb), 0.1) !important;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Query message styles */
.query-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    max-width: 90%;
}

.user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.query-text {
    position: relative;
    border-top-left-radius: 4px;
    border-radius: 0.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.query-text::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--bs-gray-200);
}

/* Badge styles */
.trifolia-badge-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
}

.jurisprudence-badge {
    background-color: rgba(114, 0, 252, 0.1);
    color: var(--petal-accent);
}

.legislation-badge {
    background-color: rgba(91, 125, 82, 0.1);
    color: var(--leaf-green);
}

.doctrine-badge {
    background-color: rgba(26, 35, 50, 0.1);
    color: var(--law-navy);
}

/* Source styles */
.source-title {
    font-family: var(--bs-font-monospace);
    color: var(--clover-purple);
}

.source-type-tag {
    font-size: 0.75rem;
}

.source-relevance, .keyword-matches {
    font-size: 0.8rem;
}

/* Tab specific content styling */
#jurisprudence-tab .card-header {
    border-left: 4px solid var(--petal-accent);
}

#legislation-tab .card-header {
    border-left: 4px solid var(--leaf-green);
}

#doctrine-tab .card-header {
    border-left: 4px solid var(--law-navy);
}

#integral-tab .card-header {
    border-left: 4px solid var(--clover-purple);
}

/* Tab content styles for proper markdown rendering */
.tab-content .card-body h1 {
    font-size: 1.8rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.tab-content .card-body h2 {
    font-size: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.tab-content .card-body h3 {
    font-size: 1.3rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.tab-content .card-body blockquote {
    border-left: 4px solid #dee2e6;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
}

.tab-content .card-body pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.tab-content .card-body code {
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Chat-like interface styles */
.chat-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.chat-message {
    display: flex;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot {
    justify-content: flex-start;
}

/* Full-width bot messages (like Claude/ChatGPT) */
.chat-message.bot-full-width {
    display: block;
    margin-bottom: 2rem;
}

/* Removed absolute positioning that was causing avatar to appear in top-left corner */
/* .chat-message.bot-full-width .message-avatar {
    position: absolute;
    left: 0;
    top: 0;
} */

.chat-message.bot-full-width .message-content {
    max-width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-left: 0; /* Avatar removed - no margin needed */
    color: #374151;
    line-height: 1.7;
    position: relative;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user .message-avatar {
    background: var(--clover-purple);
    color: white;
    margin-left: 0.75rem;
    order: 2;
}

/* Bot avatar styling removed - no longer needed since avatars are removed from bot messages */
/* .bot .message-avatar {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    margin-right: 0.75rem;
} */

.message-content {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 1.125rem;
    position: relative;
    word-wrap: break-word;
}

.user .message-content {
    background: var(--clover-purple);
    color: white;
    border-bottom-right-radius: 0.375rem;
}

/* File attachment styles */
.message-attachments {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.user .message-attachments {
    background: rgba(255, 255, 255, 0.1);
}

.attachment-card {
    background-color: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    transition: all 0.2s ease;
}

.attachment-card:hover {
    background-color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.attachment-card:last-child {
    margin-bottom: 0 !important;
}

.attachment-details {
    min-width: 0; /* Enable text truncation */
}

.attachment-name {
    color: #1a1a1a !important;
    font-weight: 500 !important;
    max-width: 200px;
}

.attachment-size {
    color: #525252 !important;
    font-weight: 400;
}

.bot .message-content {
    background: #F7F5F0;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-bottom-left-radius: 0.375rem;
}

.progress-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
    animation: slideIn 0.3s ease-out;
}

.progress-item:last-child {
    border-bottom: none;
}

.progress-item .icon {
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Function buttons within bot messages */
.adk-function-button {
    background-color: transparent;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 0;
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
    font-size: 0.875rem;
    color: #374151;
    width: 100%;
    text-align: left;
}

.adk-function-button.completed {
    color: #0f5132;
}

.adk-function-button.completed i {
    color: #198754;
}

.adk-function-button i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Bot thought messages */
.bot-thought {
    background-color: transparent;
    border: 1px solid #D1D5DB;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
    font-style: italic;
    color: #6B7280;
}

.bot-thought .thought-label {
    background-color: var(--clover-purple);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-style: normal;
}

/* Bot final response */
.bot-response {
    background-color: transparent;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Bot responses in full-width messages */
.bot-full-width .bot-response {
    background-color: transparent;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.7;
    padding: 0;
    margin: 0;
}

/* Wider bot messages for final responses */
.bot .message-content.wide {
    max-width: 95%;
}

/* Full-width final responses */
.bot-full-width .final-response {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* Copy button styles */
.message-copy-container {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.bot-full-width .message-content:hover .message-copy-container {
    opacity: 1;
}

.copy-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.copy-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
    text-decoration: none;
}

.copy-button:active {
    transform: scale(0.95);
}

.copy-button.copied {
    color: #10b981;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.copy-button.copied:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* Message feedback buttons (thumbs up/down) */
.message-feedback-btn {
    min-width: 2rem;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.message-feedback-btn:hover {
    transform: scale(1.05);
}

.message-feedback-btn.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

.message-feedback-btn.active:hover {
    background: #bae6fd;
    border-color: #0369a1;
    color: #0369a1;
}

/* Continue button used state */
.continue-response-btn-used {
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    background: #f9fafb !important;
    cursor: not-allowed !important;
}

.continue-response-btn-used:hover {
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    background: #f9fafb !important;
    transform: none !important;
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    .chat-message {
        margin-bottom: 1rem;
    }

    .message-content {
        max-width: 90%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .bot .message-content.wide {
        max-width: 95%;
    }

    /* Full-width bot messages on mobile */
    .chat-message.bot-full-width .message-content {
        margin-left: 0; /* Avatar removed - no margin needed */
        font-size: 0.875rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .adk-function-button {
        font-size: 0.8rem;
        padding: 0.4rem 0;
    }

    /* Copy button mobile adjustments */
    .copy-button {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        gap: 0.25rem;
    }

    .message-copy-container {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        opacity: 1; /* Always visible on mobile */
    }
}

.progress-item.completed .icon {
    color: #198754;
}

.progress-item.active .icon {
    color: #0d6efd;
    animation: pulse 2s infinite;
}

.progress-text {
    flex: 1;
}

.progress-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.progress-description {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0;
}

.timestamp {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.bot .message-content .final-response {
    line-height: 1.6;
    border-top: 1px solid #dee2e6;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.bot .message-content .final-response h2 {
    color: #495057;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.bot .message-content .final-response h3 {
    color: #6c757d;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

/* Progress timeline separator */
#progressContainer {
    position: relative;
    padding-bottom: 1rem;
}

#progressContainer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 0;
    height: 1px;
    background: #dee2e6;
    display: none;
}

#progressContainer.has-items::after {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Tool batch container styles - subtle integrated block */
.tool-batch-block {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid #0d6efd;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    color: #495057;
    font-size: 0.9rem;
}

/* Completed tool batch - green accent, slightly muted */
.tool-batch-block--completed {
    border-left-color: #198754;
    background: #f6fdf9;
    border-color: #c3e6cb;
}

.tool-batch-block--completed .tool-batch-header {
    color: #155724;
}

.tool-batch-block--completed .tool-batch-item {
    background: rgba(25, 135, 84, 0.03);
}

.tool-batch-block--completed .tool-batch-item i {
    color: #198754;
}

/* Live (in-progress) tool batch - explicit blue */
.tool-batch-block--live {
    border-left-color: #0d6efd;
}


/* Bridge pill - compact tool summary shown during streaming */
.tool-batch-bridge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 2rem;
    padding: 0.2rem 0.7rem;
    margin-bottom: 0.5rem;
}

.tool-batch-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

.tool-batch-header {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

.tool-batch-list {
    font-size: 0.85rem;
}

.tool-batch-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    color: #6c757d;
    background: rgba(13, 110, 253, 0.03);
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    border-left: 2px solid transparent;
}

.tool-batch-item:last-of-type {
    margin-bottom: 0;
}

.tool-batch-item i {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0d6efd;
}

.tool-batch-more {
    color: #6c757d;
    font-style: italic;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding-left: 0.5rem;
}

.tool-batch-spinner {
    animation: tool-spin 1.5s linear infinite;
}

@keyframes tool-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Tool batch status colors for subtle theme */
.tool-batch-block .text-success,
.tool-batch-container .text-success {
    color: #198754 !important;
}

.tool-batch-block .text-warning,
.tool-batch-container .text-warning {
    color: #fd7e14 !important;
}

.tool-batch-block .text-primary,
.tool-batch-container .text-primary {
    color: #0d6efd !important;
}

.tool-batch-block .text-muted,
.tool-batch-container .text-muted {
    color: #6c757d !important;
}

/* Optional animation class for tool batch blocks */
.tool-batch-block.animate-in {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for tool batch */
@media (max-width: 576px) {
    .tool-batch-block {
        margin: 0.5rem 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .tool-batch-bridge {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }

    .tool-batch-header {
        font-size: 0.85rem;
        margin-bottom: 0.375rem;
        gap: 0.375rem;
    }

    .tool-batch-list {
        font-size: 0.8rem;
    }

    .tool-batch-item {
        padding: 0.2rem 0.375rem;
        gap: 0.375rem;
        margin-bottom: 0.2rem;
    }

    .tool-batch-item i {
        width: 14px;
        height: 14px;
    }
}

/* Research details collapsible section */
.research-details {
    margin-top: 2rem;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.research-details .btn-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
}

.research-details .btn-link:hover {
    color: #495057;
}

.research-summary {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.research-summary .stat-item {
    display: inline-block;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}

.research-summary .stat-label {
    color: #6c757d;
    font-weight: 500;
}

.research-summary .stat-value {
    color: #495057;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* ========================================
   Bibliography Section Styles - Numbered List (Academic Style)
   ======================================== */

.bibliography-section {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.bibliography-section .card {
    border: 1px solid #e5e7eb;
    background: #fafbfc;
    box-shadow: none;
    border-radius: 8px;
}

.bibliography-section .card-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}

.bibliography-section .card-header .btn-link {
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
}

.bibliography-section .card-header .btn-link:hover {
    color: var(--clover-purple);
}

.bibliography-section .card-body {
    padding: 1rem 1.25rem;
    background: white;
}

/* Source Type Sections */
.source-type-section {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.source-type-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.source-type-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.source-type-header .badge {
    margin-left: 0.5rem;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Numbered List Styling */
.source-list {
    counter-reset: source-counter;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.source-entry {
    counter-increment: source-counter;
    padding: 0.5rem 0 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.source-entry:last-child {
    border-bottom: none;
}

.source-entry:hover {
    background-color: #f9fafb;
}

.source-entry::before {
    content: counter(source-counter) ". ";
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    min-width: 1.5rem;
    display: inline-block;
}

.source-entry a {
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.6;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.source-entry a:hover {
    color: var(--clover-purple);
}

.source-entry a .fw-medium {
    font-weight: 500;
}

.source-entry a i {
    opacity: 0.4;
    transition: opacity 0.15s ease;
    font-size: 0.7rem;
}

.source-entry a:hover i {
    opacity: 0.8;
}

.source-title {
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.6;
}

.source-title a {
    color: #374151;
    text-decoration: none;
    transition: color 0.15s ease;
}

.source-title a:hover {
    color: var(--clover-purple);
}

.source-citation {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.4;
}

.source-citation em {
    font-style: italic;
}

.source-relevance {
    font-size: 0.8rem;
    line-height: 1.4;
}

.source-relevance .text-muted {
    color: #9ca3af !important;
}

.source-provider {
    margin-top: 0.25rem;
}

.source-provider .badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
}

/* Chevron Animation */
#bibliographyChevron {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .bibliography-section .card-header {
        padding: 0.75rem 0.875rem;
    }

    .bibliography-section .card-body {
        padding: 0.875rem 1rem;
    }

    .source-type-header {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .source-entry {
        padding: 0.375rem 0 0.375rem 0.375rem;
        margin-left: -0.375rem;
        margin-right: -0.375rem;
        padding-right: 0.375rem;
    }

    .source-entry::before {
        font-size: 0.8rem;
        min-width: 1.25rem;
        margin-right: 0.375rem;
    }

    .source-entry a {
        font-size: 0.8rem;
        line-height: 1.5;
    }
}

/* ========================================
   Sticky Input Container Styles - Invisible Container
   ======================================== */

.sticky-input-container {
    position: sticky;
    bottom: 0;
    z-index: 10;

    /* Completely invisible - no background, no blur, no border */
    background: transparent;

    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0.5rem 1rem;
}

/* Inline usage info inside search input */
.usage-info-inline {
    position: absolute;
    bottom: 6px;
    right: 70px; /* Left of send button */
    font-size: 0.7rem;
    color: #9ca3af;
    opacity: 0.7;
    pointer-events: none; /* Don't interfere with input */
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

/* Allow links inside usage info to be clickable */
.usage-info-inline a {
    pointer-events: auto; /* Re-enable pointer events for links */
    cursor: pointer;
    text-decoration: underline;
}

.usage-info-inline a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Warning state for usage info */
.usage-info-inline.warning {
    color: #d97706;
    opacity: 0.85;
    font-weight: 500;
}

/* Unlimited state */
.usage-info-inline.unlimited {
    color: #10b981;
    opacity: 0.6;
}

/* Collapsible sections container */
.collapsible-sections {
    margin-bottom: 1rem;
}

/* Ensure bibliography and feedback cards have proper spacing */
.collapsible-sections .bibliography-section,
.collapsible-sections .feedback-section {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Add bottom padding to conversation to prevent sticky overlap */
.chat-container #conversationContainer {
    padding-bottom: 1.5rem;
}

/* Search input with glassmorphism effect */
.sticky-input-container .search-input-wrapper {
    /* Glassmorphism (Claude/Perplexity style) */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    /* Rounded corners for card effect */
    border-radius: 0.75rem;
    border: 1px solid rgba(229, 231, 235, 0.6);

    /* Soft shadow */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sticky-input-container .search-input-wrapper:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(209, 213, 219, 0.8);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.sticky-input-container .search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--clover-purple);
    box-shadow: 0 6px 24px rgba(60, 120, 253, 0.15);
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(16px)) {
    .sticky-input-container .search-input-wrapper {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* Remove extra padding and make form/section/containers transparent */
.sticky-input-container #conversationInputSection {
    padding: 0;
    background: transparent;
}

.sticky-input-container #continueConversationForm {
    background: transparent;
}

.sticky-input-container .search-input-container {
    background: transparent;
}

.sticky-input-container .search-input-with-attachment {
    background: transparent;
}

/* Make PDF attachment button glassmorphic in sticky container */
.sticky-input-container .pdf-attachment-button-external {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(229, 231, 235, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sticky-input-container .pdf-attachment-button-external:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(209, 213, 219, 0.8);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.sticky-input-container .pdf-attachment-button-external.has-files {
    background: rgba(243, 240, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.sticky-input-container .pdf-attachment-button-external.has-files:hover {
    background: rgba(233, 229, 255, 0.95);
}

/* Mobile adjustments for sticky input */
@media (max-width: 576px) {
    .sticky-input-container {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding: 0.375rem 0.75rem; /* Even more compact on mobile */
    }

    .usage-info-inline {
        font-size: 0.65rem;
        right: 60px; /* Adjust for smaller send button on mobile */
        bottom: 4px;
    }

}

/* ========================================
   Inline Feedback Section Styles
   ======================================== */

.feedback-inline {
    /* No background - blends into conversation flow */
    background: transparent;
    border: none;
    padding: 1rem 0 0 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
}

.feedback-inline h6 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

/* Compact inline star rating */
.rating-stars-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rating-stars-inline .star {
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #ddd;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.rating-stars-inline .star:hover {
    transform: scale(1.15);
    color: #ffd700;
}

.rating-stars-inline .star.filled {
    color: #ffd700;
}

/* Feedback header row */
.feedback-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.feedback-rating-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feedback-rating-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Right-side actions cluster: suggestion link + comment button */
.feedback-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.feedback-suggestion-link {
    font-size: 0.8125rem;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.feedback-suggestion-link:hover,
.feedback-suggestion-link:focus {
    color: var(--clover-purple);
    text-decoration: underline;
}

/* Add comment button */
.feedback-comment-toggle {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.375rem;
    color: #6b7280;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.feedback-comment-toggle:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.feedback-comment-toggle:focus {
    outline: 2px solid var(--clover-purple);
    outline-offset: 2px;
}

/* Collapsible comment form */
.feedback-comment-collapse {
    margin-top: 0.75rem;
}

.feedback-comment-collapse textarea {
    border-radius: 0.5rem;
    border-color: #d1d5db;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
}

.feedback-comment-collapse textarea:focus {
    border-color: var(--clover-purple);
    box-shadow: 0 0 0 3px rgba(60, 120, 253, 0.1);
}

.feedback-submit-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Rating feedback messages */
.rating-feedback-msg {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.rating-feedback-msg.success {
    color: #10b981;
    font-weight: 500;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .feedback-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .feedback-rating-section {
        width: 100%;
    }

    .feedback-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .feedback-suggestion-link {
        text-align: center;
        white-space: normal;
    }

    .feedback-comment-toggle {
        width: 100%;
        justify-content: center;
    }

    .rating-stars-inline .star {
        font-size: 1.75rem;
        min-height: 48px;
        min-width: 48px;
    }
}
