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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: #f7fafc;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 60px;
    height: 60px;
    /* background: white; */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    padding: 6px;
    /* border: 2px solid rgba(102, 126, 234, 0.2); */
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text h1 a {
    color: inherit;
    text-decoration: none;
}

.logo-text p {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-limit {
    font-size: 0.8rem;
    color: #64748b;
    padding: 0.4rem 0.8rem;
    background: #f1f5f9;
    border-radius: 20px;
}

.upgrade-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
}

.login-btn {
    background: transparent;
    color: #475569;
    padding: 0.6rem 1.2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.login-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0 8rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="g" cx="50%" cy="50%"><stop offset="0%" stop-color="white" stop-opacity="0.1"/><stop offset="100%" stop-color="white" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23g)"/><circle cx="800" cy="300" r="150" fill="url(%23g)"/><circle cx="400" cy="700" r="120" fill="url(%23g)"/></svg>') no-repeat center/cover;
    opacity: 0.3;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Search Section */
.search-section {
    background: white;
    margin: -4rem auto 0;
    max-width: 1000px;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 12px;
}

.search-tab {
    flex: 1;
    padding: 0.8rem 1rem;
    text-align: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    color: #64748b;
}

.search-tab.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1.2rem 1.2rem 1.2rem 3.5rem;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
    background: #fafafa;
}

.search-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.3rem;
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.search-btn:hover {
    transform: translateY(-50%) translateY(-1px);
}

.quick-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-filter {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.quick-filter:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.quick-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 4rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
}

/* Sidebar */
.sidebar {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.usage-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.usage-card h4 {
    color: #0c4a6e;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.usage-display {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0284c7;
    margin-bottom: 0.5rem;
}

.usage-bar {
    background: #bae6fd;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.usage-progress {
    background: linear-gradient(90deg, #0284c7, #0369a1);
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.upgrade-cta {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h4 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    padding: 0.4rem 0.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.filter-chip:hover {
    background: #f1f5f9;
}

.filter-chip.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Content Area */
.content-area {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.trending-section h3 {
    color: #1e293b;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    font-weight: 700;
}

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

.trending-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
    cursor: pointer;
}

.trending-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}

.trending-card .icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.trending-card h4 {
    color: #1e293b;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.trending-card p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.trending-card .stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.trending-card .stats .documents {
    font-weight: 500;
}

/* Recent Searches */
.recent-searches {
    background: #fafafa;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.recent-searches h4 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1rem;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-tag {
    padding: 0.4rem 0.8rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.search-tag:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Search Results */
.results-summary {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-info h2 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.results-info p {
    color: #64748b;
}

.results-actions {
    display: flex;
    gap: 1rem;
}

.sort-btn, .export-btn {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.sort-btn:hover, .export-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.search-results-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
}

.results-sidebar {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h5 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
}

.results-main {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.result-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.result-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-type {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.result-relevance {
    color: #059669;
    font-size: 0.8rem;
    font-weight: 600;
}

.result-title {
    margin-bottom: 0.8rem;
}

.result-title a {
    color: #1e293b;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.result-title a:hover {
    color: #667eea;
}

.result-authors {
    color: #64748b;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.result-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

.result-abstract {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.result-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.result-tag {
    background: #f3f4f6;
    color: #374151;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.save-btn {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.save-btn:hover {
    background: #f9fafb;
    color: #374151;
}

.save-btn.saved {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.cite-btn {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.cite-btn:hover {
    background: #f9fafb;
    color: #374151;
}

.view-btn {
    background: #3b82f6;
    color: white;
    border: none;
}

.view-btn:hover {
    background: #2563eb;
}

/* No Results */
.no-results {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
    text-align: center;
}

.no-results-content {
    background: white;
    padding: 4rem 2rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.no-results-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.no-results h2 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.no-results p {
    color: #64748b;
    margin-bottom: 2rem;
}

.search-suggestions {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.search-suggestions h4 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.search-suggestions ul {
    color: #64748b;
    line-height: 1.8;
}

/* Advanced Search */
.advanced-search-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.advanced-search-content {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.advanced-search-content h2 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.advanced-search-content p {
    color: #64748b;
    margin-bottom: 2rem;
}

.advanced-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-row label {
    min-width: 120px;
    color: #374151;
    font-weight: 500;
}

.form-row input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.form-row input:focus {
    border-color: #667eea;
}

.advanced-search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 1rem;
}

.advanced-search-btn:hover {
    transform: translateY(-1px);
}

/* Pagination */
.pagination-container {
    margin-top: 3rem;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.6rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.page-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 4rem 0 2rem;
    margin-top: 6rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: #667eea;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    margin-top: 3rem;
    text-align: center;
    color: #64748b;
}

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

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

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

    .search-section {
        margin: -2rem 1rem 0;
        padding: 2rem;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .search-results-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .search-tabs {
        flex-direction: column;
    }

    .quick-filters {
        flex-direction: column;
    }

    .results-summary {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .trending-grid {
        grid-template-columns: 1fr;
    }
} 