/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a4d7c;
    --secondary-color: #2e7dba;
    --accent-color: #5ca3d6;
    --text-dark: #222;
    --text-light: #555;
    --bg-light: #f8f9fa;
    --border-color: #ddd;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fff;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    pointer-events: none;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    font-size: 3.5rem;
    line-height: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin: 0.25rem 0 0;
    font-weight: 400;
}

/* Header Navigation */
.header-nav {
    display: none; /* Hide on mobile by default */
    gap: 0.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Show nav on desktop */
@media (min-width: 769px) {
    .header-nav {
        display: flex;
    }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
    position: relative;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(26, 77, 124, 0.2);
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hero-text {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 3rem auto;
}

.stat {
    background: linear-gradient(135deg, #f8f9fa, #fff);
    padding: 2rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-quote {
    max-width: 700px;
    margin: 3rem auto 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border-left: 4px solid var(--secondary-color);
    border-radius: 8px;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hero-quote cite {
    display: block;
    margin-top: 1rem;
    font-size: 1rem;
    font-style: normal;
    color: var(--text-light);
    font-weight: 600;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin: 3rem 0 1rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: transform 0.3s ease;
}

.tab-btn:hover {
    color: var(--secondary-color);
    background: rgba(46, 125, 186, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(26, 77, 124, 0.05), rgba(46, 125, 186, 0.05));
}

.tab-btn.active::before {
    transform: translateX(-50%) scaleX(1);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 2rem 0;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.tab-content h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Embeds */
.embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Documents Page */
.documents-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.documents-source {
    background: linear-gradient(135deg, #e3f2fd, #f8f9fa);
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.documents-source p {
    margin: 0 0 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.source-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.source-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 77, 124, 0.3);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.document-card {
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.document-card:hover::before {
    transform: scaleY(1);
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary-color);
}

.doc-year {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    align-self: flex-start;
}

.document-card h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.4;
}

.document-card p {
    color: var(--text-light);
    line-height: 1.6;
    flex-grow: 1;
    margin: 0;
    font-size: 0.95rem;
}

.doc-link {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.document-card:hover .doc-link {
    text-decoration: underline;
}

/* Resources Page */
.resources-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.resource-card {
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary-color);
}

.resource-icon {
    font-size: 3rem;
    line-height: 1;
}

.resource-card h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 0;
}

.resource-card p {
    color: var(--text-light);
    line-height: 1.6;
    flex-grow: 1;
    margin: 0;
}

.resource-link {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.resource-card:hover .resource-link {
    text-decoration: underline;
}

.resources-note {
    background: var(--bg-light);
    border-left: 4px solid var(--secondary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.resources-note p {
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

.resources-note strong {
    color: var(--text-dark);
}

/* Chat Interface */
.chat-intro {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.chat-container {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
}

.chat-message {
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
}

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

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

.message-content {
    display: inline-block;
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    line-height: 1.5;
}

.chat-message.user .message-content {
    background: var(--secondary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .message-content {
    background: var(--bg-light);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.chat-input-container {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border-color);
}

#chat-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

#send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

#send-btn:hover:not(:disabled) {
    background: var(--secondary-color);
}

#send-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.typing-indicator {
    display: inline-block;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: var(--primary-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.markdown-content h1 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.markdown-content h2 {
    font-size: 1.3rem;
}

.markdown-content h3 {
    font-size: 1.15rem;
}

.markdown-content p {
    margin-bottom: 0.75rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content code {
    background: var(--bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 0.75rem;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 3px solid var(--secondary-color);
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

.markdown-content a {
    color: var(--secondary-color);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--text-dark);
}

.markdown-content em {
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    padding: 1rem;
    overflow-y: auto;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    margin: auto;
}

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

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.disclaimer-text {
    color: var(--text-dark);
    line-height: 1.7;
}

.disclaimer-text p {
    margin-bottom: 1rem;
}

.disclaimer-text ul {
    margin: 1rem 0 1rem 1.5rem;
}

.disclaimer-text li {
    margin-bottom: 0.75rem;
}

.disclaimer-text strong {
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 77, 124, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e9ecef;
}

/* Footer */
footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-light);
}

.admin-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.admin-link:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        justify-content: center;
    }

    .header-left {
        flex-direction: column;
        text-align: center;
        width: 100%;
    }

    .header-icon {
        font-size: 3rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .chat-container {
        max-width: 100%;
    }

    .message-content {
        max-width: 90%;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero-text {
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .hero-quote {
        font-size: 1rem;
        padding: 1.5rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .tab-content h3 {
        font-size: 1.5rem;
    }

    .documents-grid,
    .resources-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1.5rem;
        max-height: 95vh;
    }

    .modal-content h2 {
        font-size: 1.4rem;
    }

    .disclaimer-text {
        font-size: 0.9rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .hero {
        padding: 2rem 0 1rem;
    }

    .tab-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    #send-btn {
        padding: 1rem 1.25rem;
    }
}
