/* AI Admin Operator - Styles by k2.6 */

.ai-admin-body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
    overflow: hidden;
    height: 100vh;
}

.ai-admin-container {
    display: flex;
    height: 100vh;
    direction: rtl;
}

/* Sidebar */
.ai-sidebar {
    width: 260px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.ai-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.ai-brand i {
    font-size: 32px;
    color: #0d6efd;
    display: block;
    margin-bottom: 8px;
}

.ai-mode-badge {
    margin: 10px 20px;
    font-size: 12px;
    padding: 4px 8px;
    text-align: center;
}

.ai-nav {
    padding: 15px 0;
}

.ai-nav a {
    display: block;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.ai-nav a:hover,
.ai-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.05);
    border-right-color: #0d6efd;
}

.ai-nav a i {
    width: 24px;
    margin-left: 8px;
}

.ai-conversations {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex: 1;
    overflow-y: auto;
}

.ai-conversations h6 {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.conv-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.conv-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.conv-item i {
    margin-left: 8px;
    font-size: 12px;
}

.conv-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.conv-item small {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
}

/* Chat Area */
.ai-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f6fa;
    overflow: hidden;
}

.ai-chat-header {
    background: #fff;
    padding: 15px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ai-chat-header h5 {
    margin: 0;
    color: #1a1a2e;
}

.ai-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Messages */
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-message {
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

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

.ai-message-assistant {
    align-self: flex-end;
}

.ai-message-system {
    align-self: center;
    max-width: 90%;
}

.ai-message-content {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.ai-message-admin .ai-message-content {
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-message-assistant .ai-message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ai-message-system .ai-message-content {
    background: #e8f4f8;
    color: #333;
    border: 1px solid #b8e0f0;
}

.ai-message-content p {
    margin: 0 0 8px;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content ul {
    margin: 8px 0;
    padding-right: 20px;
}

.ai-message-content li {
    margin-bottom: 4px;
}

/* Cards in messages */
.ai-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ai-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.ai-card-title {
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 14px;
}

.ai-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ai-card-field {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px dashed #eee;
}

.ai-card-field label {
    color: #888;
}

.ai-card-field span {
    color: #333;
    font-weight: 500;
}

/* Buttons */
.ai-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ai-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-btn-primary {
    background: #0d6efd;
    color: #fff;
}

.ai-btn-primary:hover {
    background: #0b5ed7;
    color: #fff;
}

.ai-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.ai-btn-danger {
    background: #dc3545;
    color: #fff;
}

.ai-btn-danger:hover {
    background: #bb2d3b;
    color: #fff;
}

.ai-btn-success {
    background: #198754;
    color: #fff;
}

/* Input Area */
.ai-input-area {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 15px 25px;
}

.ai-confirm-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
}

.ai-confirm-box label {
    font-weight: 600;
    color: #333;
}

/* Typing indicator */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

/* Scrollbar */
.ai-messages::-webkit-scrollbar,
.ai-sidebar::-webkit-scrollbar {
    width: 6px;
}

.ai-messages::-webkit-scrollbar-track,
.ai-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.ai-messages::-webkit-scrollbar-thumb,
.ai-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-sidebar {
        display: none;
    }
    .ai-message {
        max-width: 90%;
    }
}

/* Pending action styles */
.ai-pending-action {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 14px;
    margin-top: 10px;
}

.ai-pending-action h6 {
    margin: 0 0 8px;
    color: #856404;
}

.ai-pending-action pre {
    background: rgba(0,0,0,0.03);
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    margin: 0;
}
