/* Active Users Management Styles */

/* User Statistics */
.user-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    border-radius: 12px;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* User Filters */
.user-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 10px 16px;
    border: 2px solid #ddd;
    background: #f8f9fa;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    border-color: #667eea;
    background: #f0f2ff;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.search-box {
    position: relative;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Users Table */
.users-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.users-table tr:last-child td {
    border-bottom: none;
}

/* User Avatar in Table */
.user-avatar-small {
    position: relative;
    display: inline-block;
}

.user-avatar-small img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f1f3f4;
}

.premium-badge-small {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8b6914;
    padding: 2px 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(255, 215, 0, 0.4);
}

/* User Info Columns */
.user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.user-email-cell {
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
}

.user-age, .user-city {
    color: #7f8c8d;
    font-size: 13px;
}

.user-last-active {
    color: #95a5a6;
    font-size: 12px;
}

/* Action Buttons in Table */
.table-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.btn-like {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5722 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-like:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.btn-action:active {
    transform: translateY(0);
}

/* Modal Styles */
.bot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.bot-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border: 2px solid #f1f3f4;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-height: 55px;
}

.bot-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.bot-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bot-item img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 14px;
    border: 2px solid #f1f3f4;
}

.bot-item.selected img {
    border-color: white;
}

.bot-info {
    flex: 1;
    margin-left: 4px;
}

.bot-name {
    font-weight: 600;
    font-size: 15px;
    margin: 0;
}

/* Message Compose Modal */
.message-compose {
    max-width: 500px;
}

.selected-bot-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.selected-bot-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.selected-bot-info .bot-details .bot-name {
    font-weight: 600;
    color: #2c3e50;
}

.selected-bot-info .bot-details .bot-email {
    font-size: 12px;
    color: #7f8c8d;
}

.message-input-section {
    margin-bottom: 20px;
}

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

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

.message-input-section textarea {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

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

.message-input-section #modal-char-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    color: #888;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
}

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

/* Dark Theme Support */
body.dark-theme .users-table {
    background: #2d2d2d;
}

body.dark-theme .users-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-theme .users-table td {
    border-bottom-color: #444;
    color: #e0e0e0;
}

body.dark-theme .users-table tr:hover {
    background: #3a3a3a;
}

body.dark-theme .user-name {
    color: #ffffff;
}

body.dark-theme .user-email-cell {
    color: #8fb8ff;
}

body.dark-theme .user-age, 
body.dark-theme .user-city {
    color: #b0b0b0;
}

body.dark-theme .user-last-active {
    color: #888;
}

body.dark-theme .filter-btn {
    background: #4a4a4a;
    border-color: #666;
    color: #e0e0e0;
}

body.dark-theme .filter-btn:hover {
    background: #5a5a5a;
    border-color: #667eea;
    color: #8fb8ff;
}

body.dark-theme .filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

body.dark-theme .search-box input {
    background: #4a4a4a;
    border-color: #666;
    color: #e0e0e0;
}

body.dark-theme .search-box input::placeholder {
    color: #999;
}

body.dark-theme .search-box input:focus {
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .user-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .search-box {
        min-width: unset;
    }
    
    .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .user-card {
        padding: 16px;
    }
    
    .user-avatar img {
        width: 60px;
        height: 60px;
    }
    
    .user-actions {
        flex-direction: column;
    }
    
    .btn-action {
        flex: none;
    }
}

@media (max-width: 480px) {
    .user-stats {
        justify-content: center;
    }
    
    .stat-item {
        min-width: 120px;
        padding: 16px 20px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

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

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

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #555;
}

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

/* Toast Notification Styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal Styles - Bottom Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #95a5a6;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 24px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* Bot Search */
.bot-search-container {
    position: relative;
    margin: 16px 0;
}

.bot-search-container input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #f1f3f4;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

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

/* Bot List Styles */
.bot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.bot-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border: 2px solid #f1f3f4;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-height: 55px;
}

.bot-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.bot-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bot-item img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 14px;
    border: 2px solid #f1f3f4;
}

.bot-item.selected img {
    border-color: white;
}

.bot-info {
    flex: 1;
    margin-left: 4px;
}

.bot-name {
    font-weight: 600;
    font-size: 15px;
    margin: 0;
}

/* Dark Theme for Modals */
body.dark-theme .modal {
    background: #2d2d2d;
}

body.dark-theme .modal-header {
    background: #3a3a3a;
    border-bottom-color: #555;
}

body.dark-theme .modal-header h3 {
    color: #e0e0e0;
}

body.dark-theme .bot-item {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .bot-item:hover {
    background: #404040;
    border-color: #667eea;
}

body.dark-theme .bot-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-theme .bot-search-container input {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .bot-search-container input::placeholder {
    color: #999;
}

body.dark-theme .bot-search-container input:focus {
    border-color: #667eea;
}

body.dark-theme .bot-bio {
    color: #aaa;
}

/* Dark theme support for bot items */
[data-theme="dark"] .bot-item {
    background: #2d3748;
    border-color: #4a5568;
    color: white;
}

[data-theme="dark"] .bot-item:hover {
    border-color: #667eea;
    background: #2d3748;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

[data-theme="dark"] .bot-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

[data-theme="dark"] .bot-item img {
    border-color: #4a5568;
}

[data-theme="dark"] .bot-item.selected img {
    border-color: white;
}

[data-theme="dark"] .bot-name {
    color: inherit;
} 