/**
 * ================================================================================
 * Admin Panel Styles
 * ================================================================================
 * 
 * Common styles for all admin pages (dashboard, users, posts, circles, comments, reports)
 * This file replaces inline CSS across all admin PHP files.
 * 
 * @version     1.0.0
 * 
 * ================================================================================
 */

/* =============================================================================
   Reset & Base
   ============================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

/* =============================================================================
   Header
   ============================================================================= */
.admin-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #3b82f6;
    font-weight: 600;
}

.admin-header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-header-nav a {
    color: #64748b;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.admin-header-nav a:hover {
    color: #3b82f6;
    background: #f1f5f9;
}

/* Legacy header class support */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    color: #3b82f6;
}

.header a {
    color: #64748b;
    text-decoration: none;
    margin-left: 1rem;
}

.header a:hover {
    color: #3b82f6;
}

/* =============================================================================
   Container & Layout
   ============================================================================= */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-content {
    padding: 2rem;
}

/* =============================================================================
   Stats Grid
   ============================================================================= */
.stats-grid,
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: #1e293b;
}

/* =============================================================================
   Sections
   ============================================================================= */
.section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

/* =============================================================================
   Quick Actions Grid
   ============================================================================= */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.quick-actions .btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* =============================================================================
   Filters
   ============================================================================= */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filters label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.filters select,
.filters input[type="text"],
.filters input[type="search"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* =============================================================================
   Tables
   ============================================================================= */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.875rem;
    background: #f8fafc;
}

tbody tr:hover {
    background: #f8fafc;
}

/* =============================================================================
   Buttons
   ============================================================================= */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-buttons .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* =============================================================================
   Badges
   ============================================================================= */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-moderator {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-user {
    background: #dbeafe;
    color: #1e40af;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-suspended {
    background: #fee2e2;
    color: #991b1b;
}

.badge-banned {
    background: #1f2937;
    color: #f3f4f6;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-resolved {
    background: #d1fae5;
    color: #065f46;
}

.badge-dismissed {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-spam {
    background: #fee2e2;
    color: #991b1b;
}

.badge-harassment {
    background: #fce7f3;
    color: #9d174d;
}

.badge-other {
    background: #e5e7eb;
    color: #374151;
}

/* =============================================================================
   Modals
   ============================================================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.modal-content textarea,
.modal-content input[type="text"],
.modal-content select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.modal-content textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}
 button.modal-close {
    display: none;
 }

/* =============================================================================
   Loading States
   ============================================================================= */
.loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

/* =============================================================================
   Alerts & Notifications
   ============================================================================= */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* =============================================================================
   Empty States
   ============================================================================= */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state img {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #1e293b;
}

/* =============================================================================
   Pagination
   ============================================================================= */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.pagination button,
.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #64748b;
    text-decoration: none;
}

.pagination button:hover,
.pagination a:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.pagination button.active,
.pagination a.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: #64748b;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.pagination-controls {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* =============================================================================
   Bulk Actions
   ============================================================================= */
.bulk-actions {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    align-items: center;
    gap: 1rem;
}

.bulk-actions.active {
    display: flex;
}

.bulk-actions span {
    font-weight: 500;
    color: #64748b;
}

/* =============================================================================
   Checkbox Styles
   ============================================================================= */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* =============================================================================
   Tabs (for reports and other pages)
   ============================================================================= */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 0.875rem;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: #3b82f6;
}

.tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 500;
}

/* =============================================================================
   Report-specific Styles
   ============================================================================= */
.report-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.report-content {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.report-meta {
    font-size: 0.875rem;
    color: #64748b;
}

/* =============================================================================
   Responsive Design
   ============================================================================= */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid,
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .stats {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Custom Confirm Modal */
.admin-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s ease-out;
}

.admin-confirm-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    animation: slideUp 0.2s ease-out;
}

.admin-confirm-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.admin-confirm-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.admin-confirm-body {
    padding: 1.5rem;
}

.admin-confirm-body p {
    margin: 0;
    color: #475569;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.admin-confirm-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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