* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

section {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    animation: slideIn 0.6s ease-out;
}

h2 {
    color: #60a5fa;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h2::before {
    content: '';
    width: 4px;
    height: 2rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    border-radius: 2px;
}

h3 {
    color: #93c5fd;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h4 {
    color: #a78bfa;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1rem;
}

ul {
    color: rgba(255, 255, 255, 0.85);
    margin-left: 2rem;
    margin-bottom: 1rem;
}

/* Key Points */
.key-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.point {
    background: rgba(59, 130, 246, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.point-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.point-content h4 {
    margin-bottom: 0.5rem;
}

.point-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Applications Grid */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.app-card {
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-align: center;
    transition: all 0.3s ease;
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.app-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.app-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.app-card p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Comparison and Solution Boxes */
.comparison-box, .solution-box {
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.comparison-box {
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.solution-box {
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.comparison-box h3, .solution-box h3 {
    margin-bottom: 1rem;
}

/* Network Visualization */
.network-visualization {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Architecture Details */
.architecture-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.layer-detail {
    background: rgba(59, 130, 246, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.layer-detail h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

/* Math Box */
.math-box {
    background: rgba(15, 23, 42, 0.8);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    margin: 1.5rem 0;
}

.formula {
    font-size: 1.2rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow-x: auto;
    text-align: center;
}

.explanation {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Interactive Demo */
.interactive-demo {
    margin-top: 2rem;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.demo-section {
    text-align: center;
}

.demo-section.full-width {
    grid-column: 1 / -1;
}

.demo-section h4 {
    margin-bottom: 1rem;
}

canvas {
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    display: block;
    margin: 1rem auto;
}

/* Demo Buttons */
.demo-buttons, .filter-buttons, .pooling-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
    justify-content: center;
}

.demo-btn, .filter-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.demo-btn:hover, .filter-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.demo-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.demo-btn.secondary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.filter-btn.active {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    color: white;
}

/* Calculation Display */
.calc-display {
    background: rgba(15, 23, 42, 0.6);
    padding: 1.5rem;
    border-radius: 8px;
    min-height: 100px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    margin-top: 1.5rem;
}

/* Filter Examples */
.filter-examples {
    margin-top: 2rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.filter-example {
    background: rgba(139, 92, 246, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    text-align: center;
}

.filter-example h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.kernel-display table {
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 4px;
}

.kernel-display td {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    min-width: 50px;
    font-family: 'Courier New', monospace;
    color: #10b981;
    font-weight: 600;
}

/* Pooling */
.pooling-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pooling-type {
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.pooling-type h3 {
    text-align: center;
    margin-bottom: 1rem;
}

.pooling-example {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.matrix-before h4, .matrix-after h4 {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.pooling-example table {
    border-collapse: separate;
    border-spacing: 4px;
    margin: 0 auto;
}

.pooling-example td {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
    min-width: 45px;
    font-family: 'Courier New', monospace;
    color: #e2e8f0;
}

.pooling-example td.highlight {
    background: rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-weight: 700;
}

.arrow {
    font-size: 2rem;
    color: #60a5fa;
    font-weight: bold;
}

.arrow-large {
    font-size: 3rem;
    color: #60a5fa;
    font-weight: bold;
    display: flex;
    align-items: center;
}

/* Interactive Pooling */
.interactive-pooling {
    margin-top: 2rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
}

.pooling-demo-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.info-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 1rem;
}

/* Feature Maps */
.feature-map-explanation {
    margin-top: 2rem;
}

.fm-layer {
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    margin-bottom: 1.5rem;
}

.fm-layer h4 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.fm-layer p {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.fm-examples {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.fm-box {
    background: rgba(59, 130, 246, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    font-size: 0.9rem;
}

.visualization-note {
    background: rgba(139, 92, 246, 0.1);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    margin-top: 2rem;
}

.visualization-note h4 {
    margin-bottom: 1rem;
}

/* Complete Example Flow */
.example-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.flow-step {
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.flow-step h4 {
    margin-bottom: 0.5rem;
}

.flow-step p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.step-visual {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.step-visual.multi, .step-visual.multi-small {
    flex-wrap: wrap;
}

.mini-map {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.mini-map-small {
    width: 30px;
    height: 30px;
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

.more {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    font-size: 0.85rem;
}

.flatten-bar {
    width: 200px;
    height: 20px;
    background: linear-gradient(90deg, #60a5fa 0%, #a78bfa 100%);
    border-radius: 4px;
}

.neuron-circle {
    width: 30px;
    height: 30px;
    background: rgba(16, 185, 129, 0.3);
    border: 2px solid rgba(16, 185, 129, 0.6);
    border-radius: 50%;
}

.output-probs {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.prob-bar {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    text-align: left;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.flow-arrow {
    font-size: 2rem;
    color: #60a5fa;
    margin: 1rem 0;
}

.result-display {
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    text-align: center;
    min-height: 100px;
}

/* Concepts Grid */
.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.concept-card {
    background: rgba(15, 23, 42, 0.6);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.concept-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.concept-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.concept-card p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #60a5fa 0%, #a78bfa 100%);
    border-radius: 2px;
}

.timeline-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-year {
    flex: 0 0 100px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-content {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* Summary */
.summary-box {
    background: rgba(139, 92, 246, 0.1);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    margin-bottom: 2rem;
}

.summary-box h3 {
    margin-bottom: 1.5rem;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-list li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.summary-list li:last-child {
    border-bottom: none;
}

.summary-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
    font-size: 1.2rem;
}

.next-steps {
    background: rgba(16, 185, 129, 0.1);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.next-steps h3 {
    color: #10b981;
    margin-bottom: 1rem;
}

.next-steps ul {
    margin-left: 1.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    margin-top: 3rem;
}

footer a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #93c5fd;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .key-points,
    .applications-grid,
    .demo-grid,
    .filters-grid,
    .pooling-types,
    .concepts-grid {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        flex-direction: column !important;
        padding-left: 50px;
    }

    .timeline-year {
        position: absolute;
        left: 0;
    }

    .pooling-demo-grid {
        flex-direction: column;
    }

    .arrow-large {
        transform: rotate(90deg);
    }
}
