/**
 * Oracle Chat Page - Mechanical Bible
 * Only layout/component specifics. Colors/fonts inherit from egyptian-theme.css.
 * Copyright (c) 2026 Tammy L Casey. All rights reserved.
 */

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Oracle Banner (below site-header) */
.oracle-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(20, 15, 10, 0.95), rgba(0, 0, 0, 0.98));
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}
.oracle-banner h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #d4af37;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    letter-spacing: 3px;
}
.oracle-orb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        #d4af37 0%, #a08040 40%, #806030 70%, #503020 100%);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.message {
    padding: 1rem;
    border-radius: 8px;
    max-width: 85%;
    line-height: 1.6;
    font-size: 15px;
}
.message.user {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    align-self: flex-end;
    color: #e0d0a0;
}
.message.oracle {
    background: rgba(20, 15, 10, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    align-self: flex-start;
    color: #c0a060;
}
.message.system {
    background: rgba(20, 15, 10, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.15);
    align-self: center;
    font-style: italic;
    font-size: 0.9rem;
    color: #806030;
}
.message.error {
    background: rgba(100, 0, 0, 0.15);
    border: 1px solid rgba(200, 60, 60, 0.3);
    color: #cc6666;
}

/* Input Area */
.input-area {
    padding: 1rem;
    background: rgba(20, 15, 10, 0.9);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}
.input-wrapper {
    display: flex;
    gap: 0.5rem;
    max-width: 900px;
    margin: 0 auto;
}
.input-wrapper textarea {
    flex: 1;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    color: #e0d0a0;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 50px;
    max-height: 150px;
}
.input-wrapper textarea:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}
.input-wrapper textarea::placeholder {
    color: #806030;
}
.input-wrapper button {
    padding: 1rem 1.5rem;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid #d4af37;
    border-radius: 6px;
    color: #d4af37;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    letter-spacing: 1px;
}
.input-wrapper button:hover {
    background: rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}
.input-wrapper button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Loading */
.loading {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
}
.loading span {
    width: 8px;
    height: 8px;
    background: #d4af37;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}
.loading span:nth-child(1) { animation-delay: 0s; }
.loading span:nth-child(2) { animation-delay: 0.2s; }
.loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

/* Context Badge */
.context-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Message formatting */
.message h1, .message h2, .message h3 {
    color: #d4af37;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.message code {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #c0a060;
}
.message pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid rgba(212, 175, 55, 0.15);
}
.message ul, .message ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}
.message a {
    color: #d4af37;
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
}
.message a:hover {
    border-bottom-color: #d4af37;
}

/* Study Tools */
.study-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    margin-top: 0.5rem;
}
.tool-btn {
    padding: 0.25rem 0.75rem;
    background: rgba(20, 15, 10, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 3px;
    color: #a08040;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tool-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
    color: #d4af37;
}

/* Mobile */
@media (max-width: 768px) {
    .oracle-header { padding: 0.75rem 1rem; }
    .oracle-title h1 { font-size: 1.2rem; }
    .oracle-orb { width: 30px; height: 30px; }
    .oracle-back { font-size: 12px; padding: 0.4rem 0.8rem; }
    .message { max-width: 95%; }
    .study-tools { gap: 4px; }
    .tool-btn { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
}
