/* resources/js/components/ChatInterface.css */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
}

.chat-header {
    padding: 32px 24px 24px;
    text-align: center;
    border-bottom: 1px solid #e1e5e9;
    position: relative;
}

.chat-header h2 {
    font-size: 32px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.chat-header p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

.clear-button {
    position: absolute;
    top: 32px;
    right: 24px;
    background: none;
    border: 1px solid #e1e5e9;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 32px 0;
}

.last-update {
    font-size: 14px !important;
    color: #94a3b8 !important;
    margin: 8px 0 24px 0 !important;
    font-style: italic;
}

.example-questions {
    max-width: 400px;
}

.example-questions h4 {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.example-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.example-button {
    background: #f8fafc;
    border: 1px solid #e1e5e9;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.example-button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.messages-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
}

.message.user .message-content {
    background: #0f172a;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 4px;
    white-space: pre-wrap;
}

.message-time {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}

.message.user .message-time {
    text-align: right;
}

/* Message Footer */
.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.message.user .message-footer {
    justify-content: flex-end;
}

/* Feedback Styles */
.message-feedback {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.feedback-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.positive-feedback-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.feedback-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.feedback-btn.positive-comment {
    font-size: 12px;
    padding: 2px 4px;
    opacity: 0.5;
}

.feedback-btn:hover {
    opacity: 1;
    background: #f1f5f9;
}

.feedback-btn.positive:hover {
    background: #ecfdf5;
}

.feedback-btn.positive-comment:hover {
    background: #ecfdf5;
    opacity: 0.8;
}

.feedback-btn.negative:hover {
    background: #fef2f2;
}

.feedback-submitted {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
    display: flex;
}

.feedback-thanks {
    display: flex;
    align-items: center;
    gap: 4px;
}

.add-comment-btn:hover {
    opacity: 1 !important;
    background: #ecfdf5 !important;
}

/* Feedback Modal */
.feedback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.feedback-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.feedback-modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #64748b;
}

.feedback-modal-content {
    padding: 24px;
}

.feedback-modal-content p {
    margin: 0 0 16px 0;
    color: #64748b;
    line-height: 1.6;
}

.feedback-textarea {
    width: 100%;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.feedback-modal-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.sources {
    margin-top: 12px;
    border-top: 1px solid #e1e5e9;
    padding-top: 12px;
}

.sources summary {
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
}

.sources-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
}

.source-content {
    color: #374151;
    line-height: 1.4;
}

.source-meta {
    color: #94a3b8;
    margin-top: 4px;
    font-weight: 500;
}

.loading {
    opacity: 0.7;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%,
    80%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 24px;
    border-top: 1px solid #e1e5e9;
    background: #fff;
}

.chat-form {
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 4px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.chat-input {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 16px;
    font-size: 16px;
    color: #0f172a;
    outline: none;
    min-height: 24px;
    resize: none;
}

.chat-input::placeholder {
    color: #94a3b8;
}

.send-button {
    background: #0f172a;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-button:hover:not(:disabled) {
    background: #334155;
}

.send-button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner.large {
    width: 32px;
    height: 32px;
    border-width: 3px;
    margin: 16px auto;
}

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

@media (max-width: 768px) {
    .chat-interface {
        height: calc(100vh - 64px);
    }

    .chat-header {
        padding: 24px 16px 16px;
    }

    .chat-header h2 {
        font-size: 24px;
    }

    .messages-container {
        padding: 16px;
        gap: 16px;
    }

    .message {
        max-width: 85%;
    }

    .chat-input-container {
        padding: 16px;
    }

    .clear-button {
        position: static;
        margin-top: 16px;
    }
}
