/* ==========================================================================
   ✨ LINKGPT PIXEL-PERFECT LAYOUT & COMPONENT FIXES
   ========================================================================== */
.compact-feedback-popup {
    position: fixed;
    bottom: 32px;
    left: 285px; /* Sidebar offset */
    width: 360px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    border: 1px solid #e4e4e7;
    z-index: 999999;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.feedback-title {
    font-size: 15px;
    font-weight: 600;
    color: #18181b;
    margin: 0 0 2px 0;
}

.feedback-subtitle {
    font-size: 12px;
    color: #71717a;
    margin: 0;
}

.feedback-close-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: bold;
    color: #a1a1aa;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
}

.feedback-close-btn:hover {
    color: #18181b;
}

.feedback-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.feedback-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: #18181b;
}

.optional-text {
    font-weight: 400;
    color: #a1a1aa;
}

/* Emoji Row */
.rating-emoji-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emoji-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 2px;
    width: 60px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.emoji-btn .emoji {
    font-size: 26px;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emoji-btn .emoji-label {
    font-size: 10px;
    color: #71717a;
    font-weight: 400;
}

.emoji-btn:hover .emoji {
    transform: scale(1.15);
}

/* Functional Component Active States */
.emoji-btn.active {
    background: #f4f4f5;
}

.emoji-btn.active .emoji {
    transform: scale(1.2);
}

.emoji-btn.active .emoji-label {
    color: #18181b;
    font-weight: 600;
}

/* Tags Layout */
.feedback-tags-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fb-tag-btn {
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 11px;
    color: #52525b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fb-tag-btn:hover {
    background: #e4e4e7;
}

.fb-tag-btn.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

/* Text Area Container */
.textarea-wrapper {
    position: relative;
}

#feedback-text {
    width: 100%;
    height: 85px;
    padding: 12px;
    padding-bottom: 24px;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    resize: none;
    color: #18181b;
    box-sizing: border-box;
}

#feedback-text:focus {
    outline: none;
    border-color: #4f46e5;
}

.char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 10px;
    color: #a1a1aa;
}

/* Footer Submit Button */
.feedback-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-submit-btn {
    width: 100%;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.feedback-submit-btn:hover {
    background: #4338ca;
}

.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.privacy-note {
    font-size: 11px;
    color: #71717a;
    text-align: center;
    margin: 0;
}

/* ==========================================================================
   🔥 EXACT 2ND IMAGE MATCH: CLASS-MAPPED PREMIUM DARK THEME CONFIG
   ========================================================================== */
body.dark-theme .compact-feedback-popup {
    background: #16161e !important; /* Exact deep rich dark background matching LinkGPT dashboard */
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important; /* Ultra thin crisp dark border */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .feedback-title {
    color: #ffffff !important;
}

body.dark-theme .feedback-subtitle {
    color: #9ca3af !important; /* Premium muted grey */
}

body.dark-theme .feedback-close-btn {
    color: #6b7280 !important;
}

body.dark-theme .feedback-close-btn:hover {
    color: #ffffff !important;
}

body.dark-theme .section-title {
    color: #ffffff !important;
}

body.dark-theme .optional-text {
    color: #6b7280 !important;
}

/* --- Emoji Alignment inside Dark Mode --- */
body.dark-theme .emoji-btn .emoji-label {
    color: #9ca3af !important;
}

body.dark-theme .emoji-btn:hover, 
body.dark-theme .emoji-btn.active {
    background: #23232f !important; /* Premium subtle selection tile background */
    border-radius: 8px !important;
}

body.dark-theme .emoji-btn.active .emoji-label {
    color: #ffffff !important;
}

/* --- Tags Layout Fixed --- */
body.dark-theme .fb-tag-btn {
    background: #1c1c24 !important; /* Dark chip capsule */
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #9ca3af !important;
}

body.dark-theme .fb-tag-btn:hover {
    background: #23232f !important;
    color: #ffffff !important;
}

body.dark-theme .fb-tag-btn.active {
    background: #4f46e5 !important; /* Active glowing state */
    border-color: #4f46e5 !important;
    color: #ffffff !important;
}

/* --- Textarea Custom Fit --- */
body.dark-theme #feedback-text {
    background: #111116 !important; /* Inside deep dark layout inset */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

body.dark-theme #feedback-text:focus {
    border-color: #4f46e5 !important;
}

body.dark-theme #feedback-text::placeholder {
    color: #4b5563 !important;
}

body.dark-theme .char-count {
    color: #4b5563 !important;
}

/* --- Primary Call to Action Actionable State --- */
body.dark-theme .feedback-submit-btn {
    background: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2) !important;
}

body.dark-theme .feedback-submit-btn:hover {
    background: #4338ca !important;
}

body.dark-theme .feedback-submit-btn:disabled {
    background: #23232f !important;
    color: #4b5563 !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
    opacity: 1 !important;
}

body.dark-theme .privacy-note {
    color: #6b7280 !important;
}

/* Mobile View */
@media (max-width: 768px) {
    .compact-feedback-popup {
        width: calc(100% - 32px);
        left: 16px;
        bottom: 16px;
    }
}