/* Modern Light Theme - Professional & Clean */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Color Palette */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #7c3aed;
    --accent: #0891b2;
    --success: #059669;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header with Gradient */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 2.5rem 3rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-text {
    flex: 1;
}

.header-logo {
    flex-shrink: 0;
}

.map-logo {
    height: 90px;
    width: auto;
    /* Display logo in original colors */
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

header .subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Disclaimer - Prominent Warning Box */
.disclaimer {
    background: #fffbeb;
    border: 2px solid #f59e0b;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.disclaimer-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclaimer-content {
    color: #78350f;
    font-size: 0.95rem;
    line-height: 1.7;
}

.disclaimer-content p {
    margin-bottom: 1.25rem;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
}

.disclaimer-content strong {
    font-weight: 600;
    color: #92400e;
}

.disclaimer-content a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

.disclaimer-content a:hover {
    color: #1d4ed8;
}

.disclaimer-button-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #fbbf24;
    text-align: center;
}

.official-regs-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.official-regs-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
    border-color: #1d4ed8;
}

.official-regs-button:active {
    transform: translateY(0);
}

.official-regs-button .button-icon {
    font-size: 1.5rem;
}

.official-regs-button .button-arrow {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.official-regs-button:hover .button-arrow {
    transform: translateX(4px);
}

/* Donation Callout */
.donation-callout {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.donation-content h3 {
    font-size: 1.5rem;
    color: #1e40af;
    margin-bottom: 1rem;
    font-weight: 700;
}

.donation-content p {
    color: #1e40af;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.donate-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.0625rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.donate-button:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: #b91c1c;
}

.donate-button:active {
    transform: translateY(0);
}

.donate-button .button-icon {
    font-size: 1.25rem;
}

.donate-button .button-arrow {
    font-size: 1.125rem;
    transition: transform 0.3s ease;
}

.donate-button:hover .button-arrow {
    transform: translateX(4px);
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.sidebar-section:hover {
    box-shadow: var(--shadow-lg);
}

.sidebar-section h2 {
    font-size: 1.125rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
    font-weight: 700;
    letter-spacing: -0.015em;
}

/* Sample Questions */
.sample-questions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sample-question {
    padding: 1rem 1.25rem;
    background: var(--surface-hover);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    position: relative;
}

.sample-question::before {
    content: '→';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    opacity: 0;
    transition: all 0.2s ease;
    color: var(--primary);
    font-size: 1.25rem;
}

.sample-question:hover {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.sample-question:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    color: white;
}

/* Document List */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-item {
    padding: 1.25rem;
    background: var(--surface-hover);
    border-radius: var(--radius);
    font-size: 0.875rem;
    border-left: 3px solid var(--primary);
    transition: all 0.2s ease;
    position: relative;
}

.document-item::before {
    content: '📄';
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 1.25rem;
    opacity: 0.4;
}

.document-item:hover {
    background: white;
    border-left-color: var(--success);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.document-item strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.document-item div {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Chat Container */
.chat-container {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    min-height: 600px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.welcome-message h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
}

.welcome-message p {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.info-note {
    background: rgba(37, 99, 235, 0.08);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    border-left: 4px solid var(--primary);
    color: var(--text-secondary);
}

/* Message Bubbles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.message.user .message-label {
    text-align: right;
}

.message-content {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    word-wrap: break-word;
    line-height: 1.7;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 0.25rem;
    box-shadow: var(--shadow-md);
}

.message.assistant .message-content {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-bottom-left-radius: 0.25rem;
    border: 1px solid var(--border);
}

/* Citations */
.citations {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

.citations-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.citations-title::before {
    content: '📚';
    font-size: 1rem;
}

.citation {
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    border-left: 3px solid var(--primary);
}

.citation-source {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8125rem;
}

.citation-text {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Loading Animation */
.loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface-hover);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: fit-content;
}

.loading-dots {
    display: flex;
    gap: 0.375rem;
}

.loading-dot {
    width: 0.625rem;
    height: 0.625rem;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes pulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    background: var(--surface-hover);
}

#userInput {
    flex: 1;
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

#userInput::placeholder {
    color: var(--text-muted);
}

#userInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.send-button:active {
    transform: translateY(0);
}

.send-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

/* Error Message */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 0.9375rem;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: var(--radius-sm);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-sm);
    border: 2px solid var(--background);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 320px 1fr;
    }
}

/* About MAP Footer */
.about-map {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    margin-top: 3rem;
    box-shadow: var(--shadow-md);
}

.about-map h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.about-map p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.about-map p:last-of-type {
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.footer-links .separator {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: 2;
    }

    .chat-container {
        order: 1;
        height: 500px;
    }
}

@media (max-width: 640px) {
    header {
        padding: 2rem 1.5rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .message {
        max-width: 90%;
    }

    .chat-input-container {
        flex-direction: column;
        align-items: stretch;
    }

    .send-button {
        justify-content: center;
    }

    .sidebar-section {
        padding: 1.25rem;
    }
}
