.bob-page {
    min-height: 100vh;
    padding-top: var(--nav-height);
    background: linear-gradient(135deg, var(--bob-bg-dark) 0%, #1e1b4b 50%, #312e81 100%);
    position: relative;
}

/* Document Panel */
.document-panel {
    background: var(--bob-bg-medium);
    border-left: 1px solid var(--bob-border);
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.document-panel.hidden {
    opacity: 0;
    overflow: hidden;
    border-left: none;
}

.document-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--bob-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 80px;
    box-sizing: border-box;
}

.document-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bob-text-primary);
    margin: 0;
}

/* Back to Chat button */
.back-to-chat-btn {
    background: transparent;
    border: none;
    color: var(--bob-text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-to-chat-btn:hover {
    background: var(--bob-hover-bg);
    color: var(--bob-text-primary);
}


.btn-new-conversation {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    /* Red-500 */
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-new-conversation:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.document-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--bob-text-secondary);
    line-height: 1.8;
}

.document-empty {
    color: var(--bob-text-muted);
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

/* Document Sections */
.doc-section {
    margin-bottom: 2rem;
}

.doc-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bob-text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bob-border);
}

.doc-field {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.doc-label {
    font-weight: 600;
    color: var(--bob-text-primary);
}

.document-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--bob-border);
    min-height: 80px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
}

.btn-submit-application {
    width: 100%;
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    border: none;
    color: var(--bob-text-primary);
    padding: 0.875rem 1.125rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    min-height: 52px;
}

.btn-submit-application:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-submit-application:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat Panel */
.chat-panel {
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-panel.full-width {
    max-width: 800px;
    margin: 0 auto;
}

.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--bob-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    min-height: 80px;
    box-sizing: border-box;
}

.bob-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bob-avatar i {
    font-size: 1.5rem;
    color: var(--bob-text-primary);
}

.bob-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    margin-left: 1rem;
}

.bob-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bob-text-primary);
    margin: 0;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.beta {
    background: rgba(234, 179, 8, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Header Rating */
.header-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.rating-label {
    font-size: 0.75rem;
    color: var(--bob-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.star-rating-inline {
    display: flex;
    gap: 0.25rem;
}

.star-rating-inline i {
    font-size: 1.25rem;
    color: var(--bob-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.star-rating-inline i:hover,
.star-rating-inline i.ph-fill {
    color: #fbbf24;
}

.star-rating-inline i:hover {
    transform: scale(1.1);
}

/* Consent Notice */
.consent-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    padding: 0.75rem 1rem;
    margin: 1rem 1.5rem 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.consent-notice.hidden {
    display: none;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 0 1.5rem 1.5rem 1.5rem;
    /* Removed top padding */
    padding-top: 1.5rem;
    /* Re-add only if needed, but we rely on margin of disclaimer now? No, we should remove top padding to fix gap */
    padding-top: 0.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlideIn 0.3s ease;
    align-items: flex-start;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

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

.message.bob .message-avatar {
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    color: var(--bob-text-primary);
}

.message.user .message-avatar {
    background: var(--bob-bg-light);
    color: var(--bob-text-secondary);
}

.message-bubble {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 70%;
    min-width: 100px;
}

.message-content {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.875rem 1.125rem;
    border-radius: 16px;
    color: var(--bob-text-secondary);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    width: fit-content;
    hyphens: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    color: var(--bob-text-primary);
    margin-left: auto;
}

.message-time {
    font-size: 0.75rem;
    color: var(--bob-text-muted);
    padding: 0 0.25rem;
}

.message.user .message-time {
    text-align: right;
}

/* System Notifications */
.message.system-notification {
    justify-content: center;
    align-items: center;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    color: #6ee7b7;
}

.notification-content i {
    color: #10b981;
    font-size: 1.25rem;
}

/* Retry Notification */
.message.retry-notification {
    justify-content: center;
    align-items: center;
}

.retry-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(251, 146, 60, 0.15);
    border: 1px solid rgba(251, 146, 60, 0.4);
    border-radius: 8px;
    color: #fb923c;
    /* Orange-500 */
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-content:hover {
    background: rgba(251, 146, 60, 0.25);
    border-color: rgba(251, 146, 60, 0.6);
    transform: scale(1.02);
}

.retry-content i {
    color: #fb923c;
    font-size: 1.25rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem 1rem;
}

.typing-indicator.hidden {
    display: none;
}

.typing-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--bob-text-primary);
}

.typing-dots {
    display: flex;
    gap: 0.375rem;
    padding: 0.875rem 1.125rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bob-text-muted);
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chat Input */
.chat-input-area {
    padding: 1.5rem;
    border-top: 1px solid var(--bob-border);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 80px;
    box-sizing: border-box;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

#chatInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bob-border);
    border-radius: 12px;
    padding: 0.875rem 1.125rem;
    padding-right: 3.5rem;
    /* Space for send button */
    color: var(--bob-text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
    width: 100%;
}

#chatInput:focus {
    outline: none;
    border-color: var(--bob-primary);
    background: rgba(255, 255, 255, 0.08);
}

#chatInput::placeholder {
    color: var(--bob-text-muted);
}

.btn-send {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    border: none;
    color: var(--bob-text-primary);
    padding: 0.625rem;
    border-radius: 8px;
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    opacity: 1;
    transform: scale(1);
}

.btn-send.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.btn-send:hover:not(.hidden) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Input Actions */
.input-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    align-items: center;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--bob-border);
    color: var(--bob-text-secondary);
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--bob-primary);
    color: var(--bob-primary);
}

.action-btn i {
    font-size: 1rem;
}

.action-btn.copied {
    border-color: var(--bob-success);
    color: var(--bob-success);
    background: rgba(16, 185, 129, 0.1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: var(--bob-bg-medium);
    border: 1px solid var(--bob-border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--bob-text-muted);
    font-size: 2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--bob-text-primary);
}

.modal-content h3 {
    color: var(--bob-text-primary);
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.feedback-subtitle {
    color: var(--bob-text-muted);
    margin: 0 0 1.5rem 0;
}

/* Star Rating */
.feedback-rating {
    margin-bottom: 1.5rem;
}

.feedback-rating label {
    display: block;
    color: var(--bob-text-secondary);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.star-rating {
    display: flex;
    gap: 0.5rem;
    font-size: 2rem;
}

.star-rating i {
    color: var(--bob-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.star-rating i:hover,
.star-rating i.active {
    color: #fbbf24;
    transform: scale(1.1);
}

/* Feedback Comment */
.feedback-comment textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bob-border);
    border-radius: 8px;
    padding: 0.875rem;
    color: var(--bob-text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.feedback-comment textarea:focus {
    outline: none;
    border-color: var(--bob-primary);
}

.feedback-comment textarea::placeholder {
    color: var(--bob-text-muted);
}

/* Modal Actions */
.feedback-actions,
.confirm-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    color: var(--bob-text-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bob-text-secondary);
    border: 1px solid var(--bob-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Confirm Dialog */
.confirm-dialog {
    max-width: 400px;
}

.confirm-dialog p {
    color: var(--bob-text-secondary);
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    white-space: pre-line;
}

/* Info Dialog */
.info-dialog {
    max-width: 450px;
    text-align: center;
}

.info-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--bob-primary), var(--bob-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon i {
    font-size: 2rem;
    color: var(--bob-text-primary);
}

.info-dialog h3 {
    margin-bottom: 1rem;
}

.info-dialog p {
    color: var(--bob-text-secondary);
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    white-space: pre-line;
}

.info-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Bob Page Styles - Desktop Version */

/* ===== LAYOUT ===== */
.bob-container {
    display: flex;
    height: calc(100vh - var(--nav-height));
    max-width: 1600px;
    margin: 0 auto;
    gap: 0;
}

/* ===== CHAT PANEL ===== */
.chat-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-panel.full-width {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* ===== DOCUMENT PANEL ===== */
.document-panel {
    width: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--bob-border);
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.document-panel.hidden {
    width: 0;
    opacity: 0;
    overflow: hidden;
    border-left: none;
}

/* Hide mobile-specific elements on desktop */
.mobile-tabs {
    display: none !important;
}

.back-to-chat-btn {
    display: none !important;
}

/* Hide mobile "To Application" button on desktop */
.btn-to-application {
    display: none !important;
}

#btnShowApplication {
    display: none !important;
}

/* Hide footer Start Over button on desktop (only in input-actions) */
#btnStartOverFooter {
    display: none !important;
}

/* ===== INPUT ACTIONS LAYOUT ===== */
.input-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
}

/* Position buttons in input actions */
.input-actions .btn-new-conversation {
    order: 1;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1024px) {
    .document-panel {
        width: 45%;
    }

    .chat-panel {
        width: 55%;
    }
}

/* ===== FEEDBACK WIDGET (DESKTOP) ===== */
.bob-feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.bob-feedback-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bob-feedback-modal {
    background: var(--bob-bg-medium, #1e293b);
    border: 1px solid var(--bob-border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.bob-feedback-overlay.active .bob-feedback-modal {
    transform: scale(1);
}

.bob-feedback-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--bob-text-muted, #94a3b8);
    font-size: 2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bob-feedback-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--bob-text-primary, #ffffff);
}

.bob-feedback-modal h3 {
    color: var(--bob-text-primary, #ffffff);
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.bob-feedback-subtitle {
    color: var(--bob-text-muted, #94a3b8);
    margin: 0 0 1.5rem 0;
}

.bob-star-rating {
    display: flex;
    gap: 0.5rem;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.bob-star-rating i {
    color: var(--bob-text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bob-star-rating i:hover,
.bob-star-rating i.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.bob-feedback-comment textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bob-border, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 0.875rem;
    color: var(--bob-text-primary, #ffffff);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}

.bob-feedback-actions {
    display: flex;
    flex-direction: row;
    /* Desktop: row by default, Skip left, Submit right */
    gap: 1rem;
    margin-top: 2rem;
}

.bob-btn-primary,
.bob-btn-secondary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.bob-btn-primary {
    background: linear-gradient(135deg, var(--bob-primary, #4f46e5), var(--bob-secondary, #7c3aed));
    color: var(--bob-text-primary, #ffffff);
}

.bob-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bob-text-secondary, #cbd5e1);
    border: 1px solid var(--bob-border, rgba(255, 255, 255, 0.1));
}