/* assets/admin.css */

.aichat-admin-wrap {
    margin: 20px 20px 0 0;
}

.aichat-admin-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

/* Settings Form */
.aichat-settings-form {
    max-width: 100%;
}

.aichat-settings-section {
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.aichat-settings-section:last-child {
    border-bottom: none;
}

.aichat-settings-section h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.aichat-form-group {
    margin-bottom: 20px;
}

.aichat-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.aichat-form-group input[type="text"],
.aichat-form-group input[type="password"],
.aichat-form-group input[type="email"],
.aichat-form-group select,
.aichat-form-group textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.aichat-form-group textarea {
    resize: vertical;
}

.aichat-form-group input[type="color"] {
    width: 80px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.aichat-form-group input[type="checkbox"] {
    margin-right: 8px;
}

.aichat-form-group .description {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #666;
}

.aichat-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Live Chat Dashboard */
.aichat-live-chat-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.aichat-conversations-sidebar {
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.aichat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aichat-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
}

.aichat-conversations-list {
    flex: 1;
    overflow-y: auto;
}

.aichat-conversation-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    gap: 12px;
    transition: background 0.2s;
}

.aichat-conversation-item:hover {
    background: #f8f9fa;
}

.aichat-conversation-item.active {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.aichat-conv-avatar {
    width: 40px;
    height: 40px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aichat-conv-avatar .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.aichat-conv-info {
    flex: 1;
    min-width: 0;
}

.aichat-conv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.aichat-conv-email {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aichat-conv-time {
    font-size: 12px;
    color: #999;
}

.aichat-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.aichat-badge.pending {
    background: #fff3cd;
    color: #856404;
}

/* Chat Area */
.aichat-chat-area {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.aichat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.aichat-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.aichat-empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #666;
}

.aichat-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aichat-visitor-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.aichat-visitor-avatar {
    width: 48px;
    height: 48px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aichat-visitor-avatar .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.aichat-visitor-info h3 {
    margin: 0;
    font-size: 16px;
}

.aichat-visitor-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #666;
}

.aichat-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.aichat-chat-message {
    margin-bottom: 20px;
    max-width: 70%;
}

.aichat-chat-message.user {
    margin-left: auto;
}

.aichat-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.aichat-message-header strong {
    color: #333;
}

.aichat-message-header span {
    color: #999;
}

.aichat-message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.aichat-chat-message.user .aichat-message-text {
    background: #2196f3;
    color: white;
}

.aichat-chat-input {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
}

.aichat-chat-input textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.aichat-chat-input textarea:focus {
    outline: none;
    border-color: #2196f3;
}

.aichat-chat-input .button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
}

/* Loading */
.aichat-loading {
    padding: 40px;
    text-align: center;
    color: #999;
}

/* Dashboard Stats */
.aichat-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.aichat-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aichat-stat-card h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.aichat-stat-card .stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

/* Responsive */
@media (max-width: 1200px) {
    .aichat-live-chat-container {
        flex-direction: column;
        height: auto;
    }
    
    .aichat-conversations-sidebar {
        width: 100%;
        height: 300px;
    }
    
    .aichat-chat-area {
        height: 500px;
    }
}