/**
 * Complete AI Demo Module Styling for Disha.Cloud
 * Includes all components: Multi-Modal Generation, Behavioral Analytics, and Predictive Intelligence
 * Date: 2025-05-05
 */

/* ========== GENERAL MODULE LAYOUT ========== */
.ai-demo-module {
    background-color: rgba(14, 11, 48, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin: var(--space-9) var(--space-5);
    padding: var(--space-8) var(--space-5);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    opacity: 0.04;
    pointer-events: none;
    background-color: transparent;
    background-image: 
        radial-gradient(var(--secondary-1) 1px, transparent 1px),
        radial-gradient(var(--primary-1) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
}

.ai-data-streams {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.ai-data-stream {
    position: absolute;
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--primary-1), transparent);
    opacity: 0;
    animation: dataStream 4s infinite linear;
}

.ai-data-stream:nth-child(1) {
    left: 20%;
    animation-delay: 0.5s;
}

.ai-data-stream:nth-child(2) {
    left: 50%;
    animation-delay: 1.5s;
}

.ai-data-stream:nth-child(3) {
    left: 80%;
    animation-delay: 1s;
}

@keyframes dataStream {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.ai-demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-7);
}

.ai-demo-card {
    background: rgba(20, 20, 50, 0.8);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    min-height: 550px;
}

