/* =============================================================
 * Library Revit Favorites — frontend styles
 * Palette aligned with libraryrevit.com (logo blue + neutrals).
 * ============================================================= */

:root {
    --lrfav-blue: #4DA9DC;
    --lrfav-blue-dark: #3B9CD4;
    --lrfav-blue-soft: #eaf5fc;
    --lrfav-text: #1e293b;
    --lrfav-muted: #94a3b8;
    --lrfav-border: #e2e8f0;
    --lrfav-danger: #b91c1c;
}

/* ---------- Favorite button (next to the Description tab) ---------- */
.lrfav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 7px 13px;
    background: #fff;
    border: 1px solid var(--lrfav-border);
    border-radius: 6px;
    color: var(--lrfav-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
    text-decoration: none;
}
.lrfav-btn i { font-size: 15px; line-height: 1; }
.lrfav-btn:hover {
    color: var(--lrfav-blue);
    border-color: var(--lrfav-blue);
    background: var(--lrfav-blue-soft);
}
.lrfav-btn:focus-visible {
    outline: 2px solid var(--lrfav-blue);
    outline-offset: 2px;
}
.lrfav-btn.is-favorite {
    color: var(--lrfav-blue);
    border-color: var(--lrfav-blue);
    background: var(--lrfav-blue-soft);
}
.lrfav-btn.is-favorite i {
    animation: lrfav-pulse 260ms ease;
}
.lrfav-btn:disabled,
.lrfav-btn[aria-busy="true"] {
    opacity: 0.6;
    cursor: progress;
}

/* Insert cleanly inside Bootstrap nav-tabs */
.nav-tabs .lrfav-btn {
    align-self: center;
    margin-left: auto;
    margin-bottom: -1px;
}

@keyframes lrfav-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.28); }
    100% { transform: scale(1); }
}

/* ---------- Toast feedback ---------- */
.lrfav-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--lrfav-text);
    color: #fff;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 220ms ease, transform 220ms ease;
    z-index: 99999;
    pointer-events: none;
    max-width: 320px;
}
.lrfav-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.lrfav-toast.is-error {
    background: var(--lrfav-danger);
}

/* ---------- Dashboard view ---------- */
.lrfav-dashboard .lrfav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.lrfav-dashboard .lrfav-header__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.lrfav-dashboard .lrfav-header__title i {
    color: var(--lrfav-blue);
}
.lrfav-dashboard .lrfav-count {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 999px;
}

/* ---------- Toolbar (search + filters + sort) ---------- */
.lrfav-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--lrfav-border);
    background: #fafbfc;
}
/* Flex-based search box: the wrapper owns the border and padding,
 * so we never rely on the input's own padding-left (which parent
 * themes routinely override with their own input[type="search"]
 * rules and break the icon spacing). */
.lrfav-toolbar__search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    max-width: 380px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--lrfav-border);
    border-radius: 6px;
    background: #fff;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.lrfav-toolbar__search:focus-within {
    border-color: var(--lrfav-blue);
    box-shadow: 0 0 0 3px rgba(77, 169, 220, 0.15);
}
.lrfav-search-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: #64748b;
    display: block;
    pointer-events: none;
}
.lrfav-toolbar__search:focus-within .lrfav-search-icon {
    color: var(--lrfav-blue);
}
.lrfav-toolbar .lrfav-search-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    color: var(--lrfav-text);
    line-height: 1.5;
    box-shadow: none;
    outline: none;
}
.lrfav-toolbar .lrfav-search-input:focus { outline: none; box-shadow: none; }
.lrfav-search-input::-webkit-search-cancel-button { cursor: pointer; }
.lrfav-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.lrfav-toolbar__field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.lrfav-toolbar__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--lrfav-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.lrfav-toolbar select {
    height: 38px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--lrfav-border);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: var(--lrfav-text);
    cursor: pointer;
    transition: border-color 150ms ease;
}
.lrfav-toolbar select:hover { border-color: var(--lrfav-blue); }
.lrfav-toolbar select:focus {
    outline: none;
    border-color: var(--lrfav-blue);
    box-shadow: 0 0 0 3px rgba(77, 169, 220, 0.15);
}

.lrfav-no-results {
    padding: 40px 20px;
    text-align: center;
    color: var(--lrfav-muted);
    font-style: italic;
}

.lrfav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.lrfav-grid .lrfav-card {
    position: relative;
}

.lrfav-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 0;
    background: rgba(30, 41, 59, 0.82);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 180ms ease, transform 180ms ease;
}
.lrfav-remove:hover {
    background: var(--lrfav-danger);
    transform: scale(1.08);
}
.lrfav-remove:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.lrfav-remove:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- Empty state ---------- */
.lrfav-empty {
    text-align: center;
    padding: 56px 20px;
}
.lrfav-empty__icon {
    display: inline-block;
    font-size: 52px;
    color: #cbd5e1;
    margin-bottom: 18px;
}
.lrfav-empty__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--lrfav-text);
    margin: 0 0 8px;
}
.lrfav-empty__text {
    color: #64748b;
    margin: 0 0 22px;
}
.lrfav-empty__cta {
    display: inline-block;
}

/* ---------- Pagination ---------- */
.lrfav-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 26px;
}
.lrfav-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--lrfav-border);
    border-radius: 6px;
    color: #475569;
    background: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.lrfav-page:hover {
    color: var(--lrfav-blue);
    border-color: var(--lrfav-blue);
}
.lrfav-page.is-current {
    background: var(--lrfav-blue);
    color: #fff;
    border-color: var(--lrfav-blue);
    pointer-events: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .lrfav-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .lrfav-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .lrfav-toast { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}
