/**
 * Unified Hashtag Card Component Styles
 * Location: /var/www/saafee/public/css/hashtag-card.css
 * Single source of truth for card appearance across all hashtag pages.
 */

/* ── Container ── */
.hashtag-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Card ── */
.hashtag-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    animation: hcSlideIn 0.3s ease;
}

.hashtag-card:hover {
    border-color: #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ── Checkbox ── */
.card-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Content ── */
.card-content {
    flex: 1;
    min-width: 0;
}

.card-hashtag-row {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.card-hashtag {
    font-weight: 600;
    color: #E44335;
    word-break: break-all;
}

/* ── Meta ── */
.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #999;
    flex-wrap: wrap;
}

.meta-source {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #999;
}

.meta-emoji {
    font-size: 0.85rem;
    line-height: 1;
}

.meta-source-text {
    display: none;
}

.meta-separator {
    color: #ccc;
    font-size: 0.7rem;
}

.usage-count {
    color: #bbb;
    margin-inline-start: 6px;
    padding-inline-start: 8px;
    border-inline-start: 1px solid #e0e0e0;
}

.ai-badge {
    background: linear-gradient(135deg, #D4A017 0%, #F2C94C 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-category {
    background: #e8f4fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-trending {
    background: #fff3e0;
    color: #e65100;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

/* ── Card Actions (per-card buttons) ── */
.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-card-copy,
.btn-card-fav,
.btn-card-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-copy {
    color: #888;
}

.btn-card-copy:hover {
    background: rgba(228, 67, 53, 0.1);
}

.btn-card-copy:hover svg {
    stroke: #E44335;
}

.btn-card-fav {
    color: #ccc;
}

.btn-card-fav:hover {
    background: rgba(228, 67, 53, 0.1);
}

.btn-card-fav:hover svg {
    stroke: #E44335;
}

.btn-card-fav.saved {
    color: #E44335;
}

.btn-card-fav.saved svg {
    fill: #E44335;
    stroke: #E44335;
}

.btn-card-remove {
    color: #ccc;
}

.btn-card-remove:hover {
    background: rgba(235, 87, 87, 0.1);
}

.btn-card-remove:hover svg {
    stroke: #EB5757;
}

.btn-card-copy svg,
.btn-card-fav svg,
.btn-card-remove svg {
    flex-shrink: 0;
}

/* ── Header row (select all / none) ── */
.hashtag-card-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1rem;
}

.hashtag-card-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* ── Bulk actions bar (fixed bottom) ── */
.hashtag-bulk-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: none;
    gap: 0.75rem;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #E0E0E0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
}

.hashtag-bulk-bar.visible {
    display: flex;
}

.hashtag-bulk-bar .bulk-count {
    flex: 1;
    color: #E44335;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
}

/* ── Empty state ── */
.hashtag-card-empty {
    text-align: center;
    padding: 3rem 2rem;
    background: #f5f5f5;
    border-radius: 12px;
    margin: 2rem 0;
}

.hashtag-card-empty .empty-icon {
    color: #ccc;
    margin-bottom: 1rem;
}

.hashtag-card-empty h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

.hashtag-card-empty p {
    color: #999;
    margin-bottom: 1.5rem;
}

/* ── Button variants ── */
.hc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
}

.hc-btn-link {
    background: none;
    color: #E44335;
    border: none;
    padding: 0;
    min-height: auto;
    font-size: 0.85rem;
    text-decoration: none;
}

.hc-btn-link:hover {
    color: #C53727;
}

.hc-btn-primary {
    background: #E44335;
    color: #fff;
}

.hc-btn-primary:hover {
    background: #C53727;
    box-shadow: 0 2px 8px rgba(228, 67, 53, 0.3);
}

.hc-btn-danger {
    background: #fff;
    color: #EB5757;
    border: 1.5px solid #EB5757;
}

.hc-btn-danger:hover {
    background: #EB5757;
    color: #fff;
    box-shadow: 0 2px 8px rgba(235, 87, 87, 0.3);
}

/* ── Flash overlay (full-screen feedback) ── */
.hc-flash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.92;
    animation: hcFlashIn 0.15s ease-out both;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.hc-flash-out {
    animation: hcFlashOut 0.4s ease-in both;
}

@keyframes hcFlashIn {
    from { opacity: 0; transform: scale(1.1); }
    to   { opacity: 0.92; transform: scale(1); }
}

@keyframes hcFlashOut {
    from { opacity: 0.92; }
    to   { opacity: 0; }
}

/* ── Responsive ── */
@media (min-width: 768px) {
    .meta-source-text {
        display: inline;
    }

    .hashtag-bulk-bar {
        padding: 14px calc((100% - 1200px) / 2 + 20px);
    }
}

@media (max-width: 768px) {
    .hashtag-card {
        gap: 0.5rem;
        padding: 0.75rem;
    }
}

/* ── RTL ── */
html[dir="rtl"] .card-actions {
    flex-direction: row-reverse;
}

html[dir="rtl"] .card-hashtag-row {
    direction: rtl;
}

html[dir="rtl"] .hashtag-card {
    direction: rtl;
}

/* ── Animations ── */
@keyframes hcSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes hcSlideInUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes hcSlideOut {
    to { transform: translateX(100%); opacity: 0; }
}

html[dir="rtl"] .hashtag-card.removing {
    animation: hcSlideOutRTL 0.3s ease forwards;
}

.hashtag-card.removing {
    animation: hcSlideOut 0.3s ease forwards;
}

@keyframes hcSlideOutRTL {
    to { transform: translateX(-100%); opacity: 0; }
}

/* ── Favorites Limit Modal ── */
.hc-limit-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    transition: background 0.2s ease, backdrop-filter 0.2s ease;
    padding: 20px;
}

.hc-limit-overlay.visible {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.hc-limit-box {
    background: #fff;
    border-radius: 16px;
    padding: 36px 28px 28px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.9) translateY(10px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hc-limit-overlay.visible .hc-limit-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.hc-limit-icon {
    margin-bottom: 16px;
}

.hc-limit-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px;
}

.hc-limit-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0 0 24px;
}

.hc-limit-upgrade {
    display: block;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #D4A017, #F2C94C);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(212, 160, 23, 0.3);
    box-sizing: border-box;
}

.hc-limit-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.4);
}

.hc-limit-manage {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.85rem;
    color: #7A7A7A;
    text-decoration: none;
    transition: color 0.15s ease;
}

.hc-limit-manage:hover {
    color: #E44335;
}

/* ── Login Gate (register CTA uses primary red instead of gold) ── */
.hc-gate-register {
    background: #E44335 !important;
    box-shadow: 0 4px 14px rgba(228, 67, 53, 0.3) !important;
}

.hc-gate-register:hover {
    box-shadow: 0 6px 20px rgba(228, 67, 53, 0.4) !important;
}
