/* ===== ReadyStreet Midnight & Growth Brand System ===== */
:root {
    --brand-primary: #002D4E;       /* Royal Midnight */
    --brand-secondary: #8DB23D;     /* Fresh Growth */
    --brand-accent: #C9A84C;        /* Executive Gold */
    --brand-neutral: #4A4F54;       /* Slate Grey */
    --bg-color: #F8F9FB;            /* Frost White */
    --panel-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --success-color: #8DB23D;
    --error-color: #EF4444;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== Fade-Up Animation (Soul) ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.9s ease both;
}

/* ===== Header (Glassmorphism Nav) ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    color: var(--brand-primary);
}

.logo-text .accent {
    color: var(--brand-secondary);
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--brand-neutral);
}

.badge {
    margin-left: auto;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--brand-accent);
    border: 1px solid var(--brand-accent);
    border-radius: 20px;
    background: transparent;
}

/* ===== Container & Panels ===== */
.app-container {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow: hidden;
}

.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 45, 78, 0.06);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease-in-out;
}

.panel:hover {
    box-shadow: 0 12px 40px rgba(0, 45, 78, 0.1);
}

.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-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--brand-primary);
}

.panel-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== Inputs & Buttons ===== */
.input-group {
    padding: 1.5rem;
    flex: 1;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    resize: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
    background: var(--panel-bg);
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

textarea:focus {
    outline: none;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px rgba(141, 178, 61, 0.15);
}

.primary-btn {
    margin: 0 1.5rem 1.5rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #004A7C 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 45, 78, 0.25);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.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(141, 178, 61, 0.2);
    border-top-color: var(--brand-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Result Area ===== */
.result-area {
    padding: 0 1.5rem 1.5rem;
}

.result-area h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--success-color);
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-color);
    transition: border-color 0.3s ease-in-out;
}

.file-card:hover {
    border-color: var(--brand-secondary);
}

.file-icon-wrap {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(141, 178, 61, 0.1), rgba(141, 178, 61, 0.05));
    border-radius: 10px;
}

.file-icon {
    width: 22px;
    height: 22px;
    color: var(--brand-secondary);
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.file-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.download-link {
    color: var(--brand-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.3s ease-in-out;
}

.download-link:hover {
    color: var(--brand-primary);
    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: 0.75rem;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.system-msg {
    align-self: center;
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.82rem;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
}

.user-msg {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #004A7C 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-msg {
    align-self: flex-start;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.assistant-msg a {
    color: var(--brand-secondary);
    font-weight: 600;
}

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 0 0 16px 16px;
}

.chat-input-area textarea {
    height: 48px;
    padding: 0.7rem 1rem;
    border-radius: 10px;
}

.send-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand-secondary) 0%, #7AA030 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(141, 178, 61, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Upload Warning ===== */
.upload-warning {
    color: var(--brand-accent);
    font-size: 0.82rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(201, 168, 76, 0.08);
    border-radius: 8px;
    border-left: 3px solid var(--brand-accent);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .left-panel, .right-panel {
        max-width: 100%;
    }
    .app-header {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    .badge {
        display: none;
    }
}
