/* GBook — Feed card layout (home + profile + search) + reactions */

.fb-post-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 18px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    min-width: 0;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.fb-post-card.post-engage-card,
.post-engage-card {
    position: relative;
    overflow: visible;
}

.post-card-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--card-border);
    position: relative;
    min-width: 0;
}

.post-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ebf8ff;
    color: var(--primary-color, #1877f2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border, #e2e8f0);
    flex: 0 0 44px;
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.post-author-meta h4 {
    font-size: 15px;
    color: var(--text-heading, var(--dark, #0f172a));
    margin: 0;
}

.post-author-profile-link {
    color: inherit;
    text-decoration: none;
}

.post-time {
    font-size: 11px;
    color: var(--text-subtle, var(--gray, #64748b));
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

.post-card-body {
    padding: 15px 18px;
    min-width: 0;
}

.post-title {
    font-size: 18px;
    color: var(--text-heading);
    margin: 0 0 8px;
}

.post-card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-body);
    margin: 0;
}

.post-card-image {
    width: 100%;
    max-height: 380px;
    overflow: hidden;
    background-color: #111;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.post-card-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-card-actions,
.post-action-blocks,
.post-card-actions.post-action-blocks,
.fb-action-bar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 0;
    padding: 2px 4px 6px !important;
    background: var(--card-bg) !important;
    border-top: 1px solid var(--card-border);
    box-shadow: none !important;
    overflow: visible !important;
}

.post-action-block,
.post-action-blocks .react-picker-wrap {
    position: relative;
    min-width: 0;
    width: 100%;
    flex: none !important;
    display: block;
}

.action-block-btn,
.post-action-blocks .action-block-btn,
.fb-action-bar .action-block-btn {
    width: 100%;
    min-height: 40px !important;
    height: 40px !important;
    max-height: none;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 6px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary, #65676b) !important;
}

.action-block-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    transform: none !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .action-block-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.fb-action-bar .action-block-btn i,
.fb-action-bar .action-block-btn .react-emoji-display {
    font-size: 18px;
    line-height: 1;
}

.action-block-icon {
    display: none !important;
}

.action-block-label,
.action-block-btn .react-label {
    display: inline !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    color: inherit !important;
}

.btn-react.has-react,
.btn-react.has-react.react-like {
    color: #0866ff !important;
}

.btn-react.has-react.react-love {
    color: #f33e58 !important;
}

.btn-react.has-react.react-haha,
.btn-react.has-react.react-wow,
.btn-react.has-react.react-sad {
    color: #f7b125 !important;
}

.btn-react.has-react.react-pray,
.btn-react.has-react.react-clap {
    color: #0866ff !important;
}

.btn-react {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.post-card-menu-wrap {
    margin-left: auto;
    position: relative;
    flex: 0 0 auto;
}

.post-card-menu-trigger {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.profile-feed .fb-post-card {
    margin-bottom: 0;
}

.profile-feed {
    min-width: 0;
}

html[data-theme="dark"] .post-action-blocks,
html[data-theme="dark"] .fb-action-bar {
    background: var(--card-bg) !important;
}

html[data-theme="dark"] .post-comment-panel {
    background: rgba(15, 23, 42, 0.55);
    border-top-color: var(--card-border);
}

html[data-theme="dark"] .comment-bubble {
    border-color: var(--card-border);
}

html[data-theme="dark"] .comment-bubble strong,
html[data-theme="dark"] .comment-panel-head h5 {
    color: var(--text-heading);
}

html[data-theme="dark"] .comment-bubble p {
    color: var(--text-body);
}

.homepage-food-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 18px 12px;
    padding: 12px 0;
    border-top: 1px dashed #e2e8f0;
}

.food-price-tag {
    font-size: 20px;
    font-weight: 800;
    color: #db2777;
}

.btn-order-food {
    padding: 8px 16px;
    font-size: 13px;
    background: #059669;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.post-engage-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-top: 1px solid #edf2f7;
    font-size: 12px;
    color: #64748b;
    gap: 10px;
    flex-wrap: wrap;
}

.engage-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.engage-emoji-stack {
    display: inline-flex;
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2px 8px 2px 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mini-emo {
    font-size: 14px;
    margin-right: -2px;
}

.engage-react-names {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    font-weight: 600;
    color: #475569;
}

.engage-empty-hint {
    font-style: italic;
    color: #94a3b8;
}

.engage-right {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.engage-link-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.engage-link-btn:hover {
    color: #1e3c72;
    text-decoration: underline;
}

.post-engage-actions {
    position: relative;
}

.react-picker-wrap {
    position: relative;
    flex: 1;
    overflow: visible;
}

.post-engage-actions {
    overflow: visible;
}

.action-btn.has-react {
    color: #1e3c72 !important;
}

.react-emoji-display {
    font-size: 18px;
    line-height: 1;
}

.emoji-picker-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    transform-origin: 24px bottom;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 6px 8px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
    z-index: 400;
    width: max-content;
    min-width: 0;
    max-width: calc(100vw - 16px);
    overflow: visible;
}

.emoji-picker-popup.fb-tray-anim {
    animation: fbTrayIn 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.emoji-picker-title {
    display: none;
}

.emoji-picker-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    justify-content: center;
    align-items: center;
    padding: 0;
}

@keyframes fbTrayIn {
    from { opacity: 0; transform: scale(0.55) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fbEmojiBounce {
    0%   { transform: scale(0.2) translateY(14px); opacity: 0; }
    65%  { transform: scale(1.28) translateY(-8px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.emoji-picker-popup.fb-tray-anim .emoji-opt {
    animation: fbEmojiBounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.emoji-picker-popup.fb-tray-anim .emoji-opt:nth-child(1) { animation-delay: 0.02s; }
.emoji-picker-popup.fb-tray-anim .emoji-opt:nth-child(2) { animation-delay: 0.05s; }
.emoji-picker-popup.fb-tray-anim .emoji-opt:nth-child(3) { animation-delay: 0.08s; }
.emoji-picker-popup.fb-tray-anim .emoji-opt:nth-child(4) { animation-delay: 0.11s; }
.emoji-picker-popup.fb-tray-anim .emoji-opt:nth-child(5) { animation-delay: 0.14s; }
.emoji-picker-popup.fb-tray-anim .emoji-opt:nth-child(6) { animation-delay: 0.17s; }
.emoji-picker-popup.fb-tray-anim .emoji-opt:nth-child(7) { animation-delay: 0.2s; }

.emoji-opt {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: transform 0.12s ease;
    line-height: 1;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-opt:hover {
    transform: scale(1.35) translateY(-6px);
    background: transparent;
}

.emoji-opt.active {
    background: #ebf8ff;
    box-shadow: 0 0 0 2px #3182ce;
}

.emoji-picker-popup[hidden] {
    display: none !important;
}

.post-comment-panel {
    border-top: 1px solid #edf2f7;
    background: #f8fafc;
    padding: 16px 18px 18px;
    animation: slideDown 0.3s ease;
}

.post-comment-panel[hidden] {
    display: none !important;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to   { opacity: 1; max-height: 800px; }
}

.comment-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.comment-panel-head h5 {
    font-size: 15px;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-panel-close,
.reactors-popup-close {
    background: #e2e8f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

.comment-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-list:empty::before {
    content: 'এখনও কোনো মতামত নেই — প্রথম কমেন্ট করুন!';
    display: block;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 20px 10px;
}

.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3c72, #4299e1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.comment-bubble {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 0 12px 12px 12px;
    padding: 10px 14px;
    flex: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.comment-bubble strong {
    display: block;
    font-size: 13px;
    color: #1a202c;
    margin-bottom: 4px;
}

.comment-bubble p {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

.comment-bubble time {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 6px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-guest-name {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
}

.comment-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.comment-input-row textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 44px;
    background: var(--card-bg);
}

.btn-comment-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.btn-comment-send:hover {
    transform: scale(1.05);
}

.reactors-popup {
    position: absolute;
    bottom: 52px;
    left: 18px;
    right: 18px;
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    z-index: 110;
    max-height: 260px;
    overflow: hidden;
    animation: emojiPop 0.25s ease;
}

.reactors-popup[hidden] {
    display: none !important;
}

.reactors-popup-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    color: #1e3c72;
}

.reactors-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 0;
}

.reactors-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
}

.reactors-list li span.emo {
    font-size: 18px;
}

.reactors-list li span.name {
    flex: 1;
    font-weight: 600;
    color: #334155;
}

.reactors-list li span.time {
    font-size: 11px;
    color: #94a3b8;
}

.post-engage-card .post-card-actions {
    border-top: none;
}

.post-engage-card .post-card-body {
    padding: 16px 18px;
}

.post-engage-card .post-title {
    margin-bottom: 8px;
}

/* মোবাইল — শুধু horizontal emoji, কোনো text নেই */
@media (max-width: 767px) {
    .post-engage-card,
    .fb-post-card.post-engage-card,
    .post-card-actions,
    .post-engage-actions,
    .react-picker-wrap {
        overflow: visible !important;
    }

    .post-action-blocks,
    .post-card-actions.post-action-blocks,
    .fb-action-bar {
        gap: 0 !important;
        padding: 2px 2px 6px !important;
        background: var(--card-bg) !important;
    }

    .action-block-btn,
    .post-action-blocks .action-block-btn,
    .post-action-blocks .btn-react,
    .post-action-blocks .btn-comment-toggle,
    .post-action-blocks .btn-share-post {
        min-height: 40px !important;
        height: 40px !important;
        padding: 0 4px !important;
        border-radius: 6px !important;
        flex-direction: row !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .btn-react .react-label,
    .btn-react .action-block-label {
        display: inline !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    .emoji-picker-popup {
        position: absolute;
        left: 4px;
        right: auto;
        bottom: calc(100% + 8px);
        top: auto;
        width: max-content;
        min-width: 0;
        max-width: calc(100vw - 12px);
        transform: none;
        flex-direction: row;
        align-items: center;
        border-radius: 999px;
        padding: 5px 6px;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.24);
        z-index: 500;
    }

    .emoji-picker-row {
        padding: 0;
        gap: 0;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .emoji-opt {
        width: 38px;
        height: 38px;
        font-size: 26px;
        padding: 4px;
    }

    .emoji-opt:active {
        transform: scale(1.2);
        background: #f1f5f9;
    }

    .reactors-popup:not([hidden]) {
        left: 0;
        right: auto;
        width: calc(100vw - 40px);
        max-width: 320px;
    }
}
