* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    line-height: 1.7;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 30px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.2s ease;
}

.sidebar-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.category-group {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.group-header {
    padding: 16px 24px;
    font-weight: 700;
    font-size: 14px;
    color: #e2e8f0;
    background: rgba(102, 126, 234, 0.15);
    cursor: pointer;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.group-header:hover {
    background: rgba(102, 126, 234, 0.25);
    color: #ffffff;
}

.category {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.category-header {
    padding: 14px 24px 14px 40px;
    font-weight: 600;
    font-size: 13px;
    color: #a0aec0;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e0;
}

.task-list {
    list-style: none;
}

.task-item {
    padding: 12px 24px 12px 56px;
    font-size: 14px;
    color: #cbd5e0;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-left-color: rgba(102, 126, 234, 0.5);
}

.task-item.active {
    background: rgba(102, 126, 234, 0.2);
    color: #ffffff;
    border-left-color: #667eea;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: transparent;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

/* Welcome Page */
.welcome-page {
    background: white;
    border-radius: 12px;
    padding: 50px 60px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 30px rgba(0, 0, 0, 0.1);
}

.welcome-page h1 {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

.welcome-page h2 {
    font-size: 24px;
    color: #2d3748;
    margin-top: 40px;
    margin-bottom: 18px;
    font-weight: 600;
}

.welcome-page p {
    margin-bottom: 18px;
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
}

.welcome-page ul {
    margin-left: 28px;
    margin-bottom: 18px;
}

.welcome-page li {
    margin-bottom: 12px;
    color: #4a5568;
    line-height: 1.7;
}

.welcome-page a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.welcome-page a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Report Viewer */
.report-viewer {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

.report-content {
    background: white;
    border-radius: 12px;
    padding: 50px 60px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 0;
}

.report-viewer h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 3px solid #e2e8f0;
}

.report-viewer h2 {
    font-size: 28px;
    color: #2d3748;
    margin-top: 40px;
    margin-bottom: 18px;
    font-weight: 600;
}

.report-viewer h3 {
    font-size: 22px;
    color: #4a5568;
    margin-top: 32px;
    margin-bottom: 14px;
    font-weight: 600;
}

.report-viewer p {
    margin-bottom: 18px;
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
}

.report-viewer ul,
.report-viewer ol {
    margin-left: 32px;
    margin-bottom: 18px;
}

.report-viewer li {
    margin-bottom: 10px;
    color: #4a5568;
    line-height: 1.7;
}

.report-viewer blockquote {
    border-left: 4px solid #667eea;
    padding-left: 24px;
    margin: 24px 0;
    color: #718096;
    font-style: italic;
    background: #f7fafc;
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
}

.report-viewer code {
    background: #edf2f7;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #d53f8c;
}

.report-viewer pre {
    background: #2d3748;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-viewer pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
}

.report-viewer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.report-viewer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Table of Contents */
.toc {
    position: sticky;
    top: 40px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #2d3748;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.toc ul {
    list-style: none;
    margin-left: 0;
}

.toc li {
    margin-bottom: 10px;
}

.toc a {
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    display: block;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
}

.toc a:hover {
    color: #667eea;
    border-left-color: #667eea;
    padding-left: 14px;
}

.toc .toc-h2 {
    margin-left: 0;
    font-weight: 500;
}

.toc .toc-h3 {
    margin-left: 16px;
    font-size: 13px;
    color: #718096;
}

.toc .toc-h4 {
    margin-left: 32px;
    font-size: 12px;
    color: #a0aec0;
}

/* Loading and Error States */
.loading,
.error {
    text-align: center;
    padding: 100px 20px;
    font-size: 18px;
    color: #718096;
}

.error {
    color: #e53e3e;
    font-weight: 500;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Visualization Page */
.visualization-page {
    background: transparent;
    padding: 40px 20px;
    overflow-y: auto;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.visualization-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 100%;
    padding: 60px 40px;
    text-align: center;
}

.page-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-icon svg {
    width: 45px;
    height: 45px;
    stroke: white;
}

.page-title {
    color: #1a202c;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-authors {
    color: #4a5568;
    font-size: 1rem;
    margin-bottom: 40px;
    line-height: 1.5;
}

.page-subtitle {
    color: #4a5568;
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-weight: 400;
}

.study-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #718096;
    font-weight: 600;
}

.info-value {
    color: #2d3748;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.paper-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 8px;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.paper-link svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.paper-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.about-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.about-button svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.about-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.chart-instructions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 24px;
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 1rem;
    line-height: 1.6;
}

.visualization-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 40px 0;
}

/* Scatter Plot Tooltip */
.scatter-tooltip {
    background: white;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scatter-tooltip-task {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 6px;
    font-size: 14px;
}

.scatter-tooltip-category {
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 6px;
}

.scatter-tooltip-data {
    font-size: 13px;
    color: #4a5568;
    margin: 0;
}

/* Scatter Plot Points - hover effect */
.recharts-scatter-symbol:hover {
    filter: drop-shadow(0 0 8px currentColor);
    cursor: pointer;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-container {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.modal-category-badge {
    padding: 4px 12px;
    background: #f0f0f0;
    color: #4a5568;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.modal-close-button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #4a5568;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    outline: none;
}

.modal-close-button:hover {
    color: #1a202c;
}

.modal-close-button:focus {
    outline: none;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
}

.modal-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #718096;
}

/* Report content in modal - reuse existing styles but scoped */
.modal-content .report-content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 800px;
    margin: 0 auto;
}

.modal-content .report-content h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 3px solid #e2e8f0;
}

.modal-content .report-content h2 {
    font-size: 28px;
    color: #2d3748;
    margin-top: 40px;
    margin-bottom: 18px;
    font-weight: 600;
}

.modal-content .report-content h3 {
    font-size: 22px;
    color: #4a5568;
    margin-top: 32px;
    margin-bottom: 14px;
    font-weight: 600;
}

.modal-content .report-content p {
    margin-bottom: 18px;
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
}

.modal-content .report-content ul,
.modal-content .report-content ol {
    margin-left: 32px;
    margin-bottom: 18px;
}

.modal-content .report-content li {
    margin-bottom: 10px;
    color: #4a5568;
    line-height: 1.7;
}

.modal-content .report-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 24px;
    margin: 24px 0;
    color: #718096;
    font-style: italic;
    background: #f7fafc;
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
}

.modal-content .report-content code {
    background: #edf2f7;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #d53f8c;
}

.modal-content .report-content pre {
    background: #2d3748;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-content .report-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
}

.modal-content .report-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-content .report-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Welcome page content in modal - remove box styling */
.modal-content .welcome-page {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 800px;
    margin: 0 auto;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 0;
    }

    .visualization-page {
        padding: 0;
        background: white;
    }

    .visualization-content {
        padding: 30px 20px;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
    }

    .page-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .page-icon svg {
        width: 35px;
        height: 35px;
    }

    .page-title {
        font-size: 1.75rem;
        margin-bottom: 8px;
    }

    .page-subtitle {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .page-authors {
        font-size: 0.875rem;
        margin-bottom: 25px;
    }

    .study-info {
        padding: 15px;
        margin-bottom: 20px;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
        padding: 10px 0;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .about-button,
    .paper-link {
        width: 100%;
        justify-content: center;
    }

    .chart-instructions {
        font-size: 0.875rem;
        padding: 12px 16px;
        margin-bottom: 20px;
    }

    .visualization-chart-container {
        padding: 10px 0 20px 0;
        overflow-x: auto;
    }

    /* Modal adjustments for mobile */
    .modal-container {
        height: 95vh;
        max-width: 100%;
        border-radius: 8px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-category-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-content .report-content h1 {
        font-size: 24px;
    }

    .modal-content .report-content h2 {
        font-size: 20px;
        margin-top: 30px;
    }

    .modal-content .report-content h3 {
        font-size: 18px;
        margin-top: 24px;
    }

    .modal-content .report-content p {
        font-size: 15px;
    }

    .report-content {
        padding: 0;
        box-shadow: none;
    }

    .modal-content .report-content {
        padding: 0;
        box-shadow: none;
    }
}
