/* ML Fundamentals Chapter 3 Specific Styles */
/* File location: static/css/tutorials/ml_fundamentals/chapter3.css */

/* Chapter 3 specific styles for Classification Algorithms */
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 - excluding code blocks */
body,
main,
.azbn-section,
.azbn-container,
h1, h2, h3, h4, h5, h6,
p, label, span, div, li, ul, ol, strong, em {
    color: #333;
}

/* Code blocks maintain their own colors */

/* 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 !important;
    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, #e91e63 0%, #673ab7 100%);
    color: white !important;
    margin-bottom: 2rem;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 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;
}

/* Classification Problem Definition */
.classification-problem {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 2px solid #4caf50;
}

.classification-formula {
    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;
}

/* Classification Types Grid */
.classification-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

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

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

.classification-type-card h5 {
    margin-bottom: 0.75rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.classification-type-card ul {
    font-size: 0.9rem;
    padding-left: 1.2rem;
}

.classification-type-card li {
    margin-bottom: 0.4rem;
}

/* Binary Classification */
.binary-classification {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #2196f3;
}

.binary-classification h5 {
    color: #1565c0 !important;
}

/* Multi-class Classification */
.multi-class-classification {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
    border-color: #4caf50;
}

.multi-class-classification h5 {
    color: #2e7d32 !important;
}

/* Multi-label Classification */
.multi-label-classification {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-color: #ffc107;
}

.multi-label-classification h5 {
    color: #f57f17 !important;
}

/* Algorithm Comparison */
.algorithm-comparison {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.algorithm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.algorithm-table th,
.algorithm-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #333 !important;
}

.algorithm-table th {
    background: #e91e63;
    color: white !important;
    font-weight: 600;
}

/* Logistic Regression Section */
.logistic-regression {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #2196f3;
}

.sigmoid-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);
}

/* Support Vector Machines */
.svm-section {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #ff9800;
}

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

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

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

.kernel-card h5 {
    color: #e65100 !important;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Model Evaluation Metrics */
.evaluation-metrics {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #4caf50;
}

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

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

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

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

/* Confusion Matrix */
.confusion-matrix {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.matrix-table th,
.matrix-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #e0e0e0;
    color: #333 !important;
}

.matrix-table th {
    background: #e91e63;
    color: white !important;
    font-weight: 600;
}

/* ROC Curve */
.roc-curve {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #ffc107;
}

/* Hyperparameter Tuning */
.hyperparameter-tuning {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #9c27b0;
}

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

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

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

.tuning-card h5 {
    color: #7b1fa2 !important;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Class Imbalance */
.class-imbalance {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid #f44336;
}

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

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

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

.solution-card h5 {
    color: #c62828 !important;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* 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;
}

/* 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);
}

/* Interactive Elements */
.interactive-element {
    background: linear-gradient(135deg, #e91e63 0%, #673ab7 100%);
    color: white !important;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 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 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;
    }
    
    .classification-types-grid {
        grid-template-columns: 1fr;
    }
    
    .kernel-types {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tuning-methods {
        grid-template-columns: 1fr;
    }
    
    .imbalance-solutions {
        grid-template-columns: 1fr;
    }
    
    .sigmoid-formula {
        font-size: 1.2rem;
    }
    
    .classification-formula {
        font-size: 1.1rem;
    }

    .azbn-card,
    .practice-problem {
        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;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .sigmoid-formula,
    .classification-formula {
        font-size: 1rem;
        padding: 0.75rem;
    }
}