/**
 * PleChat - Social Feed Styles
 */

.social-page {
    min-height: 100vh;
    padding-bottom: 80px;
    background: var(--bg-primary);
}

.social-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Create Post Card */
.create-post-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.create-post-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.create-post-header .user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.create-post-header .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.create-post-header textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    padding: 8px 0;
    resize: none;
    min-height: 60px;
    font-family: inherit;
}

.create-post-header textarea:focus {
    outline: none;
}

.create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.attach-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.attach-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.btn-publish {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.btn-publish:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

/* Post Card */
.post-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    margin-bottom: 0;
    padding-top: 15px;
    overflow: visible;
}

.post-card:last-child {
    border-bottom: none;
}

.post-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.post-author {
    display: flex;
    gap: 12px;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--text-primary);
}

.author-name a {
    color: inherit;
    text-decoration: none;
}

.author-name a:hover {
    text-decoration: underline;
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.delete-post-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.delete-post-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.post-content {
    padding: 0 16px 16px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.post-media {
    width: 100%;
    display: flex;
    justify-content: center;
}

.post-media img, .post-media video {
    max-width: 100%;
    max-height: 600px;
    display: block;
}

.post-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.post-actions {
    display: flex;
    gap: 20px;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: var(--transition);
}

/* Comments Section */
.comments-section {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.comments-list .comment-item {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.comments-list .comment-item .user-avatar-xs {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comments-list .comment-item .user-avatar-xs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comments-list .comment-item .user-avatar-xs .avatar-placeholder {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    line-height: 24px;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.comments-list .comment-item .comment-body {
    background: var(--bg-hover);
    padding: 6px 10px;
    border-radius: 10px;
    flex: 1;
    font-size: 0.84rem;
}

.comments-list .comment-item .comment-body strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.comments-list .comment-item .comment-body p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.comments-list .comment-item .comment-reply-action-btn,
.comments-list .comment-item .comment-view-replies-btn {
    font-size: 0.72rem;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar-xs {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-xs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-body {
    background: var(--bg-hover);
    padding: 8px 12px;
    border-radius: 12px;
    flex: 1;
    font-size: 0.9rem;
}

.comment-body strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.comment-body p {
    margin: 0;
    color: var(--text-secondary);
}

.comment-input-row {
    display: flex;
    gap: 10px;
    position: relative !important;
}

.comment-input-row input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    padding-right: 40px !important;
    border-radius: var(--radius-full);
    font-size: 16px;
}

.comment-input-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.comment-send-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    color: var(--accent-primary) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px !important;
    transition: opacity 0.2s, transform 0.2s !important;
    z-index: 2 !important;
}

.comment-send-btn:hover {
    opacity: 0.8 !important;
    transform: translateY(-50%) scale(1.08) !important;
}

.comment-send-btn:active {
    transform: translateY(-50%) scale(0.92) !important;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 10px;
}

.liked svg {
    fill: #ef4444 !important;
    stroke: #ef4444 !important;
}

.action-btn.liked {
    color: #ef4444 !important;
}

/* Multi-media carousel styling */
.post-media-carousel-wrapper {
    position: relative;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

.post-media-carousel {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 8px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: flex-start !important;
}

.post-media-carousel::-webkit-scrollbar {
    display: none !important;
}

.post-media-carousel .media-item {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    scroll-snap-align: start !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
    border: 1px solid var(--border-color) !important;
    box-sizing: border-box !important;
    display: block !important;
}

.post-media-carousel .media-item img,
.post-media-carousel .media-item video {
    width: 100% !important;
    height: auto !important;
    max-height: 650px !important;
    object-fit: cover !important;
    display: block !important;
}

.post-media-carousel .media-indicator {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    z-index: 10 !important;
    font-family: monospace !important;
}

/* Threaded comments (replies) design (4x smaller scale) */
.comment-item.reply-comment {
    position: relative !important;
    margin-left: 32px !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    gap: 6px !important;
}

.comment-item.reply-comment .user-avatar-xs {
    width: 16px !important;
    height: 16px !important;
}

.comment-item.reply-comment .avatar-placeholder {
    width: 16px !important;
    height: 16px !important;
    font-size: 0.55rem !important;
    line-height: 16px !important;
}

.comment-item.reply-comment .comment-body {
    padding: 4px 6px !important;
    border-radius: 8px !important;
    font-size: 0.72rem !important;
}

.comment-item.reply-comment .comment-body strong {
    font-size: 0.68rem !important;
}

.comment-item.reply-comment .comment-body p {
    font-size: 0.7rem !important;
}

.comment-item.reply-comment .comment-reply-action-btn,
.comment-item.reply-comment .comment-view-replies-btn {
    font-size: 0.64rem !important;
}

.comment-item.reply-comment .comment-like-btn {
    padding: 1px 3px !important;
}

.comment-item.reply-comment .comment-like-btn svg {
    width: 10px !important;
    height: 10px !important;
}

.comment-item.reply-comment .comment-likes-count {
    font-size: 0.6rem !important;
}

.comment-item.reply-comment::before {
    content: "" !important;
    position: absolute !important;
    left: -16px !important; /* aligns with center of parent 20px avatar (12px) since margin-left is 28px: 12 - 28 = -16px */
    top: -18px !important; /* increased to connect higher up */
    width: 16px !important; /* spans to the reply avatar */
    height: 28px !important; /* increased height to cover the gap */
    border-left: 2px solid rgba(255, 255, 255, 0.15) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15) !important;
    border-bottom-left-radius: 6px !important;
    pointer-events: none !important;
}

/* On light theme, make the connection line color matching the border color */
html[data-theme="light"] .comment-item.reply-comment::before,
body[data-theme="light"] .comment-item.reply-comment::before {
    border-color: rgba(0, 0, 0, 0.12) !important;
}

/* Threads Modal Overlay */
.thread-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Slide up from bottom */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.thread-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Container */
.thread-modal-container {
    width: 100%;
    max-width: 680px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-surface);
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.thread-modal-overlay.active .thread-modal-container {
    transform: translateY(0);
}

/* Header */
.thread-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top)) !important; /* safe area support to prevent notches blocking the back button */
    border-bottom: 1px solid var(--border-color);
}

.thread-modal-back-btn,
.thread-modal-action-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.thread-modal-back-btn:hover,
.thread-modal-action-icon:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.thread-modal-header-title-container {
    text-align: center;
}

.thread-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.thread-modal-views-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.thread-modal-header-actions {
    display: flex;
    gap: 8px;
}

/* Body / Scroll Area */
.thread-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); /* space for sticky footer and safe area */
    position: relative;
    scroll-behavior: smooth;
}

/* Cloned Parent Post Styling */
.thread-modal-parent-post-wrapper {
    position: relative;
    padding-top: 12px;
}

.thread-modal-parent-post-wrapper .post-card {
    border-bottom: none !important;
    padding-top: 0 !important;
    position: relative !important;
}

.thread-modal-parent-post-wrapper .post-card .post-header {
    padding-left: 0;
    padding-right: 0;
}

.thread-modal-parent-post-wrapper .post-card .post-content {
    padding-left: 0;
    padding-right: 0;
}

.thread-modal-parent-post-wrapper .post-card .post-media {
    padding-left: 0;
    padding-right: 0;
}

.thread-modal-parent-post-wrapper .post-card .post-media-carousel-wrapper {
    padding-left: 0;
    padding-right: 0;
}

.thread-modal-parent-post-wrapper .post-card .post-footer {
    padding-left: 0;
    padding-right: 0;
    border-top: none;
}

/* Compact style for the cloned parent post inside the thread modal */
.thread-parent-post {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.thread-parent-post .post-header {
    padding: 6px 0 !important;
    margin-bottom: 4px !important;
}

.thread-parent-post .user-avatar-sm {
    width: 24px !important;
    height: 24px !important;
}

.thread-parent-post .user-avatar-sm img,
.thread-parent-post .user-avatar-sm .avatar-placeholder {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
    line-height: 24px !important;
}

.thread-parent-post .author-name {
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    color: var(--text-primary) !important;
}

.thread-parent-post .post-time {
    font-size: 0.65rem !important;
    color: var(--text-muted) !important;
}

.thread-parent-post .post-content {
    padding: 0 0 6px 36px !important;
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
    color: var(--text-primary) !important;
}

.thread-parent-post .post-media,
.thread-parent-post .post-media-carousel-wrapper {
    margin-left: 36px !important;
    width: calc(100% - 36px) !important;
    box-sizing: border-box !important;
}

.thread-parent-post .post-media {
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.thread-parent-post .post-media img,
.thread-parent-post .post-media video,
.thread-parent-post .post-media-carousel .media-item img,
.thread-parent-post .post-media-carousel .media-item video {
    max-height: 180px !important;
}

.thread-parent-post .post-footer {
    padding: 2px 0 2px 36px !important;
    border-top: none !important;
}

.thread-parent-post .post-actions {
    gap: 8px !important;
}

.thread-parent-post .action-btn {
    font-size: 0.7rem !important;
    padding: 2px 4px !important;
    gap: 3px !important;
}

.thread-parent-post .action-btn svg {
    width: 14px !important;
    height: 14px !important;
}

/* Connect parent avatar to first comment */
.thread-modal-parent-post-wrapper .post-card::before {
    display: none !important;
}

/* Comments Divider */
.thread-modal-comments-divider {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    margin-top: 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.thread-modal-comments-divider .divider-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.thread-modal-comments-divider .divider-activity {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.thread-modal-comments-divider .divider-activity:hover {
    color: var(--accent-primary);
}

/* Comments List inside Modal */
.thread-modal-comments-list {
    display: flex;
    flex-direction: column;
}

.thread-modal-comments-list .comment-item {
    gap: 8px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 12px !important;
}

.thread-modal-comments-list .comment-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
.thread-modal-comments-list .comment-item:not(.reply-comment) .user-avatar-xs {
    width: 20px !important;
    height: 20px !important;
    margin-left: 2px !important; /* aligns center perfectly with 24px parent post avatar */
}
.thread-modal-comments-list .comment-item:not(.reply-comment) .avatar-placeholder {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.65rem !important;
    line-height: 20px !important;
}
.thread-modal-comments-list .comment-item:not(.reply-comment) .comment-body {
    padding: 5px 8px !important;
    border-radius: 10px !important;
    font-size: 0.78rem !important;
}
.thread-modal-comments-list .comment-item:not(.reply-comment) .comment-body strong {
    font-size: 0.74rem !important;
}
.thread-modal-comments-list .comment-item:not(.reply-comment) .comment-body p {
    font-size: 0.76rem !important;
}
.thread-modal-comments-list .comment-item:not(.reply-comment) .comment-reply-action-btn,
.thread-modal-comments-list .comment-item:not(.reply-comment) .comment-view-replies-btn {
    font-size: 0.68rem !important;
}

/* Sticky Footer Reply Box */
.thread-modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 6px 12px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    z-index: 10;
}

.thread-modal-footer-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-modal-user-avatar {
    flex-shrink: 0;
    width: 18px !important;
    height: 18px !important;
}

.thread-modal-user-avatar img,
.thread-modal-user-avatar .avatar-placeholder {
    width: 18px !important;
    height: 18px !important;
    font-size: 0.6rem !important;
    line-height: 18px !important;
}

.thread-modal-input-wrapper {
    flex: 1;
}

.thread-modal-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    padding: 6px 0;
}

.thread-modal-input-wrapper input:focus {
    outline: none;
}

.thread-modal-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-modal-footer-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.thread-modal-footer-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

.thread-modal-send-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: transform 0.2s, opacity 0.2s;
}

.thread-modal-send-btn:hover {
    opacity: 0.8;
    transform: scale(1.08);
}

.thread-modal-send-btn:active {
    transform: scale(0.92);
}

/* Make sure modal behaves beautifully on larger screens */
@media (min-width: 769px) {
    .thread-modal-overlay {
        align-items: center; /* Center on desktop */
    }
    .thread-modal-container {
        height: 80vh !important;
        max-height: 80vh !important;
        border-radius: 24px !important;
        border: 1px solid var(--border-color) !important;
    }
    .thread-modal-footer {
        padding-bottom: 6px !important;
    }
    .thread-modal-body {
        padding-bottom: 90px !important;
    }
}

/* Popups for Footer Actions in Thread Modal */
.thread-modal-popover {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 280px;
    max-width: calc(100vw - 32px);
    background: rgba(15, 15, 25, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.05);
    display: none;
    z-index: 100;
    box-sizing: border-box;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] .thread-modal-popover {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Emoji Picker Popup (matching chat design) */
.emoji-picker-popup {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.emoji-picker-popup::-webkit-scrollbar {
    width: 4px;
}
.emoji-picker-popup::-webkit-scrollbar-track {
    background: transparent;
}
.emoji-picker-popup::-webkit-scrollbar-thumb {
    background: rgba(108, 99, 255, 0.3);
    border-radius: 4px;
}

.emoji-picker-item {
    font-size: 1.4rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s, background 0.15s;
    user-select: none;
    padding: 4px;
}

.emoji-picker-item:hover {
    transform: scale(1.3) translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
    filter: drop-shadow(0 0 8px rgba(108, 99, 255, 0.6));
}

html[data-theme="light"] .emoji-picker-item:hover {
    background: rgba(0, 0, 0, 0.06);
    filter: drop-shadow(0 0 8px rgba(108, 99, 255, 0.3));
}

/* GIF Picker Popup */
.gif-picker-popup {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.gif-picker-popup::-webkit-scrollbar {
    width: 4px;
}
.gif-picker-popup::-webkit-scrollbar-track {
    background: transparent;
}
.gif-picker-popup::-webkit-scrollbar-thumb {
    background: rgba(108, 99, 255, 0.3);
    border-radius: 4px;
}

.gif-picker-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    height: 70px;
}

.gif-picker-item:hover {
    border-color: var(--accent-primary);
    transform: scale(1.04);
}

.gif-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Evitar solapamiento con la barra de navegación inferior en móviles */
@media (max-width: 768px) {
    .social-page {
        padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* --- Estilos para Fotos Premium / De Pago --- */
.locked-blur {
    -webkit-filter: blur(45px) !important;
    filter: blur(45px) !important;
    transform: scale(1.05) !important;
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1), -webkit-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: none;
    user-select: none;
}

.locked-photo-overlay {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(10, 15, 26, 0.6) !important;
    transition: all 0.3s ease;
}

html[data-theme="light"] .locked-photo-overlay {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #0f172a;
}

.price-creator {
    animation: slideDownPrice 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownPrice {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 500px) {
    .create-post-actions {
        padding-top: 10px !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
    }
    .attachment-btns {
        flex: 1 !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        display: flex !important;
    }
    .attachment-btns .attach-btn span {
        display: none !important;
    }
    .attachment-btns .attach-btn {
        padding: 0 !important;
        background: var(--bg-hover) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 50% !important;
        width: 36px !important;
        height: 36px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        transition: background-color 0.2s, border-color 0.2s !important;
    }
    .attachment-btns .attach-btn:hover {
        background: rgba(108, 99, 255, 0.1) !important;
        border-color: var(--accent-primary) !important;
    }
    .btn-publish {
        padding: 6px 18px !important;
        font-size: 0.82rem !important;
        border-radius: 20px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
}

/* === ELEGANT SIDEBAR & MAIN LAYOUT STYLES === */
@media (min-width: 769px) {
    .social-page-layout {
        display: flex;
        min-height: 100vh;
        background: var(--bg-primary);
    }
    .desktop-nav-links, .feed-tabs, .page-header {
        display: none !important;
    }
    .desktop-sidebar {
        width: 280px;
        background: var(--bg-secondary);
        border-right: 1px solid var(--border-color);
        padding: 30px 20px;
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        box-sizing: border-box;
    }
    .social-main-content {
        margin-left: 280px;
        flex: 1;
        min-width: 0;
    }
    .social-container {
        padding-top: 40px !important;
    }
    .sidebar-logo {
        margin-bottom: 35px;
        padding-left: 10px;
    }
    .sidebar-logo img {
        height: 38px;
        object-fit: contain;
    }
    .sidebar-nav-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
    }
    .sidebar-nav-item {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 16px;
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.95rem;
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
        position: relative;
    }
    .sidebar-nav-item svg {
        color: var(--text-muted);
        transition: color 0.2s ease;
    }
    .sidebar-nav-item:hover {
        background: var(--bg-hover);
        color: var(--accent-primary);
    }
    .sidebar-nav-item:hover svg {
        color: var(--accent-primary);
    }
    .sidebar-nav-item.active {
        background: var(--bg-active);
        color: var(--accent-primary);
        font-weight: 600;
    }
    .sidebar-nav-item.active-live {
        background: var(--bg-active);
        color: var(--accent-primary) !important;
        font-weight: 600;
    }
    .sidebar-nav-item.active svg,
    .sidebar-nav-item.active-live svg {
        color: var(--accent-primary) !important;
    }
    .sidebar-nav-item .badge {
        background: #ef4444;
        color: white;
        font-size: 9px;
        font-weight: 800;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        margin-left: auto;
    }
    .sidebar-footer {
        margin-top: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
        border-top: 1px solid var(--border-color);
        padding-top: 20px;
    }
    .sidebar-profile-card {
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: var(--text-primary);
        padding: 8px;
        border-radius: var(--radius-md);
        transition: background 0.2s;
    }
    .sidebar-profile-card:hover {
        background: var(--bg-hover);
    }
    .sidebar-profile-card .avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }
    .sidebar-profile-card .profile-info {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .sidebar-profile-card .name {
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sidebar-profile-card .username {
        font-size: 0.75rem;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sidebar-theme-btn:hover {
        background: var(--bg-hover) !important;
        color: var(--accent-primary) !important;
    }
    
    /* Mostrar imágenes completas sin recortar en PC */
    .post-media img,
    .post-media-carousel .media-item img {
        object-fit: contain !important;
        max-height: 750px !important;
        width: 100% !important;
        height: auto !important;
        background-color: rgba(0, 0, 0, 0.05) !important;
    }
    html[data-theme="dark"] .post-media img,
    html[data-theme="dark"] .post-media-carousel .media-item img {
        background-color: rgba(255, 255, 255, 0.02) !important;
    }
}

/* Golden Creator Insignia Badge -> Premium Purple Badge */
.badge-creator-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #a855f7 0%, #d946ef 50%, #7c3aed 100%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.5);
    line-height: 14px;
    font-family: 'Inter', sans-serif;
    user-select: none;
    text-align: center;
}

@media (max-width: 768px) {
    .desktop-sidebar, .desktop-nav-links {
        display: none !important;
    }
}

