/* Publications Filter Wrapper */
.publications-filter-wrapper {
    margin: 1.5rem 0 2rem 0;
}

/* Filter Header - Always Visible */
.filter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e5e5;
}

/* Compact Search Input in Header */
.search-input-compact {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
    max-width: 400px;
}

.search-input-compact:focus {
    outline: none;
    border-color: var(--teal-blue, #006884);
    box-shadow: 0 0 0 2px rgba(0, 104, 132, 0.1);
}

/* Filter Toggle Button */
.filter-toggle-btn {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--teal-blue, #006884);
    background: white;
    color: var(--teal-blue, #006884);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-toggle-btn:hover {
    background: var(--teal-blue, #006884);
    color: white;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.filter-toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Inline Results Count */
.results-count-inline {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.875rem;
    color: var(--text-light, #737373);
    font-style: italic;
    white-space: nowrap;
}

/* Collapsible Filter Controls */
.publications-filter-controls {
    background: var(--off-white, #f8f6f2);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.publications-filter-controls.collapsed {
    max-height: 0;
    padding: 0 1.5rem;
    opacity: 0;
    margin-bottom: 0;
}

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

.filter-section:last-child {
    margin-bottom: 0;
}

/* Filter Row for side-by-side controls */
.filter-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.filter-row .filter-section {
    flex: 1;
}

.filter-section label {
    display: block;
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #333);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Theme Filter Buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--teal-blue, #006884);
    background: white;
    color: var(--teal-blue, #006884);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--teal-blue, #006884);
    color: white;
}

.filter-btn.active {
    background: var(--teal-blue, #006884);
    color: white;
    font-weight: 600;
}

/* Year Filter Dropdown */
.year-select {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    color: var(--text-primary, #333);
    cursor: pointer;
    min-width: 150px;
}

.year-select:focus {
    outline: none;
    border-color: var(--teal-blue, #006884);
    box-shadow: 0 0 0 2px rgba(0, 104, 132, 0.1);
}

/* Search Input */
.search-input {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 400px;
}

.search-input:focus {
    outline: none;
    border-color: var(--teal-blue, #006884);
    box-shadow: 0 0 0 2px rgba(0, 104, 132, 0.1);
}

.search-input::placeholder {
    color: #999;
}

/* Clear Filters Button */
.clear-btn {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--terracotta, #bf5738);
    background: white;
    color: var(--terracotta, #bf5738);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: var(--terracotta, #bf5738);
    color: white;
}

/* Results Count */
.results-count {
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-size: 0.875rem;
    color: var(--text-light, #737373);
    margin-left: 1rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-header {
        flex-wrap: wrap;
    }

    .search-input-compact {
        max-width: 100%;
        order: 1;
        flex-basis: 100%;
    }

    .filter-toggle-btn {
        order: 2;
    }

    .results-count-inline {
        order: 3;
        font-size: 0.8rem;
    }

    .publications-filter-controls {
        padding: 1rem;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        gap: 0.4rem;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Smooth transitions for showing/hiding publications */
.publication-item {
    transition: opacity 0.2s ease;
}

.publication-item[style*="display: none"] {
    opacity: 0;
}