.ai-demo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Section heading */
.section-heading.centered {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-tag {
    display: inline-block;
    background: rgba(110, 0, 255, 0.1);
    color: var(--primary-3);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: var(--space-3);
}

.section-subtitle {
    font-size: 1.8rem;
    opacity: 0.8;
    max-width: 700px;
    margin: var(--space-4) auto 0;
}

.gradient-text {
    background: linear-gradient(to right, var(--primary-1), var(--secondary-1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ========== CARD HEADER STYLES ========== */
.ai-demo-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-demo-icon {
    width: 56px;
    height: 56px;
    background: #9747FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
}

.ai-demo-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.ai-demo-content {
    padding: 16px;
}

/* ========== MULTI-MODAL GENERATION DEMO ========== */
.ai-input-area {
    margin-bottom: var(--space-4);
}

.ai-prompt {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}

.ai-prompt span {
    flex: 1;
    font-size: 1.4rem;
    opacity: 0.8;
}

.ai-generate-btn {
    background: linear-gradient(135deg, var(--primary-1), var(--secondary-1));
    color: var(--light);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.ai-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 0, 255, 0.3);
}

.ai-output-area {
    background-color: rgba(7, 4, 23, 0.5);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    min-height: 220px;
    position: relative;
}

.ai-thinking {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.4rem;
    color: var(--gray-3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.5s forwards, fadeOut 0.5s ease-out 2.5s forwards;
}

.enhanced-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.enhanced-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--secondary-1);
    animation: typingPulse 1.5s infinite ease-in-out;
}

.enhanced-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.enhanced-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.enhanced-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

.ai-result {
    opacity: 0;
    animation: fadeIn 0.5s ease-out 3s forwards;
}

/* Output tabs for multi-modal content */
.output-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.output-tab {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 1.4rem;
    opacity: 0.6;
    transition: all var(--transition-normal);
}

.output-tab.active {
    opacity: 1;
    border-bottom: 2px solid var(--primary-1);
}

.ai-generated-content {
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.ai-generated-content.active {
    display: block;
    opacity: 1;
}

.ai-generated-text {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.ai-generated-list {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.ai-generated-list li {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 5px;
}

/* Image and Video placeholders */
.ai-image-placeholder {
    width: 100%;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-generation-effect {
    position: absolute;
    width: 150%;
    height: 150%;
    background: linear-gradient(45deg, 
        rgba(110, 0, 255, 0) 0%,
        rgba(110, 0, 255, 0.1) 50%,
        rgba(110, 0, 255, 0) 100%);
    animation: imageGenerating 3s infinite;
}

.image-placeholder-text, .video-placeholder-text {
    color: var(--gray-3);
    font-size: 1.4rem;
    z-index: 2;
}

.ai-video-placeholder {
    width: 100%;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.video-placeholder-icon {
    font-size: 3rem;
    color: var(--primary-1);
    opacity: 0.7;
}

@keyframes imageGenerating {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(0%, 0%) rotate(360deg);
    }
}

/* Action buttons */
.ai-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ai-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--gray-3);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.ai-action-btn:hover {
    background-color: rgba(110, 0, 255, 0.2);
    color: var(--light);
}

.ai-action-btn.primary {
    background-color: var(--primary-1);
    color: var(--light);
}

/* ========== BEHAVIORAL ANALYTICS DEMO ========== */
/* Tabs layout */
.ai-tabs {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.ai-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: rgba(26, 27, 55, 0.5);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 18px;
}

.ai-tab.active {
    background: rgba(76, 32, 127, 0.7);
}

.ai-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

/* Metrics summary layout */
.ai-metrics-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.metric-summary-item {
    flex: 1;
    padding: 16px;
    background: rgba(26, 27, 55, 0.8);
    border-radius: 12px;
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
}

.metric-summary-item:nth-child(1) .metric-value {
    color: #9747FF;
}

.metric-summary-item:nth-child(2) .metric-value {
    color: #9747FF;
}

.metric-summary-item:nth-child(3) .metric-value {
    color: #9747FF;
}

.metric-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
}

.metric-trend.positive {
    color: #00E987;
}

.metric-trend.negative {
    color: #FF3D70;
}

/* User Flow Optimization */
.ai-analytics-item {
    margin-bottom: 24px;
}

.ai-analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-analytics-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.ai-analytics-info {
    width: 28px;
    height: 28px;
    background: rgba(26, 27, 55, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Flow bars visualization */
.ai-analytics-bars {
    margin-bottom: 12px;
    position: relative;
}

.ai-analytics-optimized-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ai-analytics-optimized-label span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.ai-analytics-bar-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(26, 27, 55, 0.5);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.ai-analytics-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 85%;
    background: linear-gradient(90deg, #6E00FF 0%, #00D1FF 100%);
    border-radius: 4px;
}

/* Segmentation visualization */
.ai-segment-chart {
    height: 40px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
}

.segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.segment:nth-child(1) {
    background: #9747FF;
    width: 35%;
}

.segment:nth-child(2) {
    background: #00D1FF;
    width: 25%;
}

.segment:nth-child(3) {
    background: #FF8400;
    width: 20%;
}

.segment:nth-child(4) {
    background: #FF3D70;
    width: 20%;
}

/* AI Insight box */
.ai-insight-box {
    margin-top: 24px;
    background: rgba(0, 233, 135, 0.1);
    border-left: 4px solid #00E987;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
}

.ai-insight-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(0, 233, 135, 0.2);
    color: #00E987;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ai-insight-content h4 {
    color: #00E987;
    font-size: 18px;
    margin: 0 0 8px;
}

.ai-insight-content p {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* ========== PREDICTIVE INTELLIGENCE DEMO ========== */
.ai-timeline {
    padding: 5px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 15px;
}

.timeline-header h4 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.timeline-confidence {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 160px;
}

.confidence-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.confidence-meter {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-level {
    height: 100%;
    background: linear-gradient(90deg, #6E00FF, #00D1FF);
    border-radius: 3px;
}

.confidence-value {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    color: #00D1FF;
}

.timeline-visualization {
    margin: 30px 0;
}

.timeline-markers {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.timeline-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
}

.timeline-date.current {
    color: #00D1FF;
    font-weight: 600;
}

.timeline-path {
    position: relative;
    display: flex;
    align-items: center;
    height: 60px;
}

.timeline-path::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
}

.path-marker {
    width: 16px;
    height: 16px;
    background: #9747FF;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.path-marker.current {
    background: #00D1FF;
    box-shadow: 0 0 0 4px rgba(0, 209, 255, 0.2);
}

.path-marker:nth-child(1) {
    margin-left: 0;
}

.path-marker:nth-child(3) {
    margin-left: auto;
    margin-right: auto;
}

.path-marker:nth-child(5) {
    margin-right: 0;
}

.path-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.marker-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 50, 0.9);
    border: 1px solid rgba(110, 0, 255, 0.3);
    padding: 10px;
    border-radius: 6px;
    width: 220px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.path-marker:hover .marker-tooltip {
    opacity: 1;
}

.marker-tooltip strong {
    color: #00D1FF;
    display: block;
    margin-bottom: 5px;
}

/* Timeline strategies section */
.timeline-strategies {
    margin-top: 30px;
}

.timeline-strategies h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.strategy-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strategy-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
}

.strategy-item.recommended {
    background: rgba(110, 0, 255, 0.1);
    border: 1px solid rgba(110, 0, 255, 0.3);
}

.strategy-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

.strategy-content {
    flex: 1;
}

.strategy-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 16px;
}

.strategy-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.strategy-tag {
    position: absolute;
    top: -10px;
    right: 10px;
    background: linear-gradient(90deg, #6E00FF, #00D1FF);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* AI Learning status */
.ai-learning-status {
    margin-top: 25px;
    padding: 15px;
    background: rgba(7, 4, 23, 0.5);
    border-radius: 8px;
}

.learning-status-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.ai-learning-progress {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin: 8px 0;
}

.ai-learning-progress-bar {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--primary-1), var(--secondary-1));
    border-radius: 3px;
    position: relative;
    animation: aiLearningProgress 10s infinite ease-in-out;
}

.ai-learning-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: aiLearningShine 2s infinite linear;
}

.learning-status-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

@keyframes aiLearningProgress {
    0%, 100% {
        width: 30%;
    }
    25% {
        width: 60%;
    }
    50% {
        width: 45%;
    }
    75% {
        width: 95%;
    }
}

@keyframes aiLearningShine {
    0% {
        left: -100px;
    }
    100% {
        left: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
    .ai-demo-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-metrics-summary {
        flex-direction: column;
        gap: 15px;
    }
    
    .metric-summary-item {
        width: 100%;
    }
    
    .timeline-header {
        flex-direction: column;
    }
    
    .ai-tab {
        font-size: 1.4rem;
    }
    
    .segment {
        font-size: 12px;
    }
    
    .ai-demo-header {
        padding: 12px 16px;
    }
    
    .ai-demo-icon {
        width: 46px;
        height: 46px;
        font-size: 1.8rem;
    }
    
    .ai-demo-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .ai-tabs {
        gap: 6px;
    }
    
    .ai-tab {
        padding: 8px 4px;
        font-size: 1.2rem;
    }
    
    .metric-value {
        font-size: 26px;
    }
    
    .metric-label, .metric-trend {
        font-size: 14px;
    }
    
    .ai-demo-content {
        padding: 12px 8px;
    }
    
    .segment::after {
        content: '';
        display: none;
    }
    
    .timeline-date {
        font-size: 11px;
    }
}