/*
 * Cast Conductor Proprietary License v5
 * SPDX-License-Identifier: LicenseRef-CastConductor-Proprietary-v5
 * 
 * Copyright (c) 2025 CastConductor.com. All Rights Reserved.
 * 
 * This file is part of Cast Conductor ("Software"). The Software and its source
 * code constitute proprietary, confidential, and trade secret information of
 * CastConductor.com ("Company"). Any access or use is governed strictly by the
 * Cast Conductor Proprietary License v5 ("License"). By installing, copying,
 * accessing, compiling, or otherwise using the Software you agree to be bound by
 * all terms of the License. If you do not agree, you must cease use immediately.
 * 
 * Key Terms (Summary – see full License for binding terms):
 *  1. No Redistribution: You may not publish, distribute, sublicense, rent,
 *     lease, transfer, sell, or otherwise make the Software (or any derivative)
 *     available to any third party without prior written consent of Company.
 *  2. No Modification: Modification, reverse engineering, decompilation, or
 *     disassembly is prohibited except to the limited extent expressly permitted
 *     by applicable law that cannot be contractually waived.
 *  3. Confidentiality: Treat all source code and related artifacts as Company
 *     Confidential Information. Maintain at least the same degree of care as for
 *     your own confidential materials, and not less than reasonable care.
 *  4. No Patent License: No express or implied patent rights are granted. Future
 *     patents (if any) are fully reserved.
 *  5. No Trademark License: Company names, marks, and logos may not be used
 *     without prior written permission.
 *  6. Limited Internal Use: Use is limited solely to internal evaluation and
 *     operation of licensed Cast Conductor deployments. Commercial hosting or
 *     resale as a service requires a separate written agreement.
 *  7. Telemetry & License Validation: The Software may periodically transmit a
 *     hashed installation identifier, domain (or site ID), plugin/app version,
 *     and a truncated (non-reversible) fragment of the license key solely to
 *     validate activation status and enforce licensing. This minimal "phone home"
 *     check contains no personal or content data. If optional telemetry is later
 *     introduced it will be limited to aggregate operational metrics (no PII),
 *     fully documented, and optionally disableable per published instructions.
 *  8. Third-Party Components: The Software may include open source components
 *     covered by their own licenses. See THIRD-PARTY-NOTICES.md. Those licenses
 *     govern their respective components; this License governs all remaining code.
 *  9. Export Compliance: You are responsible for compliance with all applicable
 *     export control and sanctions laws.
 * 10. Warranty Disclaimer: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF
 *     ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO MERCHANTABILITY,
 *     FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
 * 11. Limitation of Liability: IN NO EVENT WILL COMPANY OR AUTHORS BE LIABLE FOR
 *     ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE
 *     DAMAGES, OR LOST PROFITS, EVEN IF ADVISED OF THE POSSIBILITY.
 * 12. Acceptance: Use of the Software constitutes acceptance of the License.
 * 13. Enforcement: Unauthorized reproduction or distribution may result in civil
 *     and criminal penalties and will be prosecuted to the maximum extent allowed
 *     by law.
 * 
 * Authoritative EULA: EULA-v5.1.md (repository root – private) and https://castconductor.com/eula
 * Precedence: If this summary conflicts with the EULA, the EULA governs.
 * Revision: Current EULA revision v5.1 (subject to update; check EULA for current enterprise thresholds).
 * 
 * Full License text available from: licensing@castconductor.com
 * Security reports: security@castconductor.com
 * Commercial inquiries: licensing@castconductor.com
 * 
 * END OF HEADER
 */
/* ==========================================================================
   Main Container
   ========================================================================== */

.shoutout-moderation-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.shoutout-moderation-page .wrap {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.shoutout-moderation-page h1 {
    margin: 0;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    border-bottom: none;
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */

.moderation-nav-tabs {
    display: flex;
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
    margin: 0;
    padding: 0;
}

.moderation-nav-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.moderation-nav-tab:hover {
    background: #e9e9e9;
    color: #333;
}

.moderation-nav-tab.active {
    background: #fff;
    color: #333;
    border-bottom-color: #667eea;
}

/* ==========================================================================
   Tab Content
   ========================================================================== */

.moderation-tab-content {
    padding: 30px;
    min-height: 500px;
}

.moderation-tab-pane {
    display: none;
}

.moderation-tab-pane.active {
    display: block;
}

/* ==========================================================================
   Statistics Dashboard
   ========================================================================== */

.moderation-stats {
    margin-bottom: 30px;
}

.stats-section {
    margin-bottom: 20px;
}

.stats-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    transition: box-shadow 0.3s ease;
}

.stat-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 500;
}

.stat-item.pending .stat-number {
    color: #f39c12;
}

.stat-item.approved .stat-number {
    color: #27ae60;
}

.stat-item.rejected .stat-number {
    color: #e74c3c;
}

.stat-item.total .stat-number {
    color: #3498db;
}

/* ==========================================================================
   Pending Shoutouts List
   ========================================================================== */

.moderation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bulk-actions select {
    min-width: 150px;
}

.bulk-actions .selected-count {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-refresh-control label {
    font-size: 12px;
    color: #666;
}

.pending-shoutouts-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.no-shoutouts {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-shoutouts .dashicons {
    font-size: 48px;
    color: #27ae60;
    margin-bottom: 15px;
}

.no-shoutouts h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.no-shoutouts p {
    margin: 0;
    font-size: 14px;
}

/* ==========================================================================
   Shoutout Items
   ========================================================================== */

.shoutout-item {
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.shoutout-item:last-child {
    border-bottom: none;
}

.shoutout-item:hover {
    background: #fafafa;
}

.shoutout-item.risk-high {
    border-left: 4px solid #e74c3c;
}

.shoutout-item.risk-medium {
    border-left: 4px solid #f39c12;
}

.shoutout-item.risk-low {
    border-left: 4px solid #27ae60;
}

.shoutout-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
}

.shoutout-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.shoutout-checkbox {
    margin: 0 !important;
}

.shoutout-meta {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.shoutout-id {
    font-family: monospace;
    font-weight: bold;
    color: #666;
}

.shoutout-date {
    font-size: 12px;
    color: #999;
}

.risk-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.risk-badge.risk-low {
    background: #d5e8d4;
    color: #2e7d32;
}

.risk-badge.risk-medium {
    background: #fff3cd;
    color: #856404;
}

.risk-badge.risk-high {
    background: #f8d7da;
    color: #721c24;
}

.shoutout-actions {
    display: flex;
    gap: 10px;
}

.shoutout-actions .button {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 6px 12px;
    height: auto;
}

.shoutout-content {
    padding: 0 20px 20px 60px;
    border-top: 1px solid #f0f0f0;
    margin-top: 0;
}

.shoutout-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-group label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin: 0;
}

.shoutout-name,
.shoutout-location {
    font-weight: 500;
    color: #333;
}

.shoutout-message {
    margin-bottom: 15px;
}

.shoutout-message label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin: 0 0 8px 0;
}

.message-text {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
}

.moderation-flags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flag {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

.flag-none {
    color: #28a745;
    background: #d4edda;
    border-color: #c3e6cb;
}

.flag-word_filter {
    color: #dc3545;
    background: #f8d7da;
    border-color: #f5c6cb;
}

.flag-duplicate_content {
    color: #fd7e14;
    background: #fff3cd;
    border-color: #ffeaa7;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.moderation-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
}

.tablenav-pages {
    display: flex;
    align-items: center;
    gap: 10px;
}

.displaying-num {
    font-size: 12px;
    color: #666;
    margin-right: 15px;
}

.moderation-page-btn {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.moderation-page-btn.current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ==========================================================================
   Settings Form
   ========================================================================== */

.moderation-settings-form {
    max-width: 600px;
}

.setting-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.setting-group h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.setting-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-control {
    flex: 1;
}

.setting-control label {
    display: block;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

.setting-control input[type="text"],
.setting-control input[type="email"],
.setting-control input[type="number"],
.setting-control textarea {
    width: 100%;
    max-width: 400px;
}

.setting-control input[type="checkbox"] {
    margin-right: 8px;
}

.setting-description {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

.setting-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.setting-checkbox-label input[type="checkbox"] {
    margin: 3px 0 0 0;
}

.recaptcha-test {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.recaptcha-test .button {
    font-size: 12px;
    padding: 4px 10px;
    height: auto;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.moderation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.moderation-modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
}

.modal-body input,
.modal-body textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.modal-body textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.moderation-notifications {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 100001;
    max-width: 350px;
}

.moderation-notification {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #333;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease;
}

.moderation-notification-success {
    border-left-color: #27ae60;
}

.moderation-notification-error {
    border-left-color: #e74c3c;
}

.moderation-notification-warning {
    border-left-color: #f39c12;
}

.moderation-notification-info {
    border-left-color: #3498db;
}

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

/* ==========================================================================
   Loader
   ========================================================================== */

.moderation-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loader-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loader-text {
    font-size: 14px;
    color: #666;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 782px) {
    .shoutout-moderation-page {
        padding: 10px;
    }
    
    .moderation-tab-content {
        padding: 20px 15px;
    }
    
    .moderation-nav-tabs {
        flex-direction: column;
    }
    
    .moderation-nav-tab {
        text-align: center;
        border-bottom: 1px solid #ddd;
        border-right: none;
    }
    
    .moderation-nav-tab.active {
        border-bottom-color: #ddd;
        border-left: 3px solid #667eea;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .moderation-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .bulk-actions {
        justify-content: center;
    }
    
    .shoutout-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .shoutout-actions {
        width: 100%;
        justify-content: center;
    }
    
    .shoutout-content {
        padding-left: 20px;
    }
    
    .shoutout-details {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        padding: 20px;
    }
    
    .moderation-notifications {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .shoutout-actions .button {
        flex: 1;
        justify-content: center;
    }
    
    .tablenav-pages {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .shoutout-moderation-page {
        box-shadow: none;
    }
    
    .moderation-nav-tabs,
    .moderation-controls,
    .shoutout-actions,
    .moderation-pagination,
    .modal-footer {
        display: none;
    }
    
    .shoutout-item {
        break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    
    .risk-badge {
        color: #000 !important;
        background: transparent !important;
        border: 1px solid #000 !important;
    }
}
