/* Chat Panel Styles */
.chat-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    max-height: 70vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ffc107;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

.chat-header {
    background: linear-gradient(135deg, #ffc107, #ff8f00);
    color: #1a1a2e;
    padding: 12px 16px;
    border-radius: 13px 13px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #1a1a2e;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.chat-close-btn:hover {
    background-color: rgba(26, 26, 46, 0.1);
}

.chat-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-info {
    margin-bottom: 12px;
}

.info-section {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.info-section h6 {
    color: #007bff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.info-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
}

.chat-examples {
    margin-bottom: 8px;
}

.example-questions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.example-btn {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.example-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.chat-input:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-send-btn {
    background: linear-gradient(135deg, #ffc107, #ff8f00);
    border: none;
    color: #1a1a2e;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-end;
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-response {
    margin-top: 8px;
}

.ai-answer {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
}

.related-title {
    color: #ffc107;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.related-doc {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
}

.doc-title {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.3;
}

.doc-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.chat-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: #ffc107;
    font-size: 14px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-top: 2px solid #ffc107;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-panel {
        width: 350px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 30px);
        right: 15px;
        left: 15px;
        max-height: 60vh;
    }
}