/* ═══════════════════════════════════════════════════════════════
   RAT FLEET DESIGN BIBLE — Canonical Stylesheet
   "Command console, not chatbot"
   Created: April 3, 2026 — from RAT_FLEET_DESIGN_BIBLE.md
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Section 2: CSS Variables ── */
:root {
    --theme-primary:    #0d0d1a;
    --card-bg:          #1e1e2e;
    --sidebar-bg:       #252535;
    --input-bg:         #14141f;
    --accent-color:     #c9a84c;
    --accent-hover:     #d4b86a;
    --text-primary:     #ffffff;
    --text-secondary:   rgba(255, 255, 255, 0.70);
    --text-tertiary:    rgba(255, 255, 255, 0.45);
    --border-subtle:    rgba(201, 168, 76, 0.20);
    --border-medium:    rgba(201, 168, 76, 0.40);
    --overlay-dark:     rgba(13, 13, 26, 0.82);
}

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

/* ── Section 10: Body & Typography ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--theme-primary);
    min-height: 100vh;
}

/* ── Section 3: Hero Section ── */
.rat-hero {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
    padding: 40px 48px;
    overflow: hidden;
}
.rat-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(13, 13, 26, 0.45) 0%,
        rgba(13, 13, 26, 0.82) 100%
    );
    z-index: 0;
}
.rat-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}
.rat-hero-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}
.rat-hero h1,
.rat-hero-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}
.rat-hero .subtitle,
.rat-hero-sub {
    font-style: italic;
    color: rgba(255, 255, 255, 0.80);
    font-size: 1.15rem;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    margin: 0;
    letter-spacing: 0.01em;
}

/* ── Section 4: Status Bar ── */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    background: rgba(13, 13, 26, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.60);
    flex-wrap: wrap;
    gap: 12px;
}
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}
.status-dot {
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.status-indicator strong,
.status-bar .value {
    color: var(--accent-color);
    font-weight: bold;
}

/* ── Section 11: Layout Grid ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}
.main-content,
.main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    background: var(--card-bg);
}

/* ── Chat Section (Left Column) ── */
.chat-section {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}
.chat-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.chat-header h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 600;
}
.chat-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Chat Messages ── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    max-height: 500px;
}
.message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Section 9: AI Response — Gold Left Border ── */
.message.assistant .message-content,
.assistant-message {
    border-left: 3px solid var(--accent-color);
    padding-left: 16px;
    padding: 16px 16px 16px 16px;
    background: linear-gradient(135deg, #1e1e2e, #252535);
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.10);
    color: var(--text-primary);
}
.message.user .message-content {
    background: var(--sidebar-bg);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-left: 60px;
}
.response-content {
    line-height: 1.75;
}
.response-content strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

/* ── Loading Indicator ── */
.loading {
    display: none;
    text-align: center;
    padding: 16px;
    color: var(--text-tertiary);
}
.loading.active { display: block; }
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Input Section ── */
.input-section {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}
.input-with-examples {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.input-area { width: 100%; }
.input-form {
    display: flex;
    gap: 10px;
}

/* ── Input Field ── */
#messageInput {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    font-size: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
#messageInput:focus {
    outline: none;
    border-color: rgba(201, 168, 76, 0.60);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.10);
}
#messageInput::placeholder {
    color: var(--text-tertiary);
}

/* ── Send Button — exact spec ── */
#sendButton {
    background: #c9a84c;
    color: #0d0d1a;
    border: none;
    padding: 12px 24px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
}
#sendButton:hover { background: #d4b86a; }
#sendButton:active { background: #b8973f; }

/* ── Quick Question Pills ── */
.examples-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.examples-label {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 13px;
    font-family: 'Courier New', monospace;
}
.examples-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.example-btn,
.quick-question-btn {
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.35);
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.example-btn:hover,
.quick-question-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(201, 168, 76, 0.08);
}

/* ── Sidebar (Right Column) ── */
.sidebar {
    background: var(--sidebar-bg);
    padding: 24px 20px;
    border-left: 1px solid var(--border-subtle);
    overflow-y: auto;
    max-height: 700px;
}
.sidebar-panel {
    margin-bottom: 24px;
}
.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
    font-family: 'Courier New', monospace;
}

/* ── Expertise Panels ── */
.info-panel {
    background: rgba(13, 13, 26, 0.5);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid var(--accent-color);
    transition: all 0.2s ease;
}
.info-panel:hover {
    background: rgba(201, 168, 76, 0.05);
}
.info-panel h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 600;
}
.info-panel p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .main-content,
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar { display: none; }
    .rat-hero {
        padding: 24px;
        min-height: 200px;
    }
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .message.user .message-content {
        margin-left: 0;
    }
}

/* ── App Info Banner ── */
.custom-app-banner {
    margin-top: 16px;
    background: rgba(13, 13, 26, 0.8);
    color: var(--text-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}
.custom-app-banner .banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    background: rgba(30, 30, 46, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}
.custom-app-banner .banner-header:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}
.custom-app-banner .banner-chevron {
    font-size: 0.8rem;
    opacity: 0.8;
    transition: transform 160ms ease;
}
.custom-app-banner.is-open .banner-chevron {
    transform: rotate(180deg);
}
.custom-app-banner .banner-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    padding: 0 14px;
}
.custom-app-banner.is-open .banner-body {
    max-height: 500px;
    opacity: 1;
    padding: 12px 14px;
}
.custom-app-banner .banner-body h4,
.custom-app-banner .banner-body h6 {
    color: var(--accent-color);
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.custom-app-banner .banner-body p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 13px;
}
.custom-app-banner .banner-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.custom-app-banner .banner-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
.custom-app-banner .banner-links a:hover {
    text-decoration: underline;
}

/* ── Footer ── */
.custom-footer {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(13, 13, 26, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
}
.custom-footer a {
    color: var(--accent-color);
    text-decoration: none;
}
.custom-footer a:hover { text-decoration: underline; }
.custom-footer .coffee-link {
    display: inline-block;
    margin-top: 4px;
    color: var(--accent-color);
    font-weight: 800;
    text-decoration: none;
}
.custom-footer .coffee-link:hover { text-decoration: underline; }
