/**
 * PatientAnalog.com - Interactive 3D Viewer Styles
 * Premium styling for 3D modules, simulators, and visual elements
 */

/* ============================================
   3D VIEWER CONTAINERS
   ============================================ */

.viewer-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, #000814 0%, #001d3d 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.viewer-container.organoid-viewer {
    height: 550px;
}

.viewer-container.chip-viewer {
    height: 500px;
}

.viewer-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.viewer-container canvas:active {
    cursor: grabbing;
}

/* Viewer Tooltip */
.viewer-tooltip {
    position: absolute;
    background: rgba(0, 8, 20, 0.95);
    border: 1px solid var(--cyan-bright, #00d4ff);
    border-radius: 8px;
    padding: 12px 16px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    max-width: 280px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
}

.viewer-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.viewer-tooltip .tooltip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.viewer-tooltip .tooltip-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.viewer-tooltip .tooltip-body {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    color: rgba(224, 242, 254, 0.8);
    line-height: 1.5;
}

/* Viewer Controls */
.viewer-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}

.viewer-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 29, 61, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan-bright, #00d4ff);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.viewer-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--cyan-bright, #00d4ff);
    transform: scale(1.1);
}

.viewer-btn.active {
    background: var(--cyan-bright, #00d4ff);
    color: #000814;
}

.viewer-btn svg {
    width: 20px;
    height: 20px;
}

/* Viewer Info Panel */
.viewer-info {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 8, 20, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    backdrop-filter: blur(10px);
    z-index: 50;
}

.viewer-info .info-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--cyan-bright, #00d4ff);
    margin-bottom: 8px;
}

.viewer-info .info-stats {
    display: flex;
    gap: 20px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    color: rgba(224, 242, 254, 0.7);
}

.viewer-info .info-stats strong {
    color: var(--gold-accent, #ffc300);
}

/* Chip-specific info panel */
.chip-info .organ-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(224, 242, 254, 0.8);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ============================================
   DRUG RESPONSE SIMULATOR
   ============================================ */

.simulator-container {
    background: linear-gradient(135deg, rgba(0, 29, 61, 0.5) 0%, rgba(0, 8, 20, 0.7) 100%);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 16px;
    padding: 30px;
    margin: 40px 0;
}

.simulator-header {
    text-align: center;
    margin-bottom: 30px;
}

.simulator-header h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    color: var(--cyan-bright, #00d4ff);
    margin-bottom: 8px;
}

.simulator-header p {
    font-family: 'Rajdhani', sans-serif;
    color: rgba(224, 242, 254, 0.6);
}

.simulator-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 8, 20, 0.5);
    border-radius: 12px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--gold-accent, #ffc300);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group select,
.control-group input[type="range"] {
    min-width: 200px;
    padding: 10px 15px;
    background: rgba(0, 29, 61, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: var(--cyan-bright, #00d4ff);
}

.control-group input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    padding: 0;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--cyan-bright, #00d4ff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.sim-btn {
    padding: 12px 24px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sim-btn:not(.secondary) {
    background: linear-gradient(135deg, var(--cyan-bright, #00d4ff) 0%, #0099ff 100%);
    color: #000814;
}

.sim-btn:not(.secondary):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

.sim-btn.secondary {
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: var(--cyan-bright, #00d4ff);
}

.sim-btn.secondary:hover {
    background: rgba(0, 212, 255, 0.1);
}

/* Organ Response Cards */
.simulator-visualization {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.organ-responses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.organ-card {
    background: rgba(0, 8, 20, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.organ-card:hover {
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-3px);
}

.organ-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.organ-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.organ-status {
    font-size: 14px;
    color: var(--gold-accent, #ffc300);
    margin-bottom: 12px;
}

.organ-viability {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.viability-bar {
    height: 100%;
    background: var(--cyan-bright, #00d4ff);
    border-radius: 4px;
    transition: all 0.5s ease;
}

.viability-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--cyan-bright, #00d4ff);
}

/* Time Course Chart */
.time-course {
    background: rgba(0, 8, 20, 0.5);
    border-radius: 12px;
    padding: 20px;
}

.time-course canvas {
    width: 100% !important;
    height: auto !important;
}

/* Results Panel */
.simulator-results {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 8, 20, 0.5);
    border-radius: 12px;
}

.result-summary h5 {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--cyan-bright, #00d4ff);
    margin-bottom: 10px;
}

.result-summary p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    margin-bottom: 8px;
}

.result-summary .warning {
    color: var(--plasma-pink, #f72585);
}

.result-summary .success {
    color: #00ff88;
}

.result-summary .note {
    color: rgba(224, 242, 254, 0.75);
    font-size: 14px;
    font-style: italic;
}

/* ============================================
   INTERACTIVE EDUCATION MODULES
   ============================================ */

.education-module {
    background: linear-gradient(135deg, rgba(0, 29, 61, 0.4) 0%, rgba(0, 8, 20, 0.6) 100%);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 16px;
    padding: 40px;
    margin: 40px 0;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.module-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--cyan-bright, #00d4ff) 0%, #0099ff 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-icon svg {
    width: 32px;
    height: 32px;
    stroke: #000814;
}

.module-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    color: #fff;
    margin-bottom: 5px;
}

.module-subtitle {
    font-family: 'Rajdhani', sans-serif;
    color: rgba(224, 242, 254, 0.6);
}

.module-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .module-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PHOTOREALISTIC VISUAL ELEMENTS
   ============================================ */

.visual-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #0a1628 0%, #001d3d 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.4s ease;
}

.visual-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.15);
}

.visual-card .card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.visual-card .card-image svg {
    width: 100%;
    height: 100%;
}

.visual-card .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 8, 20, 0.95));
}

.visual-card .card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: #fff;
    margin-bottom: 5px;
}

.visual-card .card-desc {
    font-size: 14px;
    color: rgba(224, 242, 254, 0.7);
}

.visual-card .card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--cyan-bright, #00d4ff);
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--cyan-bright, #00d4ff);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Interactive Hover Tooltip for Images */
.visual-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 8, 20, 0.95);
    border: 1px solid var(--gold-accent, #ffc300);
    border-radius: 8px;
    padding: 15px 20px;
    width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.visual-card:hover .visual-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.visual-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--gold-accent, #ffc300);
}

/* ============================================
   INTERACTIVE 3D SECTION
   ============================================ */

.interactive-3d-section {
    padding: 60px 0;
}

.viewer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

@media (max-width: 1100px) {
    .viewer-grid {
        grid-template-columns: 1fr;
    }
}

.viewer-wrapper {
    position: relative;
}

.viewer-label {
    position: absolute;
    top: -30px;
    left: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--gold-accent, #ffc300);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Loading State */
.viewer-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 8, 20, 0.9);
    z-index: 200;
}

.viewer-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top-color: var(--cyan-bright, #00d4ff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.viewer-loading p {
    margin-top: 15px;
    font-family: 'Rajdhani', sans-serif;
    color: rgba(224, 242, 254, 0.7);
}

/* ============================================
   AR/VR PREPARATION INDICATORS
   ============================================ */

.ar-vr-ready {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(247, 37, 133, 0.2) 0%, rgba(181, 23, 158, 0.2) 100%);
    border: 1px solid var(--plasma-pink, #f72585);
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--plasma-pink, #f72585);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ar-vr-ready svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   PHOTOREALISTIC SVG ILLUSTRATIONS
   ============================================ */

.illustration-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: radial-gradient(ellipse at center, #001d3d 0%, #000814 100%);
    border-radius: 12px;
    overflow: hidden;
}

.illustration-container svg {
    width: 100%;
    height: 100%;
}

/* Glow effects for illustrations */
.illustration-glow {
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

.illustration-glow-gold {
    filter: drop-shadow(0 0 15px rgba(255, 195, 0, 0.4));
}

.illustration-glow-pink {
    filter: drop-shadow(0 0 15px rgba(247, 37, 133, 0.4));
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .viewer-container {
        height: 400px;
    }
    
    .viewer-info {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .chip-info .organ-legend {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .simulator-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group select,
    .control-group input[type="range"] {
        min-width: 100%;
    }
    
    .organ-responses {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .viewer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .organ-responses {
        grid-template-columns: 1fr;
    }
    
    .viewer-controls {
        top: 10px;
        right: 10px;
    }
    
    .viewer-btn {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .viewer-container,
    .simulator-container {
        display: none;
    }
}
