/* === Reset & Base — Arizona Tile Brand === */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #333333;
    --primary-light: #3e3e3e;
    --accent: #005daa;
    --bg: #f2f2f2;
    --surface: #ffffff;
    --text: #333333;
    --text-muted: #a6a6a6;
    --border: #e6e6e6;
    --success: #27ae60;
    --warning: #f39c12;
    --radius: 2px;
    --shadow: 0 1px 4px rgba(0,0,0,0.06);
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* === Layout === */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 960px;
    margin: 0 auto;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #0c0c0d;
    color: white;
    box-shadow: var(--shadow);
}

.app-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.title-accent {
    color: #a6a6a6;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

/* === Buttons === */
.btn {
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover { opacity: 0.85; }
.btn-primary { background: transparent; color: white; border-color: rgba(255,255,255,0.3); }
.btn-primary:hover { background: rgba(255,255,255,0.1); }
.btn-secondary { background: transparent; color: white; border-color: rgba(255,255,255,0.2); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* === Chat Container === */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: #f8f8f8;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* === Welcome Message === */
.welcome-message {
    text-align: center;
    padding: 60px 20px 40px;
    color: var(--text-muted);
}

.welcome-message h2 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.welcome-message p {
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.example-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 640px;
    margin: 0 auto;
}

.example-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.example-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === Chat Messages === */
.message {
    margin-bottom: 16px;
    max-width: 85%;
}

.message.user {
    margin-left: auto;
    text-align: right;
}

.message-bubble {
    display: inline-block;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.6;
}

.message.user .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 0;
}

.message.assistant .message-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0;
    text-align: left;
}

/* === AI Answer === */
.ai-answer {
    background: #fafafa;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 8px 0 12px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.ai-answer em { font-size: 0.8rem; color: var(--text-muted); }

/* === Category Tabs === */
.category-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.tab {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === Search Results === */
.results-container { margin-top: 8px; }

.result-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    transition: border-color 0.2s;
}

.result-card:hover { border-color: var(--primary); }

.result-icon {
    width: 36px;
    height: 36px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-icon.pdf { background: #c0392b; }
.result-icon.docx, .result-icon.doc { background: #005daa; }
.result-icon.xlsx, .result-icon.xls { background: #1e8449; }
.result-icon.pptx, .result-icon.ppt { background: #d35400; }
.result-icon.aspx, .result-icon.page { background: #6c3483; }
.result-icon.default { background: #7f8c8d; }

.result-content { flex: 1; min-width: 0; }

.result-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-title:hover { text-decoration: underline; }

.result-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-snippet {
    font-size: 0.8rem;
    color: var(--text);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.confidence-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.confidence-high { background: #d5f5e3; color: #1e8449; }
.confidence-medium { background: #fef9e7; color: #d68910; }
.confidence-low { background: #fdedec; color: #c0392b; }

/* === Suggestions === */
.suggestions-area {
    display: flex;
    gap: 6px;
    padding: 8px 24px;
    flex-wrap: wrap;
}

.suggestion-chip {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === Input Area === */
.input-area {
    padding: 14px 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--primary); }

.send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.send-btn:hover { background: #0c0c0d; }

/* === Loading === */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* === Scrollbar === */
.messages-area::-webkit-scrollbar { width: 4px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb { background: #d5d5d5; border-radius: 2px; }
