:root {
    --primary-color: #2563EB;
    --sidebar-bg: #0F172A;
    --main-bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --hover-bg: #F1F5F9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.logo-area h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-area p {
    color: #94A3B8;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    margin-bottom: 2rem;
}

.nav-divider {
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.nav-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #CBD5E1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.nav-btn .icon {
    font-family: 'Material Icons Round';
    font-size: 1.25rem;
    opacity: 0.8;
}

.footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: #475569;
    text-align: center;
    padding-top: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
}

.search-container {
    width: 100%;
    max-width: 600px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    font-family: 'Material Icons Round';
    color: var(--text-secondary);
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--main-bg);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background-color 0.1s;
    border-bottom: 1px solid #F1F5F9;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #F8FAFC;
    color: var(--primary-color);
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
}

#page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-count {
    background-color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Active Tags */
.active-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.active-tag-pill {
    background-color: #DBEAFE;
    color: #1E40AF;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.active-tag-pill:hover {
    background-color: #BFDBFE;
}

.active-tag-pill .remove-icon {
    font-size: 1rem;
}

/* Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #CBD5E1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.year-badge {
    background-color: var(--hover-bg);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.chevron {
    color: #CBD5E1;
    transition: color 0.2s;
}

.card:hover .chevron {
    color: var(--primary-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* Push tags to bottom */
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-pill {
    background-color: #EFF6FF;
    color: #3B82F6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.tag-pill:hover {
    background-color: #DBEAFE;
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
}