/* Custom CSS for Deep Feedforward Networks Tutorial */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #334155;
    scroll-behavior: smooth;
}

.section {
    padding: 80px 0;
    position: relative;
}

.section-header h2 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Neural Network Animation */
.neural-network-animation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.network-layer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.neuron {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.input-neuron {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.hidden-neuron {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.output-neuron {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(37, 99, 235, 0.9) !important;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border: none;
    font-weight: 600;
    padding: 1.5rem;
}

.card-body {
    padding: 2rem;
}

/* Feature Boxes */
.feature-box {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-box:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateY(-3px);
}

.feature-box i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-box h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Importance Items */
.importance-item {
    text-align: center;
    padding: 1rem;
}

.importance-item i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.importance-item h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Concept Cards */
.concept-cards .card {
    margin-bottom: 2rem;
}

/* Code Examples */
.code-example {
    background: #1e293b;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-example pre {
    margin: 0;
    background: none;
    border: none;
    padding: 0;
}

.code-example code {
    color: #e2e8f0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Layer Explanations */
.layer-explanation {
    padding: 1.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    height: 100%;
}

.layer-explanation h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Neural Analogy */
.neural-analogy {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
}

.neural-analogy h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.neural-analogy ul {
    margin-bottom: 0;
}

/* Pros and Cons */
.pros-cons-box {
    padding: 1.5rem;
    border-radius: 10px;
    height: 100%;
}

.pros-cons-box.pros {
    background: rgba(5, 150, 105, 0.1);
    border-left: 4px solid var(--success-color);
}

.pros-cons-box.cons {
    background: rgba(220, 38, 38, 0.1);
    border-left: 4px solid var(--danger-color);
}

.pros-cons-box h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.pros-cons-box ul {
    margin-bottom: 0;
}

/* Transformation Example */
.transformation-example {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
}

/* Approaches Grid */
.approaches-grid .approach-card {
    transition: all 0.3s ease;
}

.approaches-grid .approach-card:hover {
    transform: translateY(-10px);
}

.pros-cons h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pros-cons ul {
    margin-bottom: 0;
}

/* XOR Table */
.xor-table-container {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 1.5rem;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    border-top: none;
}

/* Failure Explanation */
.failure-explanation .alert {
    border-left: 4px solid var(--danger-color);
}

/* Network Structure */
.network-structure {
    background: rgba(34, 197, 94, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
}

/* Activation Info */
.activation-info {
    background: rgba(251, 191, 36, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
}

/* ReLU Visualization */
.relu-visualization {
    text-align: center;
}

.function-graph {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Explanation Box */
.explanation-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.explanation-box h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.explanation-box ul {
    margin-bottom: 0;
}

/* ReLU Properties */
.relu-properties {
    background: rgba(251, 191, 36, 0.1);
    border-radius: 10px;
    padding: 1.5rem;
}

.relu-properties h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.relu-properties ul {
    margin-bottom: 0;
}

/* Interactive ReLU */
.interactive-relu {
    text-align: center;
}

.interactive-relu canvas {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: crosshair;
}

/* Takeaways Grid */
.takeaways-grid .takeaway-card {
    transition: all 0.3s ease;
    text-align: center;
}

.takeaways-grid .takeaway-card:hover {
    transform: translateY(-5px);
}

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

.takeaway-card h4 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(8, 145, 178, 0.1);
    border-left-color: var(--info-color);
    color: #0c4a6e;
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    border-left-color: var(--success-color);
    color: #064e3b;
}

.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    border-left-color: var(--warning-color);
    color: #92400e;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    border-left-color: var(--danger-color);
    color: #991b1b;
}

.alert-primary {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-color);
    color: #1e40af;
}

/* Footer */
footer {
    background: var(--dark-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .neural-network-animation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .network-layer {
        flex-direction: row;
    }
    
    .neuron {
        width: 40px;
        height: 40px;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Text Gradients */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Interactive Elements */
.interactive-element {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-element:hover {
    transform: scale(1.05);
}

/* Math Expressions */
.math-expression {
    font-family: 'Times New Roman', serif;
    font-style: italic;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin: 0.1rem;
}

/* Syntax Highlighting Override */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6b7280;
}

.token.punctuation {
    color: #d1d5db;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #f87171;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #34d399;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #60a5fa;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #a78bfa;
}

.token.function,
.token.class-name {
    color: #fbbf24;
}

