/**
 * Group Feed Styles — Instagram-style modern feed
 *
 * @package IncuCommunity\Modules\Groups
 * @since   1.0.0
 *
 * Prefix: .incuc-gf- (group feed)
 * Font:   Inter, -apple-system, BlinkMacSystemFont, sans-serif
 * Accent: #3B82F6
 */

/* ============================================
   1. CONTAINER
   ============================================ */
.incuc-gf {
    max-width: 680px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #111827;
}

/* ============================================
   2. COMPOSER
   ============================================ */
.incuc-gf-composer {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

/* 2a. Type tabs (Texto / Foto / Video / Encuesta) */
.incuc-gf-composer-tabs {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.incuc-gf-composer-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    background: #f3f4f6;
    border: 1px solid transparent;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.incuc-gf-composer-tab:hover {
    background: #e5e7eb;
    color: #111827;
}

.incuc-gf-composer-tab.active {
    background: #3B82F6;
    color: #fff;
    border-color: #3B82F6;
}

/* 2b. Body area */
.incuc-gf-composer-body {
    margin-bottom: 4px;
}

.incuc-gf-composer-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    min-height: 60px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: transparent;
    line-height: 1.5;
    box-sizing: border-box;
}

.incuc-gf-composer-textarea::placeholder {
    color: #9ca3af;
}

/* 2c. Dropzone (photo / video upload) */
.incuc-gf-composer-dropzone {
    position: relative;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    margin-bottom: 10px;
    box-sizing: border-box;
    text-align: center;
}

.incuc-gf-composer-dropzone:hover {
    border-color: #3B82F6;
    background: #eff6ff;
    color: #3B82F6;
}

.incuc-gf-composer-dropzone.has-file {
    border-style: solid;
    border-color: #10B981;
    background: #f0fdf4;
    color: #10B981;
}

.incuc-gf-composer-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* 2d. Preview (selected image/video before posting) */
.incuc-gf-composer-preview {
    position: relative;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    max-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.incuc-gf-composer-preview img,
.incuc-gf-composer-preview video {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    display: block;
}

.incuc-gf-composer-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2e. Poll builder */
.incuc-gf-composer-poll {
    margin-bottom: 10px;
}

.incuc-gf-composer-poll-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.incuc-gf-composer-poll-option input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f9fafb;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.incuc-gf-composer-poll-option input[type="text"]:focus {
    border-color: #3B82F6;
    background: #fff;
}

.incuc-gf-composer-poll-option-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    padding: 0;
}

.incuc-gf-composer-poll-option-remove:hover {
    color: #EF4444;
    background: #fef2f2;
}

.incuc-gf-composer-poll-add {
    background: none;
    border: none;
    color: #3B82F6;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
}

.incuc-gf-composer-poll-add:hover {
    color: #2563EB;
}

/* 2f. Footer */
.incuc-gf-composer-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.incuc-gf-composer-submit {
    padding: 8px 20px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.incuc-gf-composer-submit:hover {
    background: #2563EB;
}

.incuc-gf-composer-submit:disabled {
    background: #93C5FD;
    cursor: not-allowed;
}

/* ============================================
   3. CARD
   ============================================ */
.incuc-gf-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

/* ============================================
   4. CARD HEADER
   ============================================ */
.incuc-gf-card-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
}

.incuc-gf-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.incuc-gf-card-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.incuc-gf-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.incuc-gf-card-name:hover {
    text-decoration: underline;
}

.incuc-gf-card-time {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

/* Action area (follow / message buttons) */
.incuc-gf-card-action {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.incuc-gf-follow-btn {
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 4px 12px;
    border-radius: 16px;
    background: transparent;
    border: 1px solid #3B82F6;
    color: #3B82F6;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.incuc-gf-follow-btn:hover {
    background: #3B82F6;
    color: #fff;
}

.incuc-gf-message-btn {
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 4px 12px;
    border-radius: 16px;
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.incuc-gf-message-btn:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

.incuc-gf-pending-btn {
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 4px 12px;
    border-radius: 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #9ca3af;
    cursor: default;
    white-space: nowrap;
}

/* ============================================
   5. CARD CONTENT (text body)
   ============================================ */
.incuc-gf-card-content {
    padding: 0 16px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
    word-break: break-word;
}

.incuc-gf-card-content .incuc-mention {
    color: #3B82F6;
    font-weight: 500;
    text-decoration: none;
}

.incuc-gf-card-content .incuc-mention:hover {
    text-decoration: underline;
}

.incuc-gf-card-content .incuc-hashtag {
    color: #3B82F6;
    text-decoration: none;
}

.incuc-gf-card-content .incuc-hashtag:hover {
    text-decoration: underline;
}

.incuc-gf-card-content .incuc-link {
    color: #3B82F6;
    text-decoration: none;
}

.incuc-gf-card-content .incuc-link:hover {
    text-decoration: underline;
}

/* ============================================
   6. CARD MEDIA
   ============================================ */
.incuc-gf-card-media {
    /* Edge-to-edge media block */
}

.incuc-gf-card-media img {
    width: 100%;
    display: block;
    border-radius: 0;
}

.incuc-gf-card-media video {
    width: 100%;
    display: block;
    max-height: 500px;
    background: #000;
    object-fit: contain;
}

/* Link preview */
.incuc-gf-link-preview {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.incuc-gf-link-preview:hover {
    background: #f9fafb;
}

.incuc-gf-link-preview-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.incuc-gf-link-preview-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

.incuc-gf-link-preview-site {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.incuc-gf-link-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.incuc-gf-link-preview-desc {
    font-size: 13px;
    color: #6b7280;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================
   7. CARD POLL
   ============================================ */
.incuc-gf-card-poll {
    padding: 0 16px 12px;
}

.incuc-gf-poll-question {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
}

.incuc-gf-poll-option {
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.incuc-gf-poll-option:hover {
    border-color: #3B82F6;
    background: #f0f7ff;
}

.incuc-gf-poll-option.voted {
    border-color: #3B82F6;
    cursor: default;
}

.incuc-gf-poll-option.selected {
    border-color: #3B82F6;
    background: #eff6ff;
}

/* Progress bar (fills behind text when results are shown) */
.incuc-gf-poll-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #eff6ff;
    border-radius: 8px;
    transition: width 0.5s ease;
    pointer-events: none;
}

.incuc-gf-poll-option-text {
    position: relative;
    z-index: 1;
    font-size: 14px;
    color: #111827;
    flex: 1;
}

.incuc-gf-poll-option-pct {
    position: relative;
    z-index: 1;
    float: right;
    font-size: 13px;
    font-weight: 600;
    color: #3B82F6;
    margin-left: 8px;
}

.incuc-gf-poll-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

/* ============================================
   8. CARD COUNTERS (reactions + comments count)
   ============================================ */
.incuc-gf-card-counters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.incuc-gf-reactions-summary {
    display: flex;
    align-items: center;
    gap: 0;
}

.incuc-gf-reaction-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 1;
    background: #fff;
    border: 1.5px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    margin-right: -4px;
    position: relative;
}

.incuc-gf-reaction-badge:first-child {
    z-index: 3;
}

.incuc-gf-reaction-badge:nth-child(2) {
    z-index: 2;
}

.incuc-gf-reaction-badge:nth-child(3) {
    z-index: 1;
}

.incuc-gf-reactions-summary .count {
    font-size: 13px;
    color: #6b7280;
    margin-left: 8px;
}

.incuc-gf-comments-count {
    cursor: pointer;
    color: #6b7280;
    transition: color 0.15s;
}

.incuc-gf-comments-count:hover {
    text-decoration: underline;
    color: #374151;
}

/* ============================================
   9. CARD ACTIONS (Like / Comment / Share)
   ============================================ */
.incuc-gf-card-actions {
    display: flex;
    border-top: 1px solid #e5e7eb;
    margin: 8px 16px 0;
}

.incuc-gf-action-btn {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.incuc-gf-action-btn:hover {
    color: #111827;
}

.incuc-gf-action-btn.active {
    color: #3B82F6;
}

/* Active states for specific reactions */
.incuc-gf-action-btn.active.reaction-love  { color: #e91e63; }
.incuc-gf-action-btn.active.reaction-haha  { color: #f59e0b; }
.incuc-gf-action-btn.active.reaction-wow   { color: #f59e0b; }
.incuc-gf-action-btn.active.reaction-sad   { color: #f59e0b; }
.incuc-gf-action-btn.active.reaction-angry { color: #EF4444; }

.incuc-gf-action-btn .emoji {
    margin-right: 0;
    font-size: 16px;
    line-height: 1;
}

/* ============================================
   10. REACTION PICKER
   ============================================ */
.incuc-gf-reaction-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 6px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    gap: 4px;
    z-index: 10;
    margin-bottom: 4px;
}

.incuc-gf-action-btn:hover .incuc-gf-reaction-picker,
.incuc-gf-reaction-picker.is-open {
    display: flex;
}

.incuc-gf-reaction-option {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    border: none;
    padding: 0;
    transition: transform 0.15s, background 0.15s;
    line-height: 1;
}

.incuc-gf-reaction-option:hover {
    transform: scale(1.3);
    background: #f3f4f6;
}

/* ============================================
   11. COMMENTS
   ============================================ */
.incuc-gf-comments {
    padding: 0 16px 12px;
}

.incuc-gf-comment {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.incuc-gf-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.incuc-gf-comment-body {
    flex: 1;
    min-width: 0;
}

.incuc-gf-comment-bubble {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 8px 12px;
    display: inline-block;
    max-width: 100%;
}

.incuc-gf-comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    display: block;
}

.incuc-gf-comment-author:hover {
    text-decoration: underline;
}

.incuc-gf-comment-text {
    font-size: 13px;
    color: #374151;
    margin-top: 2px;
    word-break: break-word;
}

.incuc-gf-comment-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    display: block;
    margin-left: 4px;
}

/* Expand/collapse older comments */
.incuc-gf-comments-expand {
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #6b7280;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    margin-bottom: 8px;
    transition: color 0.15s;
}

.incuc-gf-comments-expand:hover {
    color: #111827;
}

/* Comment input form */
.incuc-gf-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.incuc-gf-comment-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    background: #f9fafb;
    color: #111827;
    outline: none;
    resize: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.incuc-gf-comment-input::placeholder {
    color: #9ca3af;
}

.incuc-gf-comment-input:focus {
    border-color: #3B82F6;
    background: #fff;
}

.incuc-gf-comment-submit {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.incuc-gf-comment-submit:hover {
    background: #2563EB;
}

.incuc-gf-comment-submit:disabled {
    background: #93C5FD;
    cursor: not-allowed;
}

/* ============================================
   12. INFINITE SCROLL SENTINEL
   ============================================ */
.incuc-gf-sentinel {
    text-align: center;
    padding: 20px;
}

.incuc-gf-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: incuc-gf-spin 0.6s linear infinite;
}

@keyframes incuc-gf-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   13. EMPTY STATE
   ============================================ */
.incuc-gf-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
    font-family: inherit;
}

.incuc-gf-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.incuc-gf-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* ============================================
   14. POST MENU (three-dot / contextual menu)
   ============================================ */
.incuc-gf-menu {
    position: relative;
    display: inline-block;
}

.incuc-gf-menu-toggle {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #6b7280;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.incuc-gf-menu-toggle:hover {
    background: #f3f4f6;
    color: #111827;
}

.incuc-gf-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
    z-index: 10;
    min-width: 140px;
}

.incuc-gf-menu.open .incuc-gf-menu-dropdown {
    display: block;
}

.incuc-gf-menu-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
    box-sizing: border-box;
}

.incuc-gf-menu-item:hover {
    background: #f3f4f6;
}

.incuc-gf-menu-item.danger {
    color: #EF4444;
}

.incuc-gf-menu-item.danger:hover {
    background: #fef2f2;
}

/* ============================================
   15. RESPONSIVE — max-width: 600px
   ============================================ */
@media (max-width: 600px) {
    .incuc-gf {
        padding: 0;
    }

    .incuc-gf-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .incuc-gf-composer {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .incuc-gf-composer-tabs {
        gap: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .incuc-gf-composer-tabs::-webkit-scrollbar {
        display: none;
    }

    .incuc-gf-composer-tab {
        font-size: 12px;
        padding: 6px 12px;
        flex-shrink: 0;
    }

    .incuc-gf-card-header {
        padding: 12px 14px;
    }

    .incuc-gf-card-content {
        padding: 0 14px 10px;
    }

    .incuc-gf-card-actions {
        margin: 6px 12px 0;
    }

    .incuc-gf-action-btn {
        font-size: 12px;
        padding: 8px 0;
    }

    .incuc-gf-comments {
        padding: 0 14px 10px;
    }

    .incuc-gf-card-counters {
        padding: 0 14px;
    }

    .incuc-gf-card-poll {
        padding: 0 14px 10px;
    }

    .incuc-gf-link-preview {
        padding: 10px 14px;
    }

    .incuc-gf-link-preview-image {
        width: 60px;
        height: 60px;
    }
}
