/* Admin Panel Custom Styles */
body {
    display: block !important;
    padding-top: 65px !important;
    height: auto !important;
    min-height: 100vh;
    background-image: linear-gradient(180deg, #f5f7fa 0%, #cc6699 100%) !important;
}

#main-wrapper {
    margin-top: 20px;
    margin-bottom: 60px;
}

.nav-tabs {
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 10px 10px 0 10px;
    border-radius: 8px 8px 0 0;
    border: 1px solid #dee2e6;
    border-bottom: none;
}

.admin-panel {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Tab Styling */
.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    margin-right: 2px;
    color: #495057;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.nav-tabs .nav-link:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.nav-tabs .nav-link.active:hover {
    background-color: #0056b3;
    color: white;
}

/* Card Enhancements */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Prevent card hover effects inside modals */
.modal .card:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal .card {
    transition: none;
}

/* Lock down modal positioning completely */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
}

.modal.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9998 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
}

.modal-backdrop.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    z-index: 9998 !important;
}



/* Prevent body scroll when modal is open and compensate for scrollbar */
body.modal-open,
body.gp-modal-open {
    overflow: hidden !important;
    padding-right: var(--scrollbar-width, 17px) !important;
}

/* Ensure tab content and scrollable containers don't shift */
body.modal-open .tab-pane,
body.modal-open .modal-dialog,
body.modal-open .table-responsive {
    padding-right: 0 !important;
}

/* Disable transitions and transforms on page when modal is open */
body.modal-open *:not(.modal):not(.modal-backdrop):not(.modal-dialog):not(.modal-content):not(.modal-header):not(.modal-body):not(.modal-footer):not(.close):not(.btn):not([role="dialog"]),
body.gp-modal-open *:not(.gp-modal):not(.gp-backdrop):not(.gp-modal__dialog):not(.gp-modal__content):not(.gp-modal__header):not(.gp-modal__close):not(.gp-close):not([role="dialog"]) {
    transform: none !important;
    transition: none !important;
}

/* Block interactions on page content when modal is open, but preserve modal interactions */
body.modal-open .tab-pane,
body.gp-modal-open .tab-pane {
    pointer-events: none !important;
}

/* Ensure modals and backdrops can still receive clicks */
body.modal-open .modal,
body.modal-open .modal-backdrop,
body.modal-open .modal-dialog,
body.modal-open .modal-content,
body.modal-open .modal-header,
body.modal-open .modal-body,
body.modal-open .modal-footer,
body.modal-open .modal-header .close,
body.modal-open .modal-footer .btn,
body.modal-open .modal-body .close {
    pointer-events: auto !important;
}

/* Ensure shown modals and their children work */
body.modal-open .modal.show,
body.modal-open .modal.show *,
body.modal-open .modal-backdrop.show {
    pointer-events: auto !important;
}

/* Ensure backdrops capture all interactions */
.modal-backdrop.show,
.gp-backdrop {
    pointer-events: all !important;
}

/* Ensure GP modal elements can be clicked */
.gp-modal,
.gp-modal__dialog,
.gp-modal__content,
.gp-modal__header,
.gp-modal__close,
.gp-close {
    pointer-events: auto !important;
}

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content Preview */
.content-preview {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin: 5px 0;
    border-left: 4px solid #007bff;
}

.content-preview.reported {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.content-preview.pending {
    border-left-color: #ffc107;
    background-color: #fffbf0;
}

/* Table Enhancements */
.table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.table tbody tr.table-warning {
    background-color: #fff3cd;
}

.table tbody tr.table-danger {
    background-color: #f8d7da;
}

/* Badge Enhancements */
.badge {
    font-size: 0.7rem;
    padding: 0.4em 0.8em;
    border-radius: 12px;
    font-weight: 500;
}

.badge-admin {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.badge-user {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
}

/* Button Enhancements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Prevent button hover effects inside modals */
.modal .btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

.modal .btn {
    transition: none !important;
}

/* Prevent ANY transforms or transitions inside modals */
.modal,
.modal *,
.modal-dialog,
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* Close button inside modal */
.modal .close {
    cursor: pointer;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    margin: 1px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
}

/* Alert Enhancements */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #e17055, #d63031);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tabs .nav-link {
        margin-right: 0;
        margin-bottom: 2px;
    }
    
    .btn-group-vertical {
        width: 100%;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .stat-card .stat-number {
        font-size: 2rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .table {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .table thead th {
        background-color: #4a5568;
        color: #e2e8f0;
    }
    
    .content-preview {
        background-color: #4a5568;
        color: #e2e8f0;
    }
}



/* Modal Dialog Styling */
.modal {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.modal-dialog {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    margin: auto !important;
    z-index: 9999 !important;
    transform: none !important;
}

.modal-content {
    background-color: white;
    border: none;
    transform: none !important;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
}

.modal-header.bg-light {
    background: #f8f9fa !important;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.modal-header .close {
    color: inherit;
    opacity: 0.7;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.modal-body {
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    border-radius: 0 0 12px 12px;
}

.modal-footer .btn {
    margin-left: 5px;
}

.modal-footer .btn:first-child {
    margin-left: 0;
}

/* Modal Content Styling */
.modal .card {
    border: none;
    background: white;
}

.modal .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.modal .card-body {
    padding: 1rem;
}

.modal .badge {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
}

/* Modal Text Formatting */
.modal h5, .modal h6 {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.modal strong {
    font-weight: 600;
    color: #333;
}

.modal .text-muted {
    color: #6c757d;
}

.modal .bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Form Styling in Modals */
.modal .form-group {
    margin-bottom: 1rem;
}

.modal .form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.modal .form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.modal .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Spinner in Modal */
.modal .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
    color: #007bff;
}

/* Exit/Close Button Styling */
.modal .close {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #666;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
}

.modal .close:hover {
    color: #000;
    opacity: 0.75;
}

/* Dialog box styling for content and moderation sections */
.dialog-content,
.dialog-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.dialog-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #007bff;
}

.dialog-section {
    margin-bottom: 1.5rem;
}

.dialog-section h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
}

.dialog-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.dialog-actions .btn {
    flex: 1;
}

/* Content display in dialogs */
.content-box {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.content-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.content-meta-item {
    display: flex;
    flex-direction: column;
}

.content-meta-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-meta-value {
    color: #333;
    margin-top: 0.25rem;
}

/* Print Styles */
@media print {
    .nav-tabs,
    .btn,
    .modal,
    .alert {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .table {
        font-size: 0.8rem;
    }
}