/* Active Users Modal Styles - Dark Theme Compatible */

/* Bot Selection Modal - Override base modal styles */
#bot-selection-modal .modal {
    background: #1a1d23 !important;
    border: 1px solid #2d3748 !important;
}

#bot-selection-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-bottom: none !important;
    padding: 20px 24px !important;
}

#bot-selection-modal .modal-header h3 {
    color: white !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

#bot-selection-modal .modal-close {
    background: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    color: white !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    padding: 0 !important;
}

#bot-selection-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: rotate(90deg) !important;
}

#bot-selection-modal .modal-body {
    background: #1a1d23 !important;
    color: #e2e8f0 !important;
    padding: 20px !important;
}

/* Bot Search Container */
.bot-search-container {
    position: relative;
    margin-bottom: 20px;
}

.bot-search-container input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 1px solid #374151;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #242832;
    color: #e2e8f0;
}

.bot-search-container input::placeholder {
    color: #6b7280;
}

.bot-search-container input:focus {
    outline: none;
    border-color: #667eea;
    background: #2a2f3a;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.bot-search-container i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

/* Bot List */
.bot-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
    margin: 0 -4px;
}

.bot-list::-webkit-scrollbar {
    width: 8px;
}

.bot-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bot-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.bot-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Bot Item - Modern Card Style */
.bot-item {
    display: flex;
    align-items: center;
    padding: 14px;
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    background: #242832;
    position: relative;
    overflow: hidden;
}

.bot-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bot-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #4b5563;
    background: #2a2f3a;
}

.bot-item:hover::before {
    opacity: 1;
}

.bot-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    transform: scale(1.01);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.bot-item.selected * {
    color: white !important;
}

.bot-item img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    margin-right: 16px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.bot-item.selected img {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.bot-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.bot-name {
    font-weight: 600;
    font-size: 15px;
    color: #e2e8f0;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-email {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 3px;
}

.bot-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
}

.bot-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.bot-status.offline .status-dot {
    background: #6b7280;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.bot-item.selected .bot-status,
.bot-item.selected .bot-email {
    color: rgba(255, 255, 255, 0.9);
}

.bot-item.selected .status-dot {
    background: white;
}

/* Message Modal */
#message-modal .modal {
    background: #1a1d23 !important;
    border: 1px solid #2d3748 !important;
}

#message-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    padding: 20px 24px !important;
    border-bottom: none !important;
}

#message-modal .modal-body {
    background: #1a1d23 !important;
    color: #e2e8f0 !important;
}

.message-compose {
    padding: 20px;
}

.selected-bot-info {
    display: flex;
    align-items: center;
    padding: 14px;
    background: #242832;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #374151;
}

.selected-bot-info img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 16px;
    border: 3px solid white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.bot-details {
    flex: 1;
}

.bot-details .bot-name {
    font-weight: 600;
    font-size: 18px;
    color: #2d3748;
    margin-bottom: 4px;
}

.bot-details .bot-email {
    font-size: 14px;
    color: #6b7280;
}

/* Message Input Section */
.message-input-section {
    margin-bottom: 24px;
}

.message-input-section label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.message-input-wrapper {
    position: relative;
}

.message-input-wrapper textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #374151;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #242832;
    color: #e2e8f0;
}

.message-input-wrapper textarea::placeholder {
    color: #6b7280;
}

.message-input-wrapper textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #2a2f3a;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

#modal-char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #6b7280;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-actions button {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.modal-actions .btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.modal-actions .btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.modal-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.modal-actions .btn-primary:active {
    transform: translateY(0);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.loading-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #667eea;
    animation: spin 1s linear infinite;
}

.loading-state p {
    font-size: 16px;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.empty-state h3 {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

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

/* Responsive */
@media (max-width: 600px) {
    #bot-selection-modal .modal,
    #message-modal .modal {
        width: 95%;
        margin: 20px auto;
    }
    
    .bot-item {
        padding: 10px 12px;
    }
    
    .bot-item img {
        width: 40px;
        height: 40px;
    }
    
    .bot-name {
        font-size: 14px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-actions button {
        width: 100%;
    }
}
