/* ==========================================================================
   WISAXIS AI RESUME ASSISTANT CHAT (2026 SaaS Design System - Desktop)
   ========================================================================== */

/* Page-specific scroll lock for native-app experience */
body.chat-page {
    overflow: hidden !important;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: calc(var(--desktop-navbar-height, 76px) + 1.25rem) var(--space-5) 1.5rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    height: 100vh;
    box-sizing: border-box;
}

/* ==========================================================================
   Sidebar: Quick Action Prompts
   ========================================================================== */
.chat-sidebar {
    background: var(--surface-1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    height: calc(100vh - var(--desktop-navbar-height, 76px) - 2.75rem);
}

html[data-theme="light"] .chat-sidebar {
    background: #ffffff;
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 800;
    margin: 0 0 0.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: var(--tracking-tight);
}

.sidebar-title svg {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-section h4 {
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    margin: 0 0 4px;
}

.suggestion-pill {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    line-height: 1.45;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

html[data-theme="light"] .suggestion-pill {
    background: #f8fafc;
    border-color: var(--border-default);
}

.suggestion-pill:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.assistant-info-box {
    background: var(--surface-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 1.1rem;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-top: auto;
}

/* ==========================================================================
   Chat Interface Box
   ========================================================================== */
.chat-window {
    background: var(--surface-1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - var(--desktop-navbar-height, 76px) - 2.75rem);
    position: relative;
}

html[data-theme="light"] .chat-window {
    background: #ffffff;
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
}

.chat-header {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-1);
    z-index: 10;
}

.assistant-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.assistant-avatar {
    width: 44px;
    height: 44px;
    background: var(--gradient-brand);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.assistant-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
    letter-spacing: var(--tracking-snug);
}

.assistant-status {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--success);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background-color: var(--success);
    border-radius: 50%;
    animation: pulse 1.6s infinite;
}

.btn-clear-chat {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-chat:hover {
    background: var(--danger);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ==========================================================================
   Chat Messages Scroll Area
   ========================================================================== */
.chat-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.chat-bubble-wrap {
    display: flex;
    gap: 14px;
    max-width: 82%;
    position: relative;
    animation: chatBubblePop 0.35s var(--ease-spring) both;
}

@keyframes chatBubblePop {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-bubble-wrap.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble-wrap.assistant {
    align-self: flex-start;
}

.bubble-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    transition: transform 0.25s var(--ease-spring);
}

.chat-bubble-wrap:hover .bubble-icon {
    transform: scale(1.08);
}

.chat-bubble-wrap.user .bubble-icon {
    background: var(--primary);
    color: #ffffff;
}

.chat-bubble-wrap.assistant .bubble-icon {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(14, 165, 233, 0.25);
}

.chat-bubble {
    padding: 1.15rem 1.45rem;
    border-radius: var(--radius-xl);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--text-main);
    position: relative;
    transition: box-shadow 0.25s ease;
}

.chat-bubble-wrap.user .chat-bubble {
    background: var(--gradient-brand);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.chat-bubble-wrap.assistant .chat-bubble {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-bottom-left-radius: 4px;
}

html[data-theme="light"] .chat-bubble-wrap.assistant .chat-bubble {
    background: #ffffff;
    border-color: var(--border-default);
    box-shadow: var(--shadow-xs);
}

/* AI Action Tooltips */
.bubble-actions {
    position: absolute;
    bottom: -24px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s var(--ease-spring);
    z-index: 5;
}

.chat-bubble-wrap:hover .bubble-actions {
    opacity: 1;
    transform: translateY(0);
}

.btn-bubble-action {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 3px 9px;
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s var(--ease-spring);
}

.btn-bubble-action:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background: var(--surface-2);
    transform: translateY(-1px) scale(1.05);
}

/* Formatting Styles */
.chat-bubble p {
    margin: 0 0 12px;
}
.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble ul,
.chat-bubble ol {
    margin: 0 0 12px;
    padding-left: 1.4rem;
}
.chat-bubble li {
    margin-bottom: 6px;
}

.chat-bubble code {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85em;
    font-weight: 600;
}

.chat-bubble pre {
    background: var(--bg-secondary, #000000);
    color: var(--text-main);
    padding: 1.15rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--border-default);
}
.chat-bubble pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-weight: normal;
}

/* ==========================================================================
   Chat Input Form Footer
   ========================================================================== */
.chat-input-area {
    padding: 1.25rem 2rem 1.5rem;
    background: var(--surface-1);
    border-top: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-input-form {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.chat-textarea {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-xl);
    padding: 0.85rem 1.25rem;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-main);
    resize: none;
    height: 48px;
    max-height: 120px;
    outline: none;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

html[data-theme="light"] .chat-textarea {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-main);
}

.chat-submit-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--gradient-brand);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease-spring);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.chat-submit-btn:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.1);
}

.chat-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

/* ==========================================================================
   AI Typing Loader
   ========================================================================== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* ==========================================================================
   Animations & Transitions
   ========================================================================== */
@keyframes typing {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.35; }
    40% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 4px var(--primary-glow)); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.85); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
