/**
 * Feedback & Support Chat Agent Styles
 * VERSION: 2025-12-23-v2 (Added conversational guardrails)
 */

/* ============================================
   NAVBAR FEEDBACK BUTTON
   ============================================ */
.navbar-feedback-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.navbar-feedback-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.navbar-feedback-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   FEEDBACK LAYOUT
   ============================================ */
.feedback-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    height: calc(100vh - 200px);
    min-height: 500px;
    max-height: 800px;
}

@media (max-width: 1024px) {
    .feedback-layout {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }

    .feedback-side-panel {
        order: -1;
        max-height: 300px;
    }
}

/* ============================================
   CHAT PANEL
   ============================================ */
.feedback-chat-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.feedback-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.feedback-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-header h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.feedback-header p {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Messages Container */
.feedback-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fafafa;
}

/* Individual Message */
.feedback-message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease-out;
}

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

.feedback-message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.feedback-message.ai {
    align-self: flex-start;
}

.feedback-message.system {
    align-self: center;
    max-width: 100%;
}

/* Avatar */
.feedback-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.feedback-avatar svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Message Bubble */
.feedback-bubble {
    background: white;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.feedback-message.user .feedback-bubble {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.feedback-message.system .feedback-bubble {
    background: #fef3c7;
    border-color: #fcd34d;
    text-align: center;
    font-size: 0.813rem;
}

.feedback-bubble p {
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

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

/* Quick Replies */
.feedback-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.feedback-quick-replies button {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.813rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.feedback-quick-replies button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Quick Action Buttons (type selection) */
.feedback-quick-btn {
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-quick-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

/* ============================================
   CONTACT FORM (in chat bubble)
   ============================================ */
.feedback-contact-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.feedback-form-group {
    margin-bottom: 0.75rem;
}

.feedback-form-group label {
    display: block;
    font-size: 0.813rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.375rem;
}

.feedback-form-group input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.feedback-form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: white;
}

.feedback-form-group input::placeholder {
    color: var(--text-light);
}

.feedback-contact-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.feedback-submit-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-submit-btn:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

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

.feedback-skip-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.813rem;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-skip-btn:hover {
    background: var(--light-color);
    color: var(--text-color);
    border-color: var(--text-light);
}

/* Typing Indicator */
.feedback-typing {
    display: flex;
    gap: 0.75rem;
    align-self: flex-start;
    max-width: 85%;
}

.feedback-typing .feedback-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 1rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ============================================
   INPUT CONTAINER
   ============================================ */
.feedback-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

.feedback-input-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.feedback-input-container input:focus {
    border-color: var(--primary-color);
}

.feedback-input-container input::placeholder {
    color: var(--text-light);
}

.feedback-send-btn {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-send-btn:hover {
    background: #047857;
}

.feedback-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-send-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   SIDE PANEL
   ============================================ */
.feedback-side-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Tabs */
.feedback-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.feedback-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.feedback-tab:hover {
    color: var(--text-color);
}

.feedback-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content */
.feedback-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.feedback-tab-content.active {
    display: block;
}

/* Empty State */
.feedback-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.feedback-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.feedback-empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* ============================================
   ISSUE CARDS
   ============================================ */
.feedback-issues-list,
.feedback-roadmap-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feedback-issue-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
}

.feedback-issue-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feedback-issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.feedback-issue-title {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.feedback-issue-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Type Badges */
.issue-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.issue-type-badge.bug {
    background: #fee2e2;
    color: #dc2626;
}

.issue-type-badge.feature_request {
    background: #dbeafe;
    color: #2563eb;
}

.issue-type-badge.support {
    background: #fef3c7;
    color: #d97706;
}

.issue-type-badge.ux_issue {
    background: #f3e8ff;
    color: #9333ea;
}

/* Status Badges */
.issue-status-badge {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.issue-status-badge.new {
    background: #e0f2fe;
    color: #0284c7;
}

.issue-status-badge.triaged {
    background: #fef3c7;
    color: #d97706;
}

.issue-status-badge.planned {
    background: #e0e7ff;
    color: #4f46e5;
}

.issue-status-badge.in_progress {
    background: #fef3c7;
    color: #d97706;
}

.issue-status-badge.resolved {
    background: #d1fae5;
    color: #059669;
}

/* ============================================
   ROADMAP CARDS
   ============================================ */
.feedback-roadmap-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
}

.feedback-roadmap-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feedback-roadmap-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.feedback-roadmap-title {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.feedback-roadmap-desc {
    margin: 0;
    font-size: 0.813rem;
    color: var(--text-light);
    line-height: 1.4;
}

.feedback-roadmap-eta {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Roadmap Status Badges */
.roadmap-status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.roadmap-status-badge.considering {
    background: #f3f4f6;
    color: #6b7280;
}

.roadmap-status-badge.planned {
    background: #e0e7ff;
    color: #4f46e5;
}

.roadmap-status-badge.in_progress {
    background: #fef3c7;
    color: #d97706;
}

.roadmap-status-badge.beta {
    background: #dbeafe;
    color: #2563eb;
}

.roadmap-status-badge.released {
    background: #dcfce7;
    color: #16a34a;
}

/* Upvote Button */
.upvote-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.813rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
}

.upvote-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.upvote-btn.upvoted {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.upvote-btn svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   VERSION BADGE (for debugging)
   ============================================ */
.feedback-version {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-family: monospace;
    z-index: 9999;
    pointer-events: none;
}
