/* Demos Page Specific Styles */

.demos-hero {
    position: relative;
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #1e3a8a 0%, #059669 100%);
    color: white;
    overflow: hidden;
}

.demos-hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.demos-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.demos-hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.demos-hero-description {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 3rem;
    opacity: 0.9;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Demo Categories */
.demo-categories {
    padding: 2rem 0;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.category-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
    transform: translateY(-2px);
}

/* Demos Section */
.demos-section {
    padding: 4rem 0;
}

.demos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.demo-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    border: 1px solid #e5e7eb;
}

.demo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.demo-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.demo-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.demo-difficulty.beginner {
    background-color: #dcfce7;
    color: #166534;
}

.demo-difficulty.intermediate {
    background-color: #fef3c7;
    color: #92400e;
}

.demo-difficulty.advanced {
    background-color: #fecaca;
    color: #991b1b;
}

.demo-preview {
    padding: 1rem 1.5rem;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.demo-preview canvas {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
}

.demo-content {
    padding: 1.5rem;
}

.demo-description {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.demo-controls {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.demo-btn {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.demo-btn:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.demo-btn.secondary {
    background-color: #6b7280;
}

.demo-btn.secondary:hover {
    background-color: #4b5563;
}

.demo-controls label {
    font-size: 0.9rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-controls input[type="range"] {
    width: 100px;
}

.demo-controls select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
}

.demo-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-tag {
    background-color: #eff6ff;
    color: #2563eb;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Specific Demo Styles */

/* Neural Network Visualizer */
#neural-network-canvas {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

/* Sentiment Analysis */
.sentiment-display {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sentiment-meter {
    position: relative;
    width: 200px;
    height: 100px;
    background: linear-gradient(90deg, #ef4444 0%, #fbbf24 50%, #10b981 100%);
    border-radius: 100px 100px 0 0;
    overflow: hidden;
}

.sentiment-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 80px;
    background: #1f2937;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.5s ease;
    border-radius: 2px;
}

.sentiment-needle::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #1f2937;
    border-radius: 50%;
    transform: translateX(-50%);
}

.sentiment-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Image Classification */
.image-upload-area {
    width: 100%;
    height: 200px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload-area:hover {
    border-color: #2563eb;
    background-color: #f8fafc;
}

.upload-placeholder {
    text-align: center;
    color: #6b7280;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.classification-results {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    display: none;
}

.classification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.classification-item:last-child {
    border-bottom: none;
}

.confidence-bar {
    width: 100px;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background-color: #2563eb;
    transition: width 0.5s ease;
}

/* Decision Tree */
.tree-visualization {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    overflow: auto;
}

.tree-node {
    background: white;
    border: 2px solid #2563eb;
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0.25rem;
    font-size: 0.8rem;
    text-align: center;
    min-width: 80px;
}

.tree-node.leaf {
    background-color: #dcfce7;
    border-color: #16a34a;
}

/* Data Table */
.data-table-container {
    max-height: 200px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

.data-table .missing {
    color: #ef4444;
    font-style: italic;
}

.data-table .normalized {
    color: #059669;
}

/* Training Info */
.training-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Grid World */
.grid-world {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border: 2px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

.grid-cell {
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.grid-cell.wall {
    background-color: #374151;
}

.grid-cell.goal {
    background-color: #dcfce7;
}

.grid-cell.agent {
    background-color: #dbeafe;
}

.grid-cell.visited {
    background-color: #fef3c7;
}

/* Feature Chart */
.feature-chart {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: end;
    justify-content: space-around;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 8px;
}

.feature-bar {
    background-color: #2563eb;
    width: 30px;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s ease;
}

.feature-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Confusion Matrix */
.confusion-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border: 2px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

.matrix-cell {
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.matrix-cell.correct {
    background-color: #dcfce7;
    color: #166534;
}

.matrix-cell.incorrect {
    background-color: #fecaca;
    color: #991b1b;
}

.metrics-display {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    display: none;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

/* Ensemble Visualization */
.ensemble-visualization {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
}

.model-box {
    background: white;
    border: 2px solid #2563eb;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
    min-width: 60px;
    transition: all 0.3s ease;
}

.model-box:hover {
    transform: scale(1.05);
}

.ensemble-result {
    background-color: #dcfce7;
    border-color: #16a34a;
    font-weight: 600;
}

/* Learning Path */
.learning-path {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.path-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.path-step {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 250px;
    transition: transform 0.3s ease;
}

.path-step:hover {
    transform: translateY(-4px);
}

.step-number {
    background: linear-gradient(135deg, #2563eb, #10b981);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.step-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.step-content p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.path-arrow {
    font-size: 2rem;
    color: #2563eb;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .demos-hero-title {
        font-size: 2.5rem;
    }
    
    .demos-hero-subtitle {
        font-size: 1.2rem;
    }
    
    .demos-hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .category-btn {
        flex-shrink: 0;
    }
    
    .demos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .demo-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .demo-controls label {
        justify-content: space-between;
    }
    
    .path-container {
        flex-direction: column;
    }
    
    .path-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .demos-hero {
        padding: 100px 0 60px;
    }
    
    .demos-hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .demo-card {
        margin: 0 10px;
    }
    
    .demo-preview {
        min-height: 180px;
    }
    
    .demo-preview canvas {
        width: 250px;
        height: 150px;
    }
}

