/* ============================================
   FAVORITES / SAVED PROMPTS STYLES
   ============================================ */

/* --- Trigger Button in Header --- */
.btn-favorites {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.btn-favorites:hover,
.btn-favorites.has-favs {
    border-color: #f472b6;
    color: #f472b6;
    background: rgba(244, 114, 182, 0.07);
}

.btn-favorites svg {
    flex-shrink: 0;
    transition: fill var(--transition-fast);
}

.btn-favorites.has-favs svg {
    fill: #f472b6;
    stroke: #f472b6;
}

.fav-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 20px;
    background: #f472b6;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

/* --- Overlay --- */
.favorites-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.favorites-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* --- Panel --- */
.favorites-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: #111827;
    border-left: 1px solid var(--border-color);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
}

.favorites-panel.open {
    transform: translateX(0);
}

/* Panel Header */
.fav-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.fav-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.fav-panel-title svg {
    fill: #f472b6;
    stroke: #f472b6;
}

.fav-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    background: transparent;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
    line-height: 1;
}

.fav-panel-close:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Panel Actions Bar */
.fav-panel-actions {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.fav-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.fav-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.fav-export-btn {
    background: rgba(6, 214, 160, 0.1);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: var(--accent-3);
    flex: 1;
}

.fav-export-btn:hover:not(:disabled) {
    background: rgba(6, 214, 160, 0.18);
    border-color: var(--accent-3);
}

.fav-clear-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.fav-clear-btn:hover:not(:disabled) {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.07);
}

/* Empty State */
.fav-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
}

.fav-empty-icon { font-size: 2.5rem; }
.fav-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.fav-empty-desc {
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.6;
}

/* Fav List */
.fav-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fav-list::-webkit-scrollbar {
    width: 4px;
}
.fav-list::-webkit-scrollbar-track {
    background: transparent;
}
.fav-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Fav Item */
.fav-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: border-color var(--transition-fast);
}

.fav-item:hover {
    border-color: rgba(244, 114, 182, 0.3);
}

.fav-item-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.fav-tag {
    font-size: 0.62rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-1);
}

.fav-tag-niche {
    background: rgba(6, 214, 160, 0.1);
    color: var(--accent-3);
}

.fav-item-text {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.fav-item-actions {
    display: flex;
    gap: 8px;
}

.fav-copy-btn,
.fav-remove-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.fav-copy-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.fav-copy-btn:hover {
    border-color: var(--accent-3);
    color: var(--accent-3);
}

.fav-remove-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
}
.fav-remove-btn:hover {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

/* --- Save Button on Prompt Cards --- */
.prompt-save-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-left: 4px;
}

.prompt-save-btn:hover {
    border-color: rgba(244, 114, 182, 0.4);
    color: #f472b6;
    background: rgba(244, 114, 182, 0.07);
}

.prompt-save-btn.saved {
    color: #f472b6;
    border-color: rgba(244, 114, 182, 0.3);
    background: rgba(244, 114, 182, 0.08);
}

.prompt-save-btn.pulse {
    animation: savePulse 0.5s ease;
}

@keyframes savePulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Mobile */
@media (max-width: 480px) {
    .favorites-panel { width: 100vw; }
    .btn-favorites span { display: none; }
    .btn-favorites { padding: 8px 10px; }
}
