/* ML Fundamentals Chapter 2 Specific Styles */
/* File location: static/css/tutorials/ml_fundamentals/chapter2.css */

/* Chapter 2 specific styles for Regression Analysis */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Universal text color override */
body,
body *,
main,
main *,
.azbn-section,
.azbn-section *,
.azbn-container,
.azbn-container *,
h1, h2, h3, h4, h5, h6,
p, label, span, div, li, ul, ol, strong, em {
    color: #333;
}

/* Main content styling */
main {
    padding-top: 100px;
}

.azbn-section {
    padding: 2rem 0;
}

.azbn-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Learning Objectives Card */
.learning-objectives-card {
    background: linear-gradient(135deg, #43a047 0%, #1e88e5 100%);
    color: white !important;
    margin-bottom: 2rem;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(67, 160, 71, 0.3);
}

.learning-objectives-card h2 { 
    color: white !important;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.learning-objectives-card ul {
    color: white !important;
}

.learning-objectives-card li {
    color: white !important;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Formula Display */
.formula-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 2px solid #4caf50;
    position: relative;
}

.formula-box::before {
    content: "Formula";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #4caf50;
    color: white !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.formula-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #2e7d32 !important;
}

.formula-display {
    text-align: center;
    font-size: 1.3rem;
    margin: 1rem 0;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Times New Roman', serif;
    font-weight: bold;
}

.formula-explanation {
    margin-top: 1rem;
}

.formula-explanation ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.formula-explanation li {
    margin-bottom: 0.5rem;
}

/* Real-World Examples Grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.example-card {
    background: white;
    border: 2px solid #e3f2fd;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.example-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-color: #2196f3;
}

.example-card h5 {
    margin-bottom: 0.75rem;
    font-weight: bold;
    color: #1976d2 !important;
    font-size: 1.1rem;
}

.example-card p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Mathematical Foundation Box */
.math-foundation {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    border: 2px solid #6c757d;
}

.math-formula {
    text-align: center;
    font-size: 1.4rem;
    margin: 1rem 0;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Regression Types */
.regression-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.regression-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 4px solid #2196f3;
    transition: all 0.3s ease;
}

.regression-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.regression-card h4 {
    color: #1976d2 !important;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Code Examples */
.code-example {
    background: #1e1e1e;
    color: #f8f8f2 !important;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    overflow-x: auto;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
}

.code-example::before {
    content: "Python Code";
    position: absolute;
    top: -10px;
    right: 10px;
    background: #667eea;
    color: white !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
}

/* Model Evaluation Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.metric-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    border-color: #4caf50;
}

.metric-card h5 {
    color: #2e7d32 !important;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Overfitting Prevention */
.overfitting-section {
    background: linear-gradient(135deg, #fff3e0 0%, #ffeaa7 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #ff9800;
    position: relative;
}

.overfitting-section::before {
    content: "Warning";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #ff9800;
    color: white !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Regularization Techniques */
.regularization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.regularization-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #e91e63;
    transition: all 0.3s ease;
}

.regularization-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.regularization-card h5 {
    color: #c2185b !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Practice Problems */
.practice-problem {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #2196f3;
}

.practice-problem h4 {
    color: #1565c0 !important;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Solution Box */
.solution-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    border-left: 4px solid #4caf50;
}

.solution-box h5 {
    color: #2e7d32 !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Interactive Elements */
.interactive-element {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.interactive-element h3,
.interactive-element h4,
.interactive-element p {
    color: white !important;
}

/* Card styling */
.azbn-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.azbn-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.azbn-card h3,
.azbn-card h4 {
    color: #2c3e50 !important;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Button styling */
.azbn-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.azbn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    filter: brightness(1.1);
    color: white !important;
}

.azbn-btn.azbn-secondary {
    background: white;
    color: #667eea !important;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.azbn-btn.azbn-secondary:hover {
    background: #667eea;
    color: white !important;
}

/* Deployment status styling */
.azbn-deployment-status {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
}

.azbn-deployment-status::before {
    content: "Summary";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #4caf50;
    color: white !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.azbn-deployment-status p {
    color: #333 !important;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.azbn-deployment-status p:first-child {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2e7d32 !important;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50 !important;
    font-weight: 700;
    text-align: center;
}

h2 {
    color: #2c3e50 !important;
    margin: 2rem 0 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

h3 {
    color: #34495e !important;
    margin: 1.5rem 0 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .azbn-container {
        padding: 1rem;
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .regression-types {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .regularization-grid {
        grid-template-columns: 1fr;
    }
    
    .formula-display {
        font-size: 1.1rem;
    }
    
    .math-formula {
        font-size: 1.2rem;
    }
    
    .azbn-card,
    .practice-problem,
    .solution-box {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    main {
        padding-top: 80px;
    }
    
    .azbn-container {
        padding: 0.75rem;
        margin: 5px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .formula-display,
    .math-formula {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}