csp-security-project / styles /components.css
AbdulElahGwaith's picture
Upload folder using huggingface_hub
d0a2071 verified
/* ==============================================
مكونات إضافية لمشروع سياسة أمان المحتوى
Components & Interactive Elements
============================================== */
/* CSP Builder Specific Styles */
.builder-tabs {
display: flex;
gap: var(--space-sm);
margin-bottom: var(--space-lg);
border-bottom: 1px solid var(--neutral-800);
}
.builder-tab {
display: none;
padding-top: var(--space-lg);
}
.builder-tab.active {
display: block;
}
.builder-section {
margin-bottom: var(--space-xl);
}
.builder-section h4 {
color: var(--neutral-50);
margin-bottom: var(--space-md);
font-size: 18px;
}
.generated-csp {
background: var(--neutral-950);
border-radius: var(--radius-sm);
padding: var(--space-lg);
border: 1px solid var(--neutral-800);
}
.generated-csp h4 {
color: var(--neutral-50);
margin-bottom: var(--space-md);
font-size: 16px;
}
.generated-csp pre {
background: var(--neutral-950);
padding: var(--space-md);
border-radius: var(--radius-sm);
margin-bottom: var(--space-md);
overflow-x: auto;
}
.generated-csp code {
font-family: var(--font-mono);
font-size: 14px;
color: var(--neutral-200);
line-height: 1.5;
}
/* Test Results */
.test-results {
display: flex;
flex-direction: column;
gap: var(--space-sm);
}
.test-item {
display: flex;
align-items: center;
gap: var(--space-sm);
padding: var(--space-sm) var(--space-md);
background: var(--neutral-950);
border-radius: var(--radius-sm);
border: 1px solid var(--neutral-800);
}
.test-status {
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
font-weight: bold;
font-size: 12px;
}
.test-status.success {
background: var(--success-500);
color: var(--neutral-950);
}
.test-status.warning {
background: var(--warning-500);
color: var(--neutral-950);
}
.test-status.error {
background: var(--error-500);
color: var(--neutral-950);
}
/* Interactive Code Blocks */
.code-block {
position: relative;
background: var(--neutral-950);
border-radius: var(--radius-sm);
border: 1px solid var(--neutral-800);
overflow: hidden;
}
.code-header {
display: flex;
justify-content: between;
align-items: center;
padding: var(--space-sm) var(--space-md);
background: var(--neutral-800);
border-bottom: 1px solid var(--neutral-800);
}
.code-language {
font-size: 12px;
color: var(--neutral-200);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.code-copy-btn {
background: none;
border: none;
color: var(--neutral-200);
cursor: pointer;
padding: var(--space-xs);
border-radius: 4px;
transition: var(--transition-smooth);
}
.code-copy-btn:hover {
background: var(--neutral-700);
color: var(--primary-500);
}
.code-content {
padding: var(--space-md);
font-family: var(--font-mono);
font-size: 14px;
line-height: 1.6;
overflow-x: auto;
color: var(--neutral-200);
}
/* Syntax Highlighting */
.code-content .keyword {
color: var(--primary-500);
font-weight: 600;
}
.code-content .string {
color: var(--success-500);
}
.code-content .comment {
color: var(--neutral-800);
font-style: italic;
}
.code-content .number {
color: var(--warning-500);
}
.code-content .function {
color: var(--primary-100);
}
/* Interactive Demos */
.demo-container {
background: var(--neutral-900);
border-radius: var(--radius-md);
border: 1px solid var(--neutral-800);
overflow: hidden;
margin: var(--space-lg) 0;
}
.demo-header {
padding: var(--space-lg);
background: var(--neutral-800);
border-bottom: 1px solid var(--neutral-800);
}
.demo-header h4 {
color: var(--neutral-50);
margin-bottom: var(--space-sm);
}
.demo-description {
color: var(--neutral-200);
font-size: 14px;
line-height: 1.5;
}
.demo-content {
padding: var(--space-lg);
}
.demo-controls {
display: flex;
gap: var(--space-sm);
margin-bottom: var(--space-lg);
flex-wrap: wrap;
}
.demo-output {
background: var(--neutral-950);
border: 1px solid var(--neutral-800);
border-radius: var(--radius-sm);
padding: var(--space-md);
min-height: 100px;
font-family: var(--font-mono);
font-size: 14px;
color: var(--neutral-200);
}
/* Security Alerts */
.security-alert {
padding: var(--space-md);
border-radius: var(--radius-sm);
margin: var(--space-md) 0;
border-left: 4px solid;
display: flex;
align-items: flex-start;
gap: var(--space-sm);
}
.security-alert.info {
background: rgba(59, 130, 246, 0.1);
border-color: #3B82F6;
color: #DBEAFE;
}
.security-alert.warning {
background: rgba(245, 158, 11, 0.1);
border-color: var(--warning-500);
color: #FEF3C7;
}
.security-alert.error {
background: rgba(239, 68, 68, 0.1);
border-color: var(--error-500);
color: #FEE2E2;
}
.security-alert.success {
background: rgba(34, 197, 94, 0.1);
border-color: var(--success-500);
color: #D1FAE5;
}
.security-alert-icon {
width: 20px;
height: 20px;
flex-shrink: 0;
margin-top: 2px;
}
/* Progress Indicators */
.progress-bar {
width: 100%;
height: 8px;
background: var(--neutral-800);
border-radius: 4px;
overflow: hidden;
margin: var(--space-sm) 0;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--primary-500), var(--primary-700));
transition: width 0.3s ease;
border-radius: 4px;
}
.progress-label {
font-size: 14px;
color: var(--neutral-200);
margin-bottom: var(--space-xs);
}
/* Security Status Indicators */
.security-status {
display: inline-flex;
align-items: center;
gap: var(--space-sm);
padding: var(--space-xs) var(--space-sm);
border-radius: 12px;
font-size: 12px;
font-weight: 600;
}
.security-status.secure {
background: rgba(34, 197, 94, 0.2);
color: var(--success-500);
}
.security-status.warning {
background: rgba(245, 158, 11, 0.2);
color: var(--warning-500);
}
.security-status.unsafe {
background: rgba(239, 68, 68, 0.2);
color: var(--error-500);
}
.security-status-icon {
width: 12px;
height: 12px;
border-radius: 50%;
}
.security-status.secure .security-status-icon {
background: var(--success-500);
}
.security-status.warning .security-status-icon {
background: var(--warning-500);
}
.security-status.unsafe .security-status-icon {
background: var(--error-500);
}
/* Comparison Tables */
.comparison-table {
width: 100%;
border-collapse: collapse;
background: var(--neutral-900);
border-radius: var(--radius-sm);
overflow: hidden;
border: 1px solid var(--neutral-800);
}
.comparison-table th,
.comparison-table td {
padding: var(--space-md);
text-align: right;
border-bottom: 1px solid var(--neutral-800);
}
.comparison-table th {
background: var(--neutral-800);
color: var(--neutral-50);
font-weight: 600;
}
.comparison-table td {
color: var(--neutral-200);
}
.comparison-table tr:last-child td {
border-bottom: none;
}
.comparison-table .feature-name {
font-weight: 500;
color: var(--neutral-50);
}
.comparison-table .supported {
color: var(--success-500);
font-weight: 600;
}
.comparison-table .not-supported {
color: var(--error-500);
font-weight: 600;
}
.comparison-table .partial {
color: var(--warning-500);
font-weight: 600;
}
/* Feature Cards */
.feature-card {
background: var(--neutral-900);
border-radius: var(--radius-md);
padding: var(--space-lg);
border: 1px solid var(--neutral-800);
position: relative;
overflow: hidden;
transition: var(--transition-bounce);
}
.feature-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg, var(--primary-500), var(--primary-700));
transform: scaleX(0);
transition: var(--transition-bounce);
}
.feature-card:hover::before {
transform: scaleX(1);
}
.feature-card:hover {
transform: translateY(-2px);
box-shadow: var(--glow-card);
}
.feature-header {
display: flex;
align-items: center;
gap: var(--space-md);
margin-bottom: var(--space-md);
}
.feature-icon {
width: 40px;
height: 40px;
background: var(--primary-500);
border-radius: var(--radius-sm);
display: flex;
align-items: center;
justify-content: center;
color: var(--neutral-950);
font-size: 18px;
font-weight: bold;
}
.feature-title {
font-size: 18px;
color: var(--neutral-50);
margin: 0;
}
.feature-description {
color: var(--neutral-200);
line-height: 1.6;
margin-bottom: var(--space-md);
}
.feature-example {
background: var(--neutral-950);
border-radius: var(--radius-sm);
padding: var(--space-md);
margin-top: var(--space-md);
border: 1px solid var(--neutral-800);
}
.feature-example code {
font-family: var(--font-mono);
font-size: 13px;
color: var(--neutral-200);
line-height: 1.5;
}
/* Interactive Lists */
.interactive-list {
list-style: none;
padding: 0;
}
.interactive-list li {
padding: var(--space-md);
background: var(--neutral-900);
border: 1px solid var(--neutral-800);
border-radius: var(--radius-sm);
margin-bottom: var(--space-sm);
transition: var(--transition-smooth);
cursor: pointer;
position: relative;
}
.interactive-list li:hover {
background: var(--neutral-800);
border-color: var(--primary-500);
}
.interactive-list li.active {
background: rgba(0, 224, 213, 0.1);
border-color: var(--primary-500);
}
.interactive-list .list-title {
font-weight: 600;
color: var(--neutral-50);
margin-bottom: var(--space-xs);
}
.interactive-list .list-description {
color: var(--neutral-200);
font-size: 14px;
line-height: 1.5;
}
/* Status Messages */
.status-message {
padding: var(--space-md);
border-radius: var(--radius-sm);
margin: var(--space-md) 0;
display: flex;
align-items: center;
gap: var(--space-sm);
font-weight: 500;
}
.status-message.loading {
background: rgba(59, 130, 246, 0.1);
border: 1px solid #3B82F6;
color: #DBEAFE;
}
.status-message.success {
background: rgba(34, 197, 94, 0.1);
border: 1px solid var(--success-500);
color: #D1FAE5;
}
.status-message.error {
background: rgba(239, 68, 68, 0.1);
border: 1px solid var(--error-500);
color: #FEE2E2;
}
.status-message.warning {
background: rgba(245, 158, 11, 0.1);
border: 1px solid var(--warning-500);
color: #FEF3C7;
}
.status-icon {
width: 20px;
height: 20px;
flex-shrink: 0;
}
/* Loading Animations */
.loading-spinner {
width: 24px;
height: 24px;
border: 2px solid var(--neutral-800);
border-top: 2px solid var(--primary-500);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loading-dots {
display: flex;
gap: 4px;
}
.loading-dots span {
width: 8px;
height: 8px;
background: var(--primary-500);
border-radius: 50%;
animation: loadingDots 1.4s infinite ease-in-out;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes loadingDots {
0%, 80%, 100% {
transform: scale(0);
}
40% {
transform: scale(1);
}
}
/* Copy to Clipboard Animation */
.copy-feedback {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: var(--primary-500);
color: var(--neutral-950);
padding: var(--space-md) var(--space-lg);
border-radius: var(--radius-sm);
font-weight: 600;
z-index: 3000;
animation: copyFeedback 2s ease-out forwards;
}
@keyframes copyFeedback {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.8);
}
20% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
80% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
100% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.8);
}
}
/* Tooltips */
.tooltip {
position: relative;
display: inline-block;
}
.tooltip-content {
position: absolute;
bottom: 125%;
left: 50%;
transform: translateX(-50%);
background: var(--neutral-800);
color: var(--neutral-50);
padding: var(--space-xs) var(--space-sm);
border-radius: 4px;
font-size: 12px;
white-space: nowrap;
opacity: 0;
visibility: hidden;
transition: var(--transition-smooth);
z-index: 1000;
}
.tooltip-content::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border: 4px solid transparent;
border-top-color: var(--neutral-800);
}
.tooltip:hover .tooltip-content {
opacity: 1;
visibility: visible;
}
/* Code Block Enhancements */
.code-block-wrapper {
position: relative;
margin: var(--space-lg) 0;
}
.code-line-numbers {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 40px;
background: var(--neutral-800);
border-right: 1px solid var(--neutral-800);
display: flex;
flex-direction: column;
padding: var(--space-md) var(--space-sm);
font-family: var(--font-mono);
font-size: 12px;
color: var(--neutral-800);
user-select: none;
}
.code-line-numbers .line-number {
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.code-line-numbers .line-number.current {
color: var(--primary-500);
font-weight: 600;
}
.code-block-content {
padding-right: 50px;
}
/* Performance Indicators */
.performance-indicator {
display: flex;
align-items: center;
gap: var(--space-sm);
padding: var(--space-xs) var(--space-sm);
border-radius: 12px;
font-size: 12px;
font-weight: 600;
}
.performance-indicator.excellent {
background: rgba(34, 197, 94, 0.2);
color: var(--success-500);
}
.performance-indicator.good {
background: rgba(59, 130, 246, 0.2);
color: #60A5FA;
}
.performance-indicator.fair {
background: rgba(245, 158, 11, 0.2);
color: var(--warning-500);
}
.performance-indicator.poor {
background: rgba(239, 68, 68, 0.2);
color: var(--error-500);
}
/* Accessibility Enhancements */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.skip-link {
position: absolute;
top: -40px;
left: 6px;
background: var(--primary-500);
color: var(--neutral-950);
padding: 8px;
text-decoration: none;
border-radius: 4px;
z-index: 9999;
font-weight: 600;
}
.skip-link:focus {
top: 6px;
}
/* High Contrast Mode Support */
@media (prefers-contrast: high) {
:root {
--neutral-950: #000000;
--neutral-900: #1a1a1a;
--neutral-800: #404040;
--neutral-200: #ffffff;
--neutral-50: #ffffff;
}
.guide-card,
.tool-card,
.tech-card {
border-width: 2px;
}
.btn {
border-width: 2px;
}
}
/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
.loading-spinner,
.loading-dots span {
animation: none;
}
}