/**
 * UVMS Frontend Styles
 * 
 * @package UVMS
 * @subpackage Assets
 * @since 1.0.0
 */

/* ==========================================================================
   Restricted Content Messages
   ========================================================================== */

.uvms-restricted-content {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    color: #6c757d;
}

.uvms-restricted-content.uvms-restricted-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.uvms-restricted-content.uvms-restricted-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.uvms-restricted-content.uvms-restricted-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.uvms-restricted-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: inherit;
}

.uvms-restricted-content p {
    margin: 0;
    line-height: 1.5;
}

.uvms-restricted-content .uvms-restricted-icon {
    font-size: 2em;
    margin-bottom: 10px;
    opacity: 0.7;
}

.uvms-restricted-content .uvms-login-link {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.uvms-restricted-content .uvms-login-link:hover {
    background: #005a87;
    color: #fff;
}

/* ==========================================================================
   Conditional Content Blocks
   ========================================================================== */

.uvms-conditional-content {
    position: relative;
}

.uvms-conditional-content.uvms-hidden {
    display: none;
}

.uvms-conditional-content.uvms-blur {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
}

.uvms-conditional-content.uvms-overlay {
    position: relative;
    pointer-events: none;
}

.uvms-conditional-content.uvms-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(2px);
}

/* ==========================================================================
   User Role Indicators (for logged-in users)
   ========================================================================== */

.uvms-user-indicator {
    position: fixed;
    top: 32px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 99999;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.uvms-user-indicator:hover {
    opacity: 1;
}

.uvms-user-indicator.uvms-debug-mode {
    background: #dc3545;
}

/* ==========================================================================
   Content Protection Overlays
   ========================================================================== */

.uvms-protected-wrapper {
    position: relative;
}

.uvms-protection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(248, 249, 250, 0.9) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(1px);
}

.uvms-protection-message {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.uvms-protection-message h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.uvms-protection-message p {
    margin: 0 0 20px 0;
    color: #6c757d;
    line-height: 1.5;
}

.uvms-protection-message .uvms-action-button {
    display: inline-block;
    padding: 10px 20px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.uvms-protection-message .uvms-action-button:hover {
    background: #005a87;
    color: #fff;
}

/* ==========================================================================
   Menu Item Visibility
   ========================================================================== */

.menu-item.uvms-hidden-menu-item {
    display: none !important;
}

.menu-item.uvms-restricted-menu-item {
    opacity: 0.5;
    pointer-events: none;
}

.menu-item.uvms-restricted-menu-item a {
    color: #999 !important;
    cursor: not-allowed;
}

/* Admin bar indicators for logged-in users */
.admin-bar .uvms-content-indicator {
    position: fixed;
    top: 32px;
    left: 20px;
    background: #23282d;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 11px;
    z-index: 99998;
    opacity: 0.8;
}

.admin-bar .uvms-content-indicator.uvms-protected {
    background: #dc3545;
}

.admin-bar .uvms-content-indicator.uvms-public {
    background: #28a745;
}

/* ==========================================================================
   Widget Visibility
   ========================================================================== */

.widget.uvms-hidden-widget {
    display: none !important;
}

.widget.uvms-restricted-widget {
    opacity: 0.5;
    pointer-events: none;
}

.widget.uvms-restricted-widget .widget-title {
    color: #999;
}

/* ==========================================================================
   Search Results
   ========================================================================== */

.search-results .uvms-restricted-result {
    opacity: 0.6;
    pointer-events: none;
}

.search-results .uvms-restricted-result h2 a {
    color: #999 !important;
}

.search-results .uvms-restricted-result .entry-summary {
    filter: blur(1px);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 782px) {
    .uvms-user-indicator {
        top: 46px;
        right: 10px;
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .admin-bar .uvms-content-indicator {
        top: 46px;
        left: 10px;
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .uvms-restricted-content {
        padding: 15px;
        margin: 15px 0;
    }
    
    .uvms-protection-message {
        padding: 20px;
        margin: 0 15px;
    }
}

@media (max-width: 480px) {
    .uvms-restricted-content {
        padding: 12px;
        margin: 10px 0;
    }
    
    .uvms-restricted-content h3 {
        font-size: 1.1em;
    }
    
    .uvms-protection-message {
        padding: 15px;
        margin: 0 10px;
    }
    
    .uvms-protection-message h4 {
        font-size: 1em;
    }
}

/* ==========================================================================
   Theme Compatibility
   ========================================================================== */

/* Twenty Twenty-One */
.wp-site-blocks .uvms-restricted-content {
    margin: 1.5rem 0;
}

/* Twenty Twenty-Two */
.wp-block-group .uvms-restricted-content {
    margin: var(--wp--preset--spacing--50) 0;
}

/* Astra Theme */
.ast-container .uvms-restricted-content {
    margin: 1.5em 0;
}

/* GeneratePress */
.inside-article .uvms-restricted-content {
    margin: 1.5em 0;
}

/* OceanWP */
.entry-content .uvms-restricted-content {
    margin: 1.5em 0;
}

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

@media print {
    .uvms-user-indicator,
    .uvms-content-indicator,
    .uvms-protection-overlay {
        display: none !important;
    }
    
    .uvms-restricted-content {
        background: #fff !important;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
    
    .uvms-conditional-content.uvms-blur {
        filter: none !important;
    }
    
    .uvms-conditional-content.uvms-overlay::after {
        display: none !important;
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    .uvms-restricted-content {
        border-width: 2px;
    }
    
    .uvms-restricted-content.uvms-restricted-error {
        background: #fff;
        border-color: #d00;
        color: #d00;
    }
    
    .uvms-restricted-content.uvms-restricted-warning {
        background: #fff;
        border-color: #f80;
        color: #f80;
    }
    
    .uvms-restricted-content.uvms-restricted-info {
        background: #fff;
        border-color: #00f;
        color: #00f;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .uvms-restricted-content .uvms-login-link,
    .uvms-protection-message .uvms-action-button,
    .uvms-user-indicator {
        transition: none;
    }
    
    .uvms-conditional-content.uvms-overlay {
        backdrop-filter: none;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .uvms-restricted-content {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .uvms-restricted-content.uvms-restricted-error {
        background: #742a2a;
        border-color: #9b2c2c;
        color: #feb2b2;
    }
    
    .uvms-restricted-content.uvms-restricted-warning {
        background: #975a16;
        border-color: #b7791f;
        color: #faf089;
    }
    
    .uvms-restricted-content.uvms-restricted-info {
        background: #2a4365;
        border-color: #3182ce;
        color: #90cdf4;
    }
    
    .uvms-protection-message {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .uvms-protection-message h4 {
        color: #f7fafc;
    }
}
