/* Ask Dashboard Styles v20260113a */
/* Two-column Q&A list and detail view */

/* ========================================
   Ask Detail Panel - Empty State
   ======================================== */

.ask-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
    color: var(--ai-text-secondary);
    padding: 40px;
}

.ask-detail-empty svg {
    color: var(--ai-border);
    margin-bottom: 16px;
}

.ask-detail-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-text-primary);
    margin: 0 0 8px 0;
}

.ask-detail-empty p {
    font-size: 14px;
    color: var(--ai-text-secondary);
    margin: 0;
    max-width: 260px;
}

/* ========================================
   Ask Detail Panel - Content
   ======================================== */

.ask-detail-content {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
}

/* Question Header */
.ask-detail-header {
    margin-bottom: 24px;
}

.ask-detail-question-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ask-detail-q-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--ai-primary);
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ask-detail-question {
    font-size: 18px;
    font-weight: 600;
    color: var(--ai-text-primary);
    margin: 0;
    line-height: 1.4;
}

.ask-detail-meta {
    display: flex;
    gap: 16px;
    padding-left: 40px;
    font-size: 13px;
    color: var(--ai-text-secondary);
}

.ask-detail-time::before {
    content: '';
}

.ask-detail-source::before {
    content: '•';
    margin-right: 16px;
    color: var(--ai-border);
}

/* Answer Section */
.ask-detail-answer-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--ai-card-bg);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
}

.ask-detail-a-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--ai-success);
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ask-detail-answer {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ai-text-primary);
    flex: 1;
}

.ask-detail-answer p {
    margin: 0 0 12px 0;
}

.ask-detail-answer p:last-child {
    margin-bottom: 0;
}

.ask-detail-answer ul,
.ask-detail-answer ol {
    margin: 12px 0;
    padding-left: 20px;
}

.ask-detail-answer li {
    margin-bottom: 6px;
}

.ask-detail-answer a {
    color: var(--ai-primary);
    text-decoration: none;
}

.ask-detail-answer a:hover {
    text-decoration: underline;
}

/* Feedback Section */
.ask-detail-feedback {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--ai-bg-secondary);
    border-radius: 8px;
    margin-bottom: 24px;
}

.ask-detail-feedback-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ai-text-secondary);
}

.ask-detail-feedback-label svg {
    color: var(--ai-text-secondary);
}

.ask-detail-feedback-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--ai-text-primary);
}

.ask-detail-feedback-value.helpful {
    color: var(--ai-success);
}

.ask-detail-feedback-value.not-helpful {
    color: var(--ai-error);
}

.ask-detail-feedback-value.no-feedback {
    color: var(--ai-text-secondary);
    font-style: italic;
}

/* Action Buttons */
.ask-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--ai-border);
}

.ask-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ai-bg-secondary);
    border: 1px solid var(--ai-border);
    border-radius: 6px;
    color: var(--ai-text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ask-action-btn:hover {
    background: var(--ai-card-bg);
    border-color: var(--ai-primary);
    color: var(--ai-primary);
}

.ask-action-btn svg {
    color: inherit;
}

.ask-action-btn.copied {
    background: var(--ai-success);
    border-color: var(--ai-success);
    color: white;
}

/* ========================================
   Question List Item Customization
   ======================================== */

/* Ask-specific list item styles */
.ask-list-question {
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ask-list-preview {
    font-size: 13px;
    color: var(--ai-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ask-list-feedback {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-top: 6px;
}

.ask-list-feedback.helpful {
    color: var(--ai-success);
}

.ask-list-feedback.not-helpful {
    color: var(--ai-error);
}

.ask-list-feedback svg {
    width: 12px;
    height: 12px;
}

/* ========================================
   Mobile Navigation
   ======================================== */

.ask-mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--ai-card-bg);
    border-bottom: 1px solid var(--ai-border);
    padding: 12px 16px;
    z-index: 100;
}

.ask-mobile-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--ai-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.ask-mobile-back:hover {
    background: var(--ai-bg-secondary);
    border-radius: 6px;
}

.ask-mobile-back svg {
    color: var(--ai-primary);
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 768px) {
    /* Show mobile nav when detail is visible */
    .ask-mobile-nav.visible {
        display: block;
    }

    /* Detail panel takes full width on mobile */
    .comms-detail-panel.mobile-active {
        position: fixed;
        top: 116px; /* Header + mobile nav */
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        display: block !important;
        background: var(--ai-card-bg);
    }

    /* Hide list panel when detail is active */
    .comms-list-panel.mobile-hidden {
        display: none;
    }

    /* Adjust detail content padding on mobile */
    .ask-detail-content {
        padding: 16px;
    }

    .ask-detail-question-section {
        gap: 10px;
    }

    .ask-detail-q-badge,
    .ask-detail-a-badge {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .ask-detail-question {
        font-size: 16px;
    }

    .ask-detail-meta {
        padding-left: 34px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ask-detail-source::before {
        display: none;
    }

    .ask-detail-answer-section {
        padding: 16px;
        gap: 10px;
    }

    .ask-detail-answer {
        font-size: 14px;
    }

    .ask-detail-actions {
        justify-content: center;
    }

    .ask-action-btn {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }
}

/* ========================================
   Loading States
   ======================================== */

.ask-detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

.ask-detail-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--ai-border);
    border-top-color: var(--ai-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   Scrollbar Styling
   ======================================== */

.ask-detail-content::-webkit-scrollbar {
    width: 6px;
}

.ask-detail-content::-webkit-scrollbar-track {
    background: transparent;
}

.ask-detail-content::-webkit-scrollbar-thumb {
    background: var(--ai-border);
    border-radius: 3px;
}

.ask-detail-content::-webkit-scrollbar-thumb:hover {
    background: var(--ai-text-secondary);
}

/* ========================================
   Talk Conversations - List Items
   ======================================== */

.talk-list-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--ai-text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.talk-list-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ai-text-secondary);
}

.talk-message-count {
    color: var(--ai-text-secondary);
}

.talk-list-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.talk-list-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ai-success);
}

.talk-list-status.active .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-success);
}

.talk-list-status.resolved {
    background: rgba(107, 114, 128, 0.1);
    color: var(--ai-text-secondary);
}

.talk-list-status.resolved svg {
    width: 12px;
    height: 12px;
}

/* ========================================
   Talk Conversations - Messages Thread
   ======================================== */

.talk-messages-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.talk-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
}

.talk-message.visitor {
    background: var(--ai-bg-secondary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.talk-message.ai {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.talk-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.talk-message-sender {
    font-weight: 600;
    color: var(--ai-text-primary);
}

.talk-message.visitor .talk-message-sender {
    color: var(--ai-text-secondary);
}

.talk-message.ai .talk-message-sender {
    color: var(--ai-primary);
}

.talk-message-time {
    color: var(--ai-text-secondary);
}

.talk-message-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ai-text-primary);
}

.talk-no-messages {
    text-align: center;
    color: var(--ai-text-secondary);
    font-style: italic;
    padding: 24px;
}

/* ========================================
   Talk Conversations - Mobile
   ======================================== */

@media (max-width: 768px) {
    .talk-message {
        max-width: 90%;
        padding: 10px 14px;
    }

    .talk-message-content {
        font-size: 13px;
    }
}
