/* AI Autism Demo Styles */

/* Face Tracking Component */
.face-tracking-demo {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.face-tracking-container {
    position: relative;
    width: 250px;
    height: 300px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border-radius: 16px;
    border: 2px solid #374151;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.face-outline {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.face-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.face-point:nth-child(1) { animation-delay: 0s; }
.face-point:nth-child(2) { animation-delay: 0.5s; }
.face-point:nth-child(3) { animation-delay: 1s; }
.face-point:nth-child(4) { animation-delay: 1.5s; }

.scan-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
    animation: scan 3s infinite;
}

.scan-line.horizontal {
    height: 2px;
    width: 100%;
}

.scan-line.vertical {
    width: 2px;
    height: 100%;
}

.detection-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

.emotion-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.emotion-indicator {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    backdrop-filter: blur(10px);
}

.emotion-label {
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
}

.emotion-confidence {
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
}

/* Behavioral Pattern Analysis */
.behavior-analysis-demo {
    margin-top: 20px;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.pattern-item {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.pattern-item.active {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
}

.pattern-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.pattern-label {
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

.pattern-confidence {
    color: #10b981;
    font-size: 11px;
    font-weight: 600;
}

/* Communication Aid Component */
.communication-aid-demo {
    margin-top: 20px;
}

.communication-panel {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.communication-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.communication-header h4 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.communication-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.communication-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.communication-content {
    padding: 16px;
}

.detected-signals {
    margin-bottom: 16px;
}

.signal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 6px;
}

.signal-icon {
    font-size: 16px;
}

.signal-text {
    flex: 1;
    color: #d1d5db;
    font-size: 12px;
}

.signal-action {
    color: #10b981;
    font-size: 11px;
    font-weight: 500;
}

.suggested-responses {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.response-btn {
    padding: 8px 12px;
    border: 1px solid rgba(75, 85, 99, 0.3);
    background: rgba(55, 65, 81, 0.5);
    color: #d1d5db;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.response-btn:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.response-btn.primary {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Metrics Dashboard */
.metrics-dashboard-demo {
    margin-top: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.metric-card {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.metric-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.metric-value {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.metric-label {
    color: #9ca3af;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-trend {
    font-size: 9px;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 4px;
    border-radius: 4px;
}

.metric-trend.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* Learning Progress */
.learning-progress-demo {
    margin-top: 20px;
}

.learning-timeline {
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
}

.timeline-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.timeline-item.completed .timeline-marker {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.timeline-item.active .timeline-marker {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    animation: spin 2s linear infinite;
}

.timeline-item.upcoming .timeline-marker {
    background: rgba(75, 85, 99, 0.5);
    color: #9ca3af;
}

.timeline-content {
    flex: 1;
}

.timeline-content h5 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.timeline-content p {
    color: #9ca3af;
    font-size: 12px;
    margin: 0 0 8px 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #60a5fa);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Therapist Dashboard */
.therapist-dashboard-demo {
    margin-top: 20px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.dashboard-tabs {
    display: flex;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 2px solid #60a5fa;
}

.dashboard-content {
    padding: 16px;
}

.session-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 8px;
}

.patient-avatar {
    position: relative;
    flex-shrink: 0;
}

.patient-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.patient-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #1f2937;
}

.patient-status.online {
    background: #10b981;
}

.patient-details h4 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.patient-details p {
    color: #9ca3af;
    font-size: 12px;
    margin: 0;
}

.session-time {
    color: #60a5fa !important;
}

.ai-insights {
    display: grid;
    gap: 12px;
}

.insight-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 8px;
}

.insight-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.insight-content h5 {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.insight-content p {
    color: #9ca3af;
    font-size: 11px;
    margin: 0;
    line-height: 1.4;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes scan {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Demo Container and Tabs */
.demo-components-container {
    width: 100%;
}

.demo-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.demo-tabs::-webkit-scrollbar {
    display: none;
}

.demo-tab {
    padding: 10px 16px;
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-bottom: none;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.demo-tab:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.demo-tab.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #60a5fa;
}

.demo-content {
    min-height: 400px;
}

.demo-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.demo-tab-content.active {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .face-tracking-container {
        width: 200px;
        height: 250px;
    }

    .pattern-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .suggested-responses {
        grid-template-columns: 1fr;
    }

    .session-info {
        flex-direction: column;
        text-align: center;
    }

    .demo-tabs {
        gap: 2px;
    }

    .demo-tab {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
