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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 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);
}

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

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

section {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent-color);
}

.description {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* Table Styles */
.data-table-wrapper {
    margin-bottom: 40px;
    overflow-x: auto;
}

.data-table-wrapper h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 15px;
    padding-left: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--bg-light);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Table Placeholder */
.table-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-style: italic;
}

/* Tabs Styles */
.tabs-container {
    margin-bottom: 30px;
}

.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    margin-bottom: 30px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-label {
    white-space: nowrap;
}

.tabs-content {
    position: relative;
    min-height: 400px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

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

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

.tab-content-wrapper {
    padding: 20px 0;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.chart-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.chart-card h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.chart-card canvas {
    max-height: 300px;
    transition: transform 0.2s ease;
}

.chart-card canvas[style*="cursor: pointer"] {
    cursor: pointer !important;
}

/* Search Container */
.search-container {
    margin-bottom: 30px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 15px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.search-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-color);
    background: transparent;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.clear-search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-light);
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clear-search-btn:hover {
    background: var(--bg-light);
    color: var(--text-color);
}

.clear-search-btn:active {
    transform: scale(0.9);
}

.search-results-count {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: italic;
}

/* Papers List */
.papers-list {
    display: grid;
    gap: 20px;
}

.paper-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.paper-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.paper-card:hover::before {
    width: 6px;
}

.paper-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.4;
}

.paper-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.paper-title a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.paper-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.paper-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
}

.paper-meta-item strong {
    color: var(--text-color);
    font-weight: 600;
}

.paper-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Default badge style (fallback for unknown types) */
.paper-badge {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

/* Specific badge types */
.paper-badge.badge-journal {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.paper-badge.badge-arxiv {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.paper-badge.badge-conference {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.paper-badge.badge-tutorial {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.paper-badge.badge-review {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.paper-badge.badge-survey {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.paper-badge.badge-magazine {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
}

.paper-badge.badge-white-paper {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.paper-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.paper-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.paper-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Summary Section */
.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.summary-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.summary-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

.footer p {
    opacity: 0.8;
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 20px;
    }

    .chart-card {
        padding: 20px;
    }
}

/* Mobile and small tablets */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header {
        padding: 40px 0;
    }

    .main-content {
        padding: 20px 0;
    }

    section {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 8px;
    }

    section h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }

    .description {
        font-size: 1rem;
        line-height: 1.7;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 10px 8px;
    }

    .summary-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Tabs - Vertical stack on mobile */
    .tabs-container {
        margin-bottom: 20px;
    }

    .tabs-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
        border-bottom: none;
    }

    .tab-btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 0.85rem;
        justify-content: flex-start;
        border-bottom: 3px solid transparent;
        border-left: 3px solid transparent;
        margin-bottom: 0;
        touch-action: manipulation;
    }

    .tab-btn.active {
        border-bottom-color: transparent;
        border-left-color: var(--primary-color);
    }

    .tab-icon {
        font-size: 1rem;
    }

    .tab-label {
        display: inline;
    }

    /* Charts - Full width on mobile */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }

    .chart-card {
        padding: 15px;
        border-radius: 8px;
    }

    .chart-card h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .chart-card canvas {
        max-height: 250px;
    }

    /* Search - Mobile optimized */
    .search-container {
        margin-bottom: 20px;
    }

    .search-wrapper {
        max-width: 100%;
        padding: 10px 14px;
        border-radius: 10px;
    }

    .search-icon {
        font-size: 1.1rem;
        margin-right: 10px;
    }

    .search-input {
        font-size: 0.95rem;
    }

    .clear-search-btn {
        width: 26px;
        height: 26px;
        font-size: 1.1rem;
    }

    .search-results-count {
        font-size: 0.85rem;
        margin-top: 8px;
    }

    /* Paper Cards - Mobile optimized */
    .papers-list {
        gap: 15px;
    }

    .paper-card {
        padding: 18px;
        border-radius: 8px;
    }

    .paper-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .paper-meta {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
        font-size: 0.85rem;
    }

    .paper-meta-item {
        flex-wrap: wrap;
    }

    .paper-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .paper-description {
        font-size: 0.9rem;
        margin-top: 10px;
        padding-top: 10px;
    }

    .paper-link {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.85rem;
        margin-top: 12px;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-state-icon {
        font-size: 3rem;
        margin-bottom: 15px;
    }

    .empty-state p {
        font-size: 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .title {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .header {
        padding: 30px 0;
    }

    section {
        padding: 15px 12px;
    }

    section h2 {
        font-size: 1.3rem;
    }

    .tabs-nav {
        gap: 6px;
    }

    .tab-btn {
        padding: 12px 14px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .tab-icon {
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .tab-label {
        display: inline;
        white-space: nowrap;
    }

    .chart-card {
        padding: 12px;
    }

    .chart-card h3 {
        font-size: 1rem;
    }

    .chart-card canvas {
        max-height: 200px;
    }

    .paper-card {
        padding: 15px;
    }

    .paper-title {
        font-size: 1rem;
    }

    .paper-meta {
        font-size: 0.8rem;
    }

    .paper-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .paper-description {
        font-size: 0.85rem;
    }

    .paper-link {
        padding: 9px 14px;
        font-size: 0.8rem;
    }

    .container {
        padding: 0 12px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 30px 0;
    }

    .title {
        font-size: 1.8rem;
    }

    .chart-card canvas {
        max-height: 200px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .tab-btn {
        padding: 14px 18px;
    }

    .paper-link {
        padding: 12px 18px;
    }

    .paper-card:hover {
        transform: none;
    }

    .paper-card:active {
        transform: scale(0.98);
    }

    .chart-card:hover {
        transform: none;
    }

    .tab-btn:active {
        transform: scale(0.95);
    }

    /* Larger touch targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Prevent text selection on tap */
    .tab-btn, .paper-link {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
        user-select: none;
        -webkit-user-select: none;
    }
}

/* Additional mobile optimizations */
.touch-device .paper-card {
    cursor: pointer;
}

.touch-device .paper-card:active {
    background-color: var(--bg-light);
}

/* Improve scrolling on mobile */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    .tabs-nav {
        scroll-behavior: smooth;
    }
}

/* Prevent layout shift on mobile */
@media (max-width: 768px) {
    .chart-card canvas {
        width: 100% !important;
        height: auto !important;
    }
}

/* Print Styles */
@media print {
    .header {
        background: var(--primary-color);
    }

    section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

