/* Base Theme: Space Ranger Academy (Primary Colors + Space) */
body {
    background-color: #0b132b; /* Deep Space Navy */
    background-image: radial-gradient(circle at 50% 50%, #1c2541 0%, #0b132b 100%); /* Subtle starfield glow */
    color: #111827; 
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Fredoka One', sans-serif; 
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Main Layout Container (The Spaceship Console) */
.terminal-container {
    display: flex;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    border: 6px solid #1d4ed8; /* Chunky Primary Blue Border */
    border-radius: 16px;
    background-color: #ffffff;
    box-shadow: 0px 8px 0px #1e3a8a, 0 15px 40px rgba(0,0,0,0.5); /* 3D Block effect floating in space */
    overflow: hidden;
}

/* Sidebar: The Ledger (The Caution Yellow Block) */
.ledger-sidebar {
    width: 30%;
    background-color: #fde047; /* Bright Primary Yellow */
    border-right: 6px solid #1d4ed8;
    padding: 20px;
}

.ledger-sidebar h2 {
    color: #b91c1c; /* Deep Primary Red */
    font-size: 1.5rem;
    font-weight: 900;
    border-bottom: 4px dashed #b91c1c;
    padding-bottom: 10px;
    margin-top: 0;
    text-transform: uppercase;
}

.ledger-item {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}

.label {
    color: #431407;
    font-weight: bold;
}

.value {
    font-weight: 900;
    color: #15803d; /* Strong Green */
}

/* Main Chat Area (The Viewscreen) */
.chat-window {
    width: 70%;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.chat-header {
    padding: 15px 20px;
    background-color: #eff6ff;
    border-bottom: 6px solid #1d4ed8;
}

.chat-header h3 {
    margin: 0;
    color: #b91c1c !important; /* Primary Red for Headers */
    font-size: 1.3rem;
    font-weight: 800;
}

.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- THE CHAT BUBBLES (Forcing them to match your theme) --- */
.message {
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.6;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0px 4px 0px rgba(0,0,0,0.1);
}

/* The Pilot (User) */
.message:not(.ai-message) {
    background-color: #1d4ed8 !important; /* Primary Blue */
    color: #ffffff !important;
    align-self: flex-end !important;
    border: none !important;
    border-bottom-right-radius: 0;
}

/* The Teachers (AI) */
.ai-message {
    background-color: #f3f4f6 !important; 
    color: #1f2937 !important;
    align-self: flex-start !important;
    border: 3px solid #b91c1c !important; /* Red border for AI */
    border-left: 8px solid #b91c1c !important; 
    border-bottom-left-radius: 0;
}

/* System Overrides (Elevator, Bridge, etc) */
.ai-message[style*="color: #3fb950"], 
.ai-message[style*="color: rgb(63, 185, 80)"] { 
    border-color: #16a34a !important; /* Primary Green */
    border-left: 8px solid #16a34a !important;
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

/* Input Area (The Flight Controls) */
.input-area {
    display: flex;
    padding: 20px;
    background-color: #eff6ff;
    border-top: 6px solid #1d4ed8;
    gap: 15px;
}

input {
    flex: 1;
    background-color: #ffffff !important;
    color: #111827 !important;
    border: 4px solid #93c5fd !important;
    padding: 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    outline: none;
    transition: all 0.2s;
}

input:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0px 4px 0px #93c5fd;
}

button {
    background-color: #22c55e !important; /* Bright Green Button */
    color: white !important;
    border: 4px solid #166534 !important;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0px 4px 0px #166534; /* 3D Button Effect */
}

button:hover {
    background-color: #16a34a !important;
    transform: translateY(2px);
    box-shadow: 0px 2px 0px #166534;
}
button:active {
    transform: translateY(4px);
    box-shadow: none;
}