/* =========================================
   Filter Toolbar - Shared Styles
   For: hypomnemata.html, articles.html
   ========================================= */

/* --- Filter Container --- */
.filter-container {
    margin-bottom: 40px;
}

.filter-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

/* --- Icon Buttons --- */
.filter-icon-btn {
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-sub, #94a3b8);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .filter-icon-btn:hover {
        background: #334155;
        color: var(--text-main, #f1f5f9);
    }
}

.filter-icon-btn.active {
    color: var(--accent, #38bdf8);
    border-color: var(--accent, #38bdf8);
    background: rgba(56, 189, 248, 0.1);
}

/* --- Filter Panels --- */
.filter-panel {
    display: none;
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    padding: 20px;
    animation: slideDown 0.3s ease;
}

.filter-panel.show {
    display: block;
}

.panel-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- Filter Input --- */
.filter-input {
    background: var(--input-bg, #0f172a);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-main, #f1f5f9);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    flex-grow: 1;
    transition: 0.3s;
    caret-color: var(--accent, #38bdf8);
}

.filter-input:focus {
    border-color: var(--accent, #38bdf8);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* --- Add Button --- */
.add-btn {
    background: #334155;
    color: var(--text-main, #f1f5f9);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 0.9rem;
}

.add-btn:hover {
    background: #475569;
}

/* --- Date Mode Tabs --- */
.date-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    width: 100%;
    justify-content: center;
}

.date-tab {
    font-size: 0.85rem;
    color: var(--text-sub, #94a3b8);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
}

.date-tab:hover {
    color: var(--text-main, #f1f5f9);
    background: rgba(255, 255, 255, 0.05);
}

.date-tab.active {
    color: var(--accent, #38bdf8);
    font-weight: bold;
    background: rgba(56, 189, 248, 0.1);
}

.date-inputs-container>div {
    display: none;
    width: 100%;
}

.date-inputs-container>div.active {
    display: block;
}

/* --- Date Input Group --- */
.date-input-group {
    display: flex;
    gap: 15px;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.date-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-field label {
    font-size: 0.75rem;
    color: var(--text-sub, #94a3b8);
    font-weight: bold;
    margin-left: 2px;
}

.date-input-group .add-btn {
    margin-left: 0 !important;
    position: relative;
    top: 13px !important;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .date-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .date-input-group .add-btn {
        margin-top: 15px !important;
        margin-left: 0;
        width: 100%;
        justify-content: center;
        position: static !important;
        top: auto !important;
    }

    .panel-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .panel-row .add-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* --- Chip Area (for hypomnemata compatibility) --- */
.chip-area {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 0;
    align-items: center;
    padding-top: 10px;
    justify-content: center;
}

.chip {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid;
    transition: 0.2s;
    user-select: none;
}

.chip.leaf {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent, #38bdf8);
    color: var(--accent, #38bdf8);
}

.chip.leaf:hover {
    background: rgba(56, 189, 248, 0.2);
}

.chip.group {
    background: var(--group-bg, rgba(245, 158, 11, 0.1));
    border-color: var(--group-border, #f59e0b);
    color: #fbbf24;
}

.chip.group:hover {
    background: rgba(245, 158, 11, 0.2);
}

.chip.selected {
    box-shadow: 0 0 0 2px var(--text-main, #f1f5f9), 0 0 15px var(--accent, #38bdf8);
    transform: scale(1.05);
    z-index: 10;
}

.chip-delete {
    opacity: 0.6;
    padding: 2px;
    border-radius: 50%;
    font-size: 1.1em;
}

.chip-delete:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* --- Animation --- */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoom {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}