/**
 * ================================================================================
 * CO-READIT - AI Chat Page Styles
 * ================================================================================
 * 
 * Styles for the full-page AI Chat interface
 * Works alongside ai-chatbox.css for the chat component
 * 
 * @author      Edu Brazeal
 * @version     1.0.0
 * ================================================================================
 */

/* ===== AI Chat Page Container ===== */
.ai-chat-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== Page Header ===== */
.ai-chat-page__header {
    text-align: center;
    margin-bottom: 24px;
    display: none;
}

.ai-chat-page__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1b);
    margin: 0 0 8px 0;
}

.ai-chat-page__icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color, #ff4500);
}

.ai-chat-page__subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary, #7c7c7c);
    margin: 0;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Chatbox Wrapper Override for Full Page ===== */
.ai-chat-page .ai-chatbox-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 0;
    height: 100%;
}

.ai-chat-page .ai-chatbox {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: calc(100vh - 60px);
    max-height: none;
    background: var(--bg-secondary, #f6f7f8);
    border-radius: 0;
    border: none;
    overflow: hidden;
    position: relative;
}

.ai-chat-page .ai-chatbox__messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 200px; /* Space for fixed input and suggestions */
}

/* ===== Fixed Bottom Input Area ===== */
.ai-chat-page .ai-chatbox__input-wrapper {
    position: fixed;
    bottom: 0;
    left: 260px; /* Left sidebar width */
    right: 360px; /* Right sidebar width */
    background: var(--bg-primary, #ffffff);
    padding: 0 1rem 1rem;
    z-index: 100;
    border-top: 1px solid var(--border-color, #edeff1);
    max-width: 800px;
    margin: 0 auto;
}

/* ===== Prompt Suggestions - Fixed Above Input ===== */
.ai-chat-page .ai-prompt-suggestions {
    position: fixed;
    bottom: 90px;
    left: 260px; /* Left sidebar width */
    right: 320px; /* Right sidebar width */
    padding: 0.75rem 1rem;
    background: transparent;
    z-index: 99;
    max-width: 800px;
    margin: 0 auto;
}

.ai-chat-page .ai-prompt-suggestions::after {
    display: none;
}

.ai-chat-page .ai-prompt-suggestions__grid {
    position: relative;
    bottom: 15px;
    display: flex;
    gap: 10px;
    padding: 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}

.ai-chat-page .ai-prompt-suggestions__grid:active {
    cursor: grabbing;
}

.ai-chat-page .ai-prompt-suggestions__grid::-webkit-scrollbar {
    display: none;
}

.ai-chat-page .ai-prompt-card {
    min-width: 130px;
    max-width: 160px;
    padding: 14px 16px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #edeff1);
    border-radius: 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ai-chat-page .ai-prompt-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(var(--primary-color-rgb, 0, 128, 0), 0.1);
}

.ai-chat-page .ai-prompt-card__icon svg {
    width: 18px;
    height: 18px;
}

.ai-chat-page .ai-prompt-card__label {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ===== Input Container Styling ===== */
.ai-chat-page .ai-chatbox__input-container {
    background: var(--bg-secondary, #f6f7f8);
    border-radius: 28px;
    padding: 10px 14px;
    border: 1px solid var(--border-color, #edeff1);
}

.ai-chat-page .ai-chatbox__input {
    font-size: 16px;
}

/* ===== Disclaimer Styling ===== */
.ai-chat-page .ai-chatbox__footer {
    text-align: center;
    padding-top: 8px;
}

.ai-chat-page .ai-chatbox__disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

/* ===== Welcome Message Styling ===== */
.ai-chat-page .ai-message--ai:first-child .ai-message__text ul {
    margin: 12px 0;
    padding-left: 20px;
}

.ai-chat-page .ai-message--ai:first-child .ai-message__text li {
    margin: 6px 0;
    color: var(--text-secondary, #7c7c7c);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .ai-chat-page {
        padding: 0;
        padding-bottom: 60px; /* Space for bottom nav */
    }
    
    .ai-chat-page .ai-chatbox {
        min-height: calc(100vh - 120px);
    }
    
    .ai-chat-page .ai-chatbox__messages {
        padding-bottom: 220px;
    }
    
    .ai-chat-page .ai-chatbox__input-wrapper {
        bottom: 60px; /* Above bottom nav */
        left: 0;
        right: 0;
        padding: 0 0.75rem 0.75rem;
    }
    
    .ai-chat-page .ai-prompt-suggestions {
        bottom: 145px;
        left: 0;
        right: 0;
        padding: 0.5rem 0.75rem;
    }
    
    .ai-chat-page .ai-prompt-card {
        min-width: 110px;
        max-width: 140px;
        padding: 12px 14px;
    }
    
    .ai-chat-page .ai-prompt-card__icon {
        width: 32px;
        height: 32px;
    }
    
    .ai-chat-page .ai-prompt-card__label {
        font-size: 0.75rem;
    }
}

.ai-prompt-suggestions__header {
    display: none;
}

@media (max-width: 480px) {
    .ai-chat-page__title {
        font-size: 1.25rem;
    }
    
    .ai-chat-page__icon {
        width: 24px;
        height: 24px;
    }
    
    .ai-chat-page .ai-prompt-card {
        min-width: 100px;
        max-width: 120px;
        padding: 10px 12px;
    }
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .ai-chat-page__title {
    color: var(--text-primary, #d7dadc);
}

[data-theme="dark"] .ai-chat-page__subtitle {
    color: var(--text-secondary, #818384);
}

[data-theme="dark"] .ai-chat-page .ai-chatbox__input-wrapper {
    background: var(--bg-primary, #1a1a1b);
    border-top-color: var(--border-color, #343536);
}

[data-theme="dark"] .ai-chat-page .ai-prompt-card {
    background: var(--bg-primary, #1a1a1b);
    border-color: var(--border-color, #343536);
}

[data-theme="dark"] .ai-chat-page .ai-chatbox__input-container {
    background: var(--bg-secondary, #272729);
    border-color: var(--border-color, #343536);
}

[data-theme="dark"] .ai-chat-page .ai-chatbox {
    background: var(--bg-primary, #1a1a1b);
    border-color: var(--border-color, #343536);
}

[data-theme="dark"] .ai-chat-page .ai-message--ai:first-child .ai-message__text li {
    color: var(--text-secondary, #818384);
}
