/**
 * HardwareAware Consciousness Visualization Styles
 * Advanced CSS for hardware consciousness demonstration
 * Adapted from OSPyramidVisualizer with web optimizations
 */

/* Main consciousness demo container */
.consciousness-demo {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #0f1419 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.consciousness-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 82, 204, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 204, 102, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 184, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Demo header */
.demo-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.demo-header h3 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #0052CC 50%, #00CC66 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.demo-subtitle {
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 500;
}

/* Main demo content layout */
.demo-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    min-height: 400px;
}

@media (max-width: 768px) {
    .demo-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Consciousness visualization container */
.consciousness-visualization {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    perspective: 1200px;
}

/* Pyramid container */
.pyramid-container {
    position: relative;
    width: 100%;
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transform: rotateX(15deg);
    transition: transform 0.5s ease;
}

.pyramid-container:hover {
    transform: rotateX(25deg) rotateY(5deg);
}

/* Hardware layers */
.hardware-layer {
    position: absolute;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.hardware-layer:hover {
    transform: translateZ(20px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.hardware-layer.selected {
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 0 3px rgba(155, 215, 255, 0.3),
        inset 0 2px 20px rgba(255, 255, 255, 0.1);
    z-index: 15;
}

.hardware-layer.floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Layer content */
.layer-content {
    padding: 10px 15px;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 2;
}

.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.layer-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.layer-level {
    font-size: 0.7rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 8px;
}

.layer-metrics {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    opacity: 0.9;
    gap: 8px;
}

.layer-metrics .metric {
    flex: 1;
    text-align: center;
}

/* Consciousness indicator */
.consciousness-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Golden spiral */
.golden-spiral {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: all 0.8s ease;
}

.spiral-path {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: spiral-rotate 20s linear infinite;
}

@keyframes spiral-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Consciousness metrics panel */
.consciousness-metrics {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    height: fit-content;
}

.metrics-header {
    text-align: center;
    margin-bottom: 20px;
}

.metrics-header h4 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.consciousness-level {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
}

.consciousness-level span {
    color: #00CC66;
    font-weight: 700;
}

/* Metrics grid */
.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-label {
    min-width: 80px;
    font-size: 0.85rem;
    color: #cbd5e1;
    font-weight: 600;
}

.metric-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.metric-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.entropy-fill {
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.coherence-fill {
    background: linear-gradient(90deg, #0052CC, #00CC66);
}

.resonance-fill {
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

.metric-value {
    min-width: 50px;
    font-size: 0.8rem;
    color: #ffffff;
    font-weight: 600;
    text-align: right;
}

/* Interaction controls */
.interaction-controls {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.controls-header {
    text-align: center;
    margin-bottom: 15px;
}

.controls-header h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.control-btn {
    background: linear-gradient(135deg, rgba(0, 82, 204, 0.2), rgba(0, 82, 204, 0.4));
    border: 1px solid #0052CC;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(0, 82, 204, 0.4), rgba(0, 82, 204, 0.6));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 82, 204, 0.3);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.2);
}

/* Layer details */
.layer-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.layer-details h4 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.layer-details h5 {
    color: #00CC66;
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.layer-description {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Technical metrics in layer details */
.technical-metrics {
    margin-bottom: 20px;
}

.metrics-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.metric-detail {
    display: flex;
    align-items: center;
    gap: 15px;
}

.metric-detail span {
    min-width: 140px;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0052CC, #00CC66);
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* Consciousness resonance detail */
.consciousness-resonance-detail {
    margin-top: 20px;
}

.resonance-bar {
    height: 8px;
    border-radius: 4px;
    margin-top: 10px;
    transition: width 0.8s ease;
    box-shadow: 0 0 10px rgba(155, 215, 255, 0.3);
}

/* General details styling */
.general-details h4 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.general-details p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 20px;
}

.consciousness-state-summary {
    background: rgba(0, 82, 204, 0.1);
    border: 1px solid rgba(0, 82, 204, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.consciousness-state-summary h5 {
    color: #00CC66;
    margin-bottom: 10px;
}

.consciousness-state-summary p {
    margin: 0;
    font-size: 0.9rem;
}

.consciousness-state-summary strong {
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .consciousness-demo {
        padding: 20px;
    }
    
    .demo-content {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .demo-header h3 {
        font-size: 1.5rem;
    }
    
    .pyramid-container {
        height: 300px;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-item {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .metric-label {
        min-width: auto;
        width: 100%;
    }
}