/* Professional AI Expert System - Universal Styling */
/* Created: November 14, 2025 */
/* Matches base.html Jinja2 template structure */

/* ── Robert Greene Gold + Dark Theme ── */
:root {
    --accent-color: #c9a84c;
    --card-bg: #1e1e2e;
    --sidebar-bg: #252535;
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.7);
    --hero-image-url: none;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #0d0d1a;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--card-bg);
    border-radius: 12px 12px 0 0;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Status Bar */
.status-bar {
    background: #14141f;
    color: white;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #27ae60;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-indicator strong {
    color: var(--accent-color);
}

/* Main Content - Two Column Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    background: var(--card-bg);
    border-radius: 0 0 12px 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Chat Section (Left Column) */
.chat-section {
    padding: 30px;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.chat-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.chat-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    max-height: 400px;
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.assistant .message-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.15);
    border-left: 3px solid var(--accent-color);
}

.message.user .message-content {
    background: #252535;
    color: var(--text-primary);
    padding: 15px;
    border-radius: 12px;
    margin-left: 60px;
}

.response-content {
    line-height: 1.8;
}

.response-content strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Loading Indicator */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.loading.active {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Input Section */
.input-section {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid rgba(255,255,255,0.1);
}

.input-with-examples {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-area {
    width: 100%;
}

.input-form {
    display: flex;
    gap: 10px;
}

.examples-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.examples-label {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.95rem;
}

.examples-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.example-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: var(--accent-color);
    color: #0d0d1a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}

#messageInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #14141f;
    color: var(--text-primary);
}

#messageInput:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

#messageInput::placeholder {
    color: var(--text-secondary);
}

#sendButton {
    background: #c9a84c;
    color: #0d0d1a;
    border: none;
    padding: 12px 24px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#sendButton:hover {
    background: #d4b86a;
}

#sendButton:active {
    background: #b8973f;
}

/* Sidebar (Right Column) */
.sidebar {
    background: var(--sidebar-bg);
    padding: 30px 25px;
    border-left: 1px solid rgba(255,255,255,0.05);
    border-radius: 0 0 12px 0;
    overflow-y: auto;
    max-height: 700px;
}

.sidebar-panel {
    margin-bottom: 30px;
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent-color);
}

/* Expertise Areas (Info Panels) */
.info-panel {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.info-panel:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(201,168,76,0.15);
}

.info-panel h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.info-panel p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        border-left: none;
        border-top: 1px solid #ecf0f1;
        border-radius: 0 0 12px 12px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chat-section {
        padding: 20px;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .message.user .message-content {
        margin-left: 0;
    }
}


/* ROBERT GREENE APP INFO BANNER (DOMAIN-ISOLATED TEST) */
.custom-app-banner {
    margin-top: 18px;
    background: rgba(17, 24, 39, 0.95);
    color: #e5e7eb;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.custom-app-banner .banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    background: rgba(31, 41, 55, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.custom-app-banner .banner-header:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.20);
}

.custom-app-banner .banner-chevron {
    font-size: 0.9rem;
    opacity: 0.95;
    transition: transform 160ms ease;
}

.custom-app-banner.is-open .banner-chevron {
    transform: rotate(180deg);
}

.custom-app-banner .banner-body {
    padding: 12px 14px 14px 14px;
    font-size: 0.92rem;
}

.custom-app-banner .banner-body h4 {
    margin-top: 10px;
    margin-bottom: 6px;
    color: #93c5fd;
    font-size: 1rem;
}

.custom-app-banner .banner-body p {
    color: #d1d5db;
    line-height: 1.55;
    margin-bottom: 8px;
}

.custom-app-banner .banner-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.custom-app-banner .banner-links a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 700;
}

.custom-app-banner .banner-links a:hover {
    text-decoration: underline;
}

.custom-footer {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 10px;
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.55;
}

.custom-footer a {
    color: #3498db;
    text-decoration: none;
}

.custom-footer a:hover {
    text-decoration: underline;
}

.custom-footer .coffee-link {
    display: inline-block;
    margin-top: 6px;
    color: #ffc107;
    font-weight: 800;
    text-decoration: none;
}

.custom-footer .coffee-link:hover {
    text-decoration: underline;
}


/* APP INFO ACCORDION ANIMATION */
/* Smooth open/close without relying on display:none */
.custom-app-banner .banner-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.custom-app-banner.is-open .banner-body {
    opacity: 1;
}

/* ── RAT Hero Section ── */
.rat-hero {
  background: #0d0d1a;
  /* hero background-image set via inline style on .rat-hero div */
  background-size: cover;
  background-position: center;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  padding: 40px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--accent-color);
}
.rat-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(13,13,26,0.95) 0%, rgba(13,13,26,0.4) 100%);
  pointer-events: none;
}
.rat-hero-content { position: relative; z-index: 1; }
.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-title {
  font-family: 'Georgia', serif;
  font-size: 3rem;
  color: white;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}
.rat-hero-sub {
  font-style: italic;
  color: rgba(255,255,255,0.8);
  font-size: 1.2rem;
  margin-top: 0.5rem;
  font-family: 'Georgia', serif;
}

/* ── Example Buttons (pills) ── */
.examples-area { margin-top: 0.75rem; }
.examples-inline { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── About Banner & Footer (override for dark theme) ── */
.custom-footer a { color: var(--accent-color); }
.coffee-link { color: var(--accent-color) !important; }
