/* =================================================================
   FINAL & REFINED Light Mode CSS
   Version: 8.2 (Corrected Mobile Input Layout)
   ================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

/* 1. Main Container */
.fan-pulse-wrapper {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    margin: 40px 0;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* 2. Header Section and Polished Buttons */
.fp-header-bar {
    background: #f9fafb;
    padding: 18px 25px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fp-title h3 { font-size: 18px; font-weight: 800; color: #1a1a1b; margin: 0; }
.fp-title span { color: #FF2D55; }

.fp-reactions-mini .mini-react-btn {
    background: #f3f4f6;
    border: 1px solid transparent;
    color: #4b5563;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mini-react-btn:hover { background: #e5e7eb; }
.mini-react-btn.voted {
    background: #fff5f7;
    border-color: #FF2D55;
    color: #FF2D55;
}

/* 3. Chat Window */
.fp-comments-window {
    max-height: 50vh;
    min-height: 200px;
    overflow-y: auto;
    padding: 25px;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #ffffff;
}
.fp-empty, .loading-spinner { 
    text-align: center; 
    color: #9ca3af; 
    font-size: 14px; 
    padding: 50px 20px; 
}

/* Compact Comment Bubble */
.fp-chat-bubble {
    background: #f9fafb;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid #e5e7eb;
    position: relative;
}
.fp-author { 
    font-size: 14px; 
    font-weight: 700; 
    color: #111827;
    display: flex;
    align-items: center;
}
.fp-body { font-size: 15px; color: #374151; line-height: 1.6; margin-top: 5px; word-wrap: break-word; }

.fp-chat-bubble.is-reply { margin-left: 35px; background: #ffffff; }

.fp-chat-bubble.is-admin {
    background: #ffffff;
    border: 1px solid #FF2D55;
    padding: 0;
    border-left: none;
    overflow: hidden;
}
.admin-header-strip {
    background: #FF2D55;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-content-wrap { padding: 12px 15px; }
.fp-chat-bubble.is-admin .fp-author { font-weight: 800; color: #111827; }

.fp-author .verified-tick {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: #1877F2;
    border-radius: 50%;
    position: relative;
    margin-left: 6px;
    flex-shrink: 0;
}
.fp-author .verified-tick::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 4. Footer and Actions */
.fp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}
.fp-time { font-size: 12px; color: #555; }
.fp-actions { display: flex; align-items: center; gap: 15px; }

.vote-wrapper { background: #ffffff; border-radius: 6px; padding: 4px 8px; border: 1px solid #d1d5db; display: flex; align-items: center; }
.vote-btn { background: none; border: none; color: #9ca3af; cursor: pointer; padding: 0 5px; transition: color 0.2s ease; font-size: 14px; }
.vote-btn:hover { color: #111827; }
.vote-btn.active { color: #FF2D55; }
.vote-count { color: #111827; font-weight: bold; font-size: 13px; min-width: 15px; text-align: center; }
.reply-btn { background: none; border: none; font-size: 12px; font-weight: 700; color: #555; cursor: pointer; transition: color 0.2s ease; }
.reply-btn:hover { color: #FF2D55; text-decoration: underline; }
.fp-view-replies { background: none; border: none; color: #FF2D55; font-size: 13px; font-weight: 700; cursor: pointer; margin-left: 35px; margin-bottom: 10px; display: inline-block; padding: 5px 0; }
.fp-view-replies:hover { text-decoration: underline; }

/* Default hidden state for replies */
.fp-replies-container {
    display: none;
    padding-left: 35px;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* 5. Polished Input Dock */
.fp-input-dock { background: #f9fafb; padding: 20px 25px; border-top: 1px solid #e5e7eb; }
.admin-identifier { background: #fff5f7; border: 1px solid #ffdde5; color: #FF2D55; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 15px; display: inline-block; }

.fp-text-area { display: flex; gap: 10px; align-items: center; width: 100%; }
.fp-nick, .fp-msg { background: #ffffff; border: 1px solid #d1d5db; border-radius: 10px; font-size: 14px; height: 48px; padding: 0 15px; }
.fp-nick { flex-basis: 120px; flex-shrink: 0; }
.fp-msg { flex: 1; }
.fp-nick:focus, .fp-msg:focus { border-color: #FF2D55; box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.1); outline: none; }
.fp-send-btn { 
    background: #FF2D55; 
    border-radius: 10px; 
    height: 48px; 
    width: 48px; 
    flex-shrink: 0; 
    transition: background-color 0.2s ease;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fp-send-btn:hover { background: #e0244b; }

#reply-indicator { display: none; background: #f3f4f6; border: 1px solid #e5e7eb; padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; justify-content: space-between; align-items: center; font-size: 13px; }
#cancel-reply { background: none; border: none; font-weight: bold; cursor: pointer; color: #6b7280; }
#cancel-reply:hover { color: #FF2D55; }

/* 6. Mobile Responsive Design */
@media (max-width: 600px) {
    .fp-header-bar { 
        flex-direction: column; 
        gap: 15px; 
        align-items: flex-start; 
    }
    .fp-comments-window { 
        padding: 15px; 
        max-height: 45vh; 
        min-height: 150px; 
    }
    .fp-input-dock { 
        padding: 15px; 
    }
    .fp-chat-bubble.is-reply, .fp-view-replies { 
        margin-left: 15px; 
    }
    .fp-replies-container {
        padding-left: 15px;
    }

    /* --- CORRECTED MOBILE INPUT LAYOUT --- */
    .fp-text-area {
        flex-wrap: wrap; /* Allow items to wrap to the next line */
        gap: 12px;
    }

    .fp-msg {
        order: 1; /* Message field appears first */
        flex-basis: 100%; /* Take the full width */
        height: 44px;
    }
    
    .fp-nick {
        order: 2; /* Name field appears on the second line */
        flex-grow: 1; /* Take up the available space (approx 80%) */
        flex-basis: 0; /* Necessary for flex-grow to work properly */
        height: 44px;
    }
    
    .fp-send-btn {
        order: 2; /* Send button appears on the second line */
        height: 44px;
        width: 44px; /* A fixed width for the button */
        flex-shrink: 0; /* Prevent button from shrinking */
    }
}

/* --- Discussion Section Final Polish --- */

/* Comment ke neeche ki line hatayein */
.fp-footer {
    border-top: none;
}

/* Line ki jagah space ka istemal karein */
.fp-chat-bubble {
    margin-bottom: 15px;
}

/* Admin comment ka design theek karein */
.fp-chat-bubble.is-admin {
    background-color: #f0f7ff; /* Halka blue background */
    border: 1px solid #cce4ff;
    border-left: 3px solid #007bff; /* Blue left border */
}
.fp-chat-bubble.is-admin .fp-author {
    color: #0056b3; /* Dark blue color */
}

/* "View Reply" button ka color theek karein */
.fp-view-replies {
    color: var(--color-brand, #ff3366); /* Theme ka primary color */
}

/* Reply indicator ka red color hatayein */
#reply-indicator {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #333;
}