:root {
    --brand-primary: #1E3A8A; /* Readystreet Navy */
    --brand-secondary: #3B82F6; /* Readystreet Light Blue */
    --bg-color: #F8FAFC;
    --panel-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --success-color: #10B981;
    --error-color: #EF4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
}

.logo-text .accent {
    color: var(--brand-secondary);
}

h1 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Container & Panels */
.app-container {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow: hidden;
}

.panel {
    background-color: var(--panel-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.left-panel {
    flex: 1;
    max-width: 45%;
}

.right-panel {
    flex: 1;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--brand-primary);
}

.panel-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Inputs & Buttons */
.input-group {
    padding: 1.5rem;
    flex: 1;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.primary-btn {
    margin: 0 1.5rem 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: #172B66;
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* Loading State */
#loadingIndicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--brand-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result Area */
.result-area {
    padding: 0 1.5rem 1.5rem;
}

.result-area h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--success-color);
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.file-icon {
    width: 32px;
    height: 32px;
    color: var(--brand-secondary);
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-name {
    font-weight: 500;
}

.download-link {
    color: var(--brand-secondary);
    text-decoration: none;
    font-size: 0.85rem;
}

.download-link:hover {
    text-decoration: underline;
}

/* Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.system-msg {
    align-self: center;
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    border: 1px dashed var(--border-color);
}

.user-msg {
    align-self: flex-end;
    background-color: var(--brand-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-msg {
    align-self: flex-start;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.chat-input-area textarea {
    height: 48px;
    padding: 0.75rem 1rem;
}

.send-btn {
    width: 48px;
    height: 48px;
    background-color: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #172B66;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}
