/* ============================================================
   SHARED.CSS — Suggestions, recent searches, selection bar,
                explain panel, share menus
   ============================================================ */

/* --- Suggestions dropdown --- */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    z-index: 50;
}
.suggestions.visible { display: block; }
.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
}
.suggestion-item:hover { background: #f1f5f9; }

/* --- Recent searches dropdown --- */
.recent-searches {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    z-index: 49;
}
.recent-searches.visible { display: block; }
.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.recent-label {
    font-size: 12px;
    color: #94a3b8;
}
.recent-clear {
    font-size: 12px;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.recent-clear:hover { text-decoration: underline; }
.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
}
.recent-item:hover { background: #f1f5f9; }
.recent-remove {
    margin-left: auto;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
}
.recent-item:hover .recent-remove { opacity: 1; }
.recent-remove:hover { color: #c5221f; }

/* --- Selection bar (fixed bottom) --- */
.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}
.selection-bar.visible { display: flex; }
.selection-count { font-size: 14px; color: #64748b; }
.selection-actions { display: flex; gap: 12px; }
.explain-btn {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.explain-btn:hover { background: #2563eb; }
.explain-btn:disabled { background: #e2e8f0; cursor: not-allowed; }
.clear-btn {
    padding: 8px 16px;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
}

/* --- Explain panel (right slide-in) --- */
.explain-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    z-index: 200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}
.explain-panel.open { right: 0; }
.explain-header {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.explain-header h3 { margin: 0; font-size: 16px; }
.explain-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}
.explain-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.explain-disclaimer {
    font-size: 12px;
    color: #94a3b8;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}

/* --- Share dropdown --- */
.share-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.share-trigger {
    font-size: 12px;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.share-trigger i { font-size: 11px; margin-right: 2px; }
.share-trigger:hover { background: #eff6ff; }
.share-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    padding: 4px 0;
    margin-top: 4px;
    z-index: 1000;
}
.share-menu.open { display: block; }
.share-menu.open-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}
.share-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    color: #3c4043;
    cursor: pointer;
}
.share-menu button:hover { background: #f1f5f9; }
.share-menu button i {
    width: 18px;
    text-align: center;
    margin-right: 6px;
    color: #64748b;
}
.share-menu button i.fa-brands { font-size: 15px; }
.share-menu button i.fa-whatsapp { color: #25D366; }
.share-menu button i.fa-facebook-messenger { color: #0084FF; }
.share-menu button i.fa-microsoft { color: #5059C9; }
.share-menu button i.fa-facebook { color: #1877F2; }
.share-menu button i.fa-linkedin { color: #0A66C2; }
.share-menu button i.fa-x-twitter { color: #000; }
.share-menu hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #f1f5f9;
}
