:root {
    --background-light: #f0f2f5;
    --card-background: #ffffff;
    --text-dark: #1c1c1e;
    --text-secondary: #6c757d;
    --border-color: #e5e5ea;
    --primary-blue: #007aff;
}
body.light-theme {
    background: var(--background-light);
    color: var(--text-dark);
}
main.news-admin-container {
    padding-top: 80px;
}

/* --- REVISED FILTER LAYOUT --- */
.filters-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Space between Search, Period, and Tags sections */
    margin-bottom: 2rem;
}

#search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 26px;
    border: 1px solid var(--border-color);
    background: var(--card-background);
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Space between label and inputs */
}

.filter-group label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    padding-left: 0.25rem;
    margin-bottom: 0;
}

.date-fields-group {
    display: flex;
    gap: 1rem;
}
.date-fields-group input {
    flex: 1;
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-background); /* White background to stand out */
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* MODIFIED and NEW styles for tags */
.tags-filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.visible-tags-wrapper {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping */
    gap: 0.75rem;
    overflow: hidden; /* Hide overflowing tags */
    flex: 1;
    min-width: 0;
}

.tags-filter .tag-btn {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    color: var(--primary-blue);
    flex-shrink: 0; /* Prevent tags from shrinking */
}

.tags-filter .tag-btn.active {
    background: var(--primary-blue) !important;
    color: white !important;
    border-color: var(--primary-blue) !important;
}

.more-tags-btn {
    flex-shrink: 0;
    background: #1c1c1e !important; /* Black button */
    color: white !important;
    border-color: #1c1c1e !important;
}

.tags-dropdown {
    position: absolute;
    top: 100%;
    right: 0; /* Align to the right side */
    left: auto; /* Override previous left: 0 */
    margin-top: 0.5rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    padding: 0.75rem;
    display: none; /* Toggled by JS */
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 200px; /* Give it some base width */
}
/* --- END OF REVISED LAYOUT --- */

.filter-group input:focus, #search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.admin-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
}

.news-month-group {
    margin-bottom: 2.5rem;
}
.month-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.news-item-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.news-item-info {
    flex-grow: 1;
    min-width: 0;
}
.news-item-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.news-item-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.news-status {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}
.news-status.published { background-color: #d4edda; color: #155724; }
.news-status.scheduled { background-color: #fff3cd; color: #856404; }

.news-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.action-btn {
    background: var(--background-light);
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.action-btn:hover {
    background-color: #e5e5ea;
}
.action-btn svg {
    width: 18px;
    height: 18px;
}