/**
 * YCCUON Social Comments System (Facebook & Instagram Style)
 * Modern social feed layout for listing discussions
 */

:root {
    --ycc-soc-navy: #002663;
    --ycc-soc-navy-dark: #001940;
    --ycc-soc-gold: #cfa025;
    --ycc-soc-gold-light: #fef3c7;
    --ycc-soc-gold-dark: #92400e;
    --ycc-soc-bubble-bg: #f0f2f5;
    --ycc-soc-bubble-hover: #e4e6eb;
    --ycc-soc-seller-bg: #f8fafc;
    --ycc-soc-seller-border: #cfa025;
    --ycc-soc-text: #050505;
    --ycc-soc-muted: #65676b;
    --ycc-soc-border: #e4e6eb;
    --ycc-soc-heart: #e11d48;
    --ycc-soc-blue-link: #1877f2;
    --ycc-soc-shadow: 0 2px 8px rgba(0, 38, 99, 0.06);
    --ycc-soc-radius: 18px;
}

/* Discussion Wrapper Card */
.ycc-discussion-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--ycc-soc-shadow);
    border: 1px solid #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ycc-soc-text);
}

/* Header & Counter Bar */
.ycc-soc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ycc-soc-border);
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.ycc-soc-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.ycc-soc-title-text {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: 1.65rem;
    color: var(--ycc-soc-navy);
    margin: 0;
}

.ycc-soc-count-badge {
    background: linear-gradient(135deg, var(--ycc-soc-navy) 0%, #1e3a8a 100%);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ycc-soc-filter-dropdown select {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.ycc-soc-filter-dropdown select:focus {
    border-color: var(--ycc-soc-navy);
    box-shadow: 0 0 0 3px rgba(0, 38, 99, 0.1);
}

/* ==========================================================================
   Composer Box (Facebook / Instagram Input Bar)
   ========================================================================== */
.ycc-composer {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
    align-items: flex-start;
}

.ycc-composer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.ycc-avatar-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ycc-soc-navy) 0%, #2563eb 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 38, 99, 0.15);
    text-transform: uppercase;
}

.ycc-composer-main {
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--ycc-soc-radius);
    padding: 12px 16px;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ycc-composer-main:focus-within {
    border-color: var(--ycc-soc-navy);
    box-shadow: 0 0 0 3px rgba(0, 38, 99, 0.12);
    background: #ffffff;
}

.ycc-composer-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ycc-soc-text);
    min-height: 44px;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
    padding: 0;
}

.ycc-composer-textarea::placeholder {
    color: #94a3b8;
}

/* Guest Info Fields */
.ycc-composer-guest-fields {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.ycc-composer-guest-fields input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.85rem;
    outline: none;
    transition: 0.2s;
    background: #f8fafc;
}

.ycc-composer-guest-fields input:focus {
    border-color: var(--ycc-soc-navy);
    background: #fff;
}

/* Composer Bottom Toolbar */
.ycc-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 10px;
}

.ycc-emoji-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ycc-emoji-btn {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.ycc-emoji-btn:hover {
    background: #f1f5f9;
    transform: scale(1.25);
}

.ycc-composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ycc-btn-cancel-reply {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.ycc-btn-cancel-reply:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.ycc-btn-submit {
    background: linear-gradient(135deg, var(--ycc-soc-navy) 0%, #001940 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 7px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 38, 99, 0.2);
}

.ycc-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 38, 99, 0.3);
    background: linear-gradient(135deg, #003380 0%, #001f4d 100%);
}

.ycc-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Comments Feed & Thread Items
   ========================================================================== */
.ycc-comments-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ycc-comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    animation: yccFadeIn 0.35s ease forwards;
}

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

.ycc-comment-avatar-col {
    flex-shrink: 0;
}

.ycc-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ycc-avatar-initials-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-transform: uppercase;
}

.ycc-comment-content-col {
    flex-grow: 1;
    min-width: 0; /* Prevent flex overflow */
}

/* Facebook / Instagram Bubble */
.ycc-bubble {
    background: var(--ycc-soc-bubble-bg);
    border-radius: var(--ycc-soc-radius);
    padding: 10px 16px;
    display: inline-block;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ycc-comment-item:hover .ycc-bubble {
    background: var(--ycc-soc-bubble-hover);
}

/* Seller / Author Highlighted Bubble */
.ycc-comment-item.is-seller .ycc-bubble {
    background: var(--ycc-soc-seller-bg);
    border: 1px solid rgba(207, 160, 37, 0.4);
    border-left: 3.5px solid var(--ycc-soc-gold);
    box-shadow: 0 2px 8px rgba(207, 160, 37, 0.08);
}

/* Pinned Comment */
.ycc-comment-item.is-pinned {
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: 14px;
    padding: 12px;
}

/* Bubble Header */
.ycc-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.ycc-author-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ycc-soc-navy);
    text-decoration: none;
    line-height: 1.2;
}

.ycc-author-name:hover {
    text-decoration: underline;
    color: var(--ycc-soc-blue-link);
}

/* Social Badges */
.ycc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.ycc-badge-seller {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.ycc-badge-seller i {
    color: #d97706;
}

.ycc-badge-staff {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.ycc-badge-pinned {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fcd34d;
}

/* Bubble Body Text */
.ycc-bubble-text {
    font-size: 0.94rem;
    line-height: 1.5;
    color: #1e293b;
    word-break: break-word;
    margin: 0;
}

.ycc-bubble-text p {
    margin: 0 0 6px 0;
}

.ycc-bubble-text p:last-child {
    margin-bottom: 0;
}

.ycc-bubble-text .ycc-mention {
    color: var(--ycc-soc-blue-link);
    font-weight: 600;
    text-decoration: none;
}

/* Action Row (Like, Reply, Time) */
.ycc-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 5px;
    margin-left: 14px;
    font-size: 0.8rem;
    color: var(--ycc-soc-muted);
}

.ycc-time {
    color: #94a3b8;
    font-size: 0.78rem;
}

.ycc-action-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--ycc-soc-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s ease, transform 0.1s ease;
    font-family: inherit;
}

.ycc-action-btn:hover {
    color: var(--ycc-soc-navy);
}

/* Like Heart Button */
.ycc-btn-like.is-liked {
    color: var(--ycc-soc-heart);
}

.ycc-btn-like.is-liked .fa-heart {
    color: var(--ycc-soc-heart);
    animation: yccHeartPop 0.35s ease;
}

@keyframes yccHeartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.ycc-like-count-pill {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Reply & Pin Buttons */
.ycc-btn-reply:hover {
    color: var(--ycc-soc-blue-link);
}

.ycc-btn-pin {
    color: #94a3b8;
}

.ycc-btn-pin:hover {
    color: #d97706;
}

/* ==========================================================================
   Threaded Replies (Instagram Style Nested Connector Line)
   ========================================================================== */
.ycc-replies-thread {
    margin-top: 14px;
    margin-left: 8px;
    padding-left: 18px;
    border-left: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.ycc-comment-item.is-reply .ycc-comment-avatar {
    width: 32px;
    height: 32px;
}

.ycc-comment-item.is-reply .ycc-avatar-initials-small {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.ycc-comment-item.is-reply .ycc-bubble {
    padding: 8px 14px;
}

.ycc-comment-item.is-reply .ycc-bubble-text {
    font-size: 0.88rem;
}

/* Toggle Replies Button */
.ycc-toggle-replies-btn {
    background: transparent;
    border: none;
    color: var(--ycc-soc-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    margin-left: 12px;
    transition: color 0.2s;
}

.ycc-toggle-replies-btn:hover {
    color: var(--ycc-soc-blue-link);
}

.ycc-toggle-replies-btn i {
    font-size: 0.75rem;
}

/* Inline Reply Slot */
.ycc-inline-reply-slot {
    margin-top: 12px;
    margin-left: 10px;
}

.ycc-inline-reply-slot .ycc-composer {
    margin-bottom: 0;
    background: #f8fafc;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Empty State & Moderation Alert
   ========================================================================== */
.ycc-empty-comments {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 14px;
    border: 2px dashed #e2e8f0;
}

.ycc-empty-icon {
    font-size: 2.8rem;
    color: #94a3b8;
    margin-bottom: 12px;
    display: inline-block;
}

.ycc-empty-title {
    font-weight: 700;
    color: var(--ycc-soc-navy);
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.ycc-empty-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.ycc-moderation-notice {
    font-size: 0.75rem;
    color: #d97706;
    background: #fef3c7;
    border-radius: 8px;
    padding: 2px 8px;
    display: inline-block;
    margin-top: 4px;
}

/* ==========================================================================
   Toast Notification Popup
   ========================================================================== */
.ycc-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #002663;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0, 38, 99, 0.3);
    z-index: 999999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.ycc-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ycc-toast-success i {
    color: #10b981;
}

.ycc-toast-error {
    background: #991b1b;
}

.ycc-toast-error i {
    color: #fca5a5;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 640px) {
    .ycc-discussion-container {
        padding: 16px;
    }
    
    .ycc-soc-title-text {
        font-size: 1.35rem;
    }
    
    .ycc-composer {
        gap: 10px;
    }
    
    .ycc-composer-avatar, .ycc-avatar-initials {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .ycc-composer-guest-fields {
        flex-direction: column;
        gap: 8px;
    }
    
    .ycc-replies-thread {
        margin-left: 4px;
        padding-left: 12px;
    }
    
    .ycc-bubble {
        padding: 8px 12px;
    }
    
    .ycc-emoji-bar {
        gap: 2px;
    }
    
    .ycc-emoji-btn {
        font-size: 1rem;
        padding: 2px 4px;
    }
}
