/* Admin Dashboard CSS for Pal AI */

/* Admin View */
.admin-view {
    display: none;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 10;
}

.dark .admin-view {
    background: #0a0a0a;
}

.admin-view.active {
    display: block;
}

.chat-view-hidden {
    display: none !important;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
}

.dark .admin-header {
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 1px solid #374151;
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.admin-header p {
    margin: 4px 0 0 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

.admin-time-status {
    text-align: right;
    flex-shrink: 0;
}

.admin-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.admin-status {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Stats Cards */
.stats-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dark .stats-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: white;
}

.stats-card-secondary {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.dark .stats-card-secondary {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.stats-card-tertiary {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.dark .stats-card-tertiary {
    background: linear-gradient(135deg, #451a03, #92400e);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Users Section */
.users-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dark .users-section {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.users-header {
    padding: 24px;
    border-b: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.dark .users-header {
    border-b-color: #2a2a2a;
}

.users-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.users-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.users-count {
    font-size: 0.875rem;
    opacity: 0.7;
}

.users-list {
    padding: 24px;
}

/* User Cards */
.user-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.user-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .user-card {
    background: #111111;
    border-color: #2a2a2a;
}

.user-card:last-child {
    margin-bottom: 0;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.user-details h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.user-details p {
    font-size: 0.875rem;
    opacity: 0.7;
    margin: 0;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view {
    background: #3b82f6;
    color: white;
}

.btn-view:hover {
    background: #2563eb;
}

/* Message Preview */
.message-preview {
    max-height: 300px;
    overflow-y: auto;
}

/* Admin Dashboard Responsive */
@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .admin-header {
        padding: 16px;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .admin-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .admin-time-status {
        text-align: left;
        width: 100%;
    }
    
    .user-card {
        padding: 16px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .user-actions {
        justify-content: flex-end;
    }
    
    .users-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .users-controls {
        justify-content: space-between;
    }
}

/* Admin Charts */
.admin-chart {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.dark .admin-chart {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Admin Filters */
.admin-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.dark .filter-label {
    color: #d1d5db;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
}

.dark .filter-select {
    border-color: #4b5563;
    background: #1f2937;
    color: white;
}

/* Admin Search */
.admin-search {
    position: relative;
    max-width: 300px;
}

.admin-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
}

.dark .admin-search input {
    border-color: #4b5563;
    background: #1f2937;
    color: white;
}

.admin-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

/* Admin Pagination */
.admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .pagination-btn {
    border-color: #4b5563;
    background: #1f2937;
    color: white;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.dark .pagination-btn:hover:not(:disabled) {
    background: #374151;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Admin Export */
.admin-export {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.export-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.dark .export-btn {
    border-color: #4b5563;
    background: #1f2937;
    color: white;
}

.export-btn:hover {
    background: #f3f4f6;
}

.dark .export-btn:hover {
    background: #374151;
}

/* Admin Notifications */
.admin-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.dark .admin-notification {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-warning {
    border-left: 4px solid #f59e0b;
}

.notification-info {
    border-left: 4px solid #3b82f6;
}

/* RTL Support for Admin */
[dir="rtl"] .admin-time-status {
    text-align: left;
}

[dir="rtl"] .admin-search input {
    padding: 8px 36px 8px 12px;
}

[dir="rtl"] .admin-search i {
    left: auto;
    right: 12px;
}

[dir="rtl"] .admin-notification {
    right: auto;
    left: 20px;
}

[dir="rtl"] .admin-notification {
    animation: slideInRTL 0.3s ease;
}

@keyframes slideInRTL {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
} 