/* Security Manager Styles */

/* Security overlay for protected content */
.security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Arial', sans-serif;
    color: white;
    animation: fadeIn 0.3s ease-in;
}

.security-overlay .message {
    background: #d32f2f;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    margin: 20px;
}

.security-overlay .message h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: bold;
}

.security-overlay .message p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.security-overlay .message .icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

/* Security status indicator */
.security-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.security-status.secure {
    background: rgba(76, 175, 80, 0.9);
}

.security-status.warning {
    background: rgba(255, 152, 0, 0.9);
}

.security-status.danger {
    background: rgba(244, 67, 54, 0.9);
}

.security-status .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

/* Security notification */
.security-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff5722;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: bold;
    z-index: 10001;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out, fadeOut 0.3s ease-in 4.7s;
    animation-fill-mode: both;
}

/* Protection level indicators */
.protection-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.protection-level.low {
    background: #4caf50;
    color: white;
}

.protection-level.medium {
    background: #ff9800;
    color: white;
}

.protection-level.high {
    background: #f44336;
    color: white;
}

/* Security dashboard styles */
.security-dashboard {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.security-dashboard h3 {
    margin: 0 0 20px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.security-dashboard h3::before {
    content: "🔒";
    font-size: 20px;
}

.security-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.security-stat {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.security-stat .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.security-stat .value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.security-stat.danger {
    border-left-color: #f44336;
}

.security-stat.danger .value {
    color: #f44336;
}

.security-stat.warning {
    border-left-color: #ff9800;
}

.security-stat.warning .value {
    color: #ff9800;
}

.security-stat.success {
    border-left-color: #4caf50;
}

.security-stat.success .value {
    color: #4caf50;
}

/* Security events table */
.security-events {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.security-events table {
    width: 100%;
    border-collapse: collapse;
}

.security-events th,
.security-events td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.security-events th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.security-events td {
    font-size: 13px;
    color: #666;
}

.security-events tr:hover {
    background: #f8f9fa;
}

.severity-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.severity-badge.low {
    background: #e8f5e8;
    color: #4caf50;
}

.severity-badge.medium {
    background: #fff3e0;
    color: #ff9800;
}

.severity-badge.high {
    background: #ffebee;
    color: #f44336;
}

.severity-badge.critical {
    background: #f44336;
    color: white;
    animation: pulse 2s infinite;
}

/* Device management */
.device-list {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.device-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.device-item:last-child {
    border-bottom: none;
}

.device-info {
    flex: 1;
}

.device-info .name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.device-info .details {
    font-size: 12px;
    color: #666;
}

.device-actions {
    display: flex;
    gap: 10px;
}

.device-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-actions .trust-btn {
    background: #4caf50;
    color: white;
}

.device-actions .block-btn {
    background: #f44336;
    color: white;
}

.device-actions .unblock-btn {
    background: #2196f3;
    color: white;
}

.device-actions button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Trust level indicators */
.trust-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.trust-level.trusted {
    background: #4caf50;
    color: white;
}

.trust-level.known {
    background: #2196f3;
    color: white;
}

.trust-level.unknown {
    background: #757575;
    color: white;
}

.trust-level.blocked {
    background: #f44336;
    color: white;
}

/* Content protection overlay */
.content-protected {
    position: relative;
}

.content-protected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 0, 0, 0.1) 10px,
        rgba(255, 0, 0, 0.1) 20px
    );
    pointer-events: none;
    z-index: 1;
}

.content-protected .protection-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 48px;
    color: rgba(255, 0, 0, 0.1);
    font-weight: bold;
    pointer-events: none;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Blur protection for high security */
.security-blur {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

.security-blur:focus,
.security-blur:hover {
    filter: blur(5px);
}

/* No-select protection */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Session security indicator */
.session-security {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    font-size: 12px;
    color: #666;
}

.session-security .security-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.session-security .security-icon.low {
    background: #4caf50;
}

.session-security .security-icon.medium {
    background: #ff9800;
}

.session-security .security-icon.high {
    background: #f44336;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .security-stats {
        grid-template-columns: 1fr;
    }
    
    .security-overlay .message {
        margin: 10px;
        padding: 20px;
    }
    
    .security-events {
        font-size: 12px;
    }
    
    .security-events th,
    .security-events td {
        padding: 8px;
    }
    
    .device-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .device-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .security-dashboard {
        background: #2d2d2d;
    }
    
    .security-dashboard h3 {
        color: #fff;
    }
    
    .security-stat {
        background: #3d3d3d;
        color: #fff;
    }
    
    .security-stat .label {
        color: #ccc;
    }
    
    .security-stat .value {
        color: #fff;
    }
    
    .security-events {
        background: #3d3d3d;
    }
    
    .security-events th {
        background: #2d2d2d;
        color: #fff;
    }
    
    .security-events td {
        color: #ccc;
    }
    
    .security-events tr:hover {
        background: #2d2d2d;
    }
    
    .device-list {
        background: #3d3d3d;
    }
    
    .device-item {
        border-bottom-color: #555;
    }
    
    .device-info .name {
        color: #fff;
    }
    
    .device-info .details {
        color: #ccc;
    }
    
    .session-security {
        background: rgba(255, 255, 255, 0.1);
        color: #ccc;
    }
}

/* Print protection */
@media print {
    .security-overlay,
    .security-status,
    .security-notification {
        display: none !important;
    }
    
    .content-protected::before {
        background: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 5px,
            rgba(0, 0, 0, 0.3) 5px,
            rgba(0, 0, 0, 0.3) 10px
        );
    }
    
    .content-protected .protection-watermark {
        color: rgba(0, 0, 0, 0.3);
        font-size: 24px;
    }
}
