/* Machine Learning in Finance Page - Custom CSS */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Navigation Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    margin-top: 0;
}

/* Keyword Badges */
.keyword-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.keyword-badges .badge {
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
}

.keyword-badges .badge i {
    margin-right: 5px;
}

/* Section Styling */
section {
    padding: 40px 0;
}

section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Card Styles */
.card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.card-header {
    font-weight: bold;
    border-bottom: none;
}

/* Math Formula Styling */
.math-formula {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #3498db;
    font-family: 'Times New Roman', serif;
    font-size: 1.1em;
    margin: 10px 0;
    overflow-x: auto;
}

/* MCQ Styles */
.mcq-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .mcq-container {
        grid-template-columns: 1fr 1fr;
    }
}

.mcq-container .question {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.mcq-container .question:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.mcq-container .question-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mcq-container .question-number {
    background-color: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.mcq-container .form-check {
    padding-left: 25px;
    margin-bottom: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mcq-container .form-check:hover {
    background-color: #f8f9fa;
}

.mcq-container .form-check-input {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
}

.mcq-container .form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    width: 100%;
}

.mcq-container .form-check-input[type="radio"] {
    border: 1px solid #ced4da;
}

.mcq-container .form-check-input[type="radio"]:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.mcq-container .mcq-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.show-answer {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.show-answer:hover {
    background-color: #2980b9;
}

.answer {
    background-color: #e8f4f8;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #2ecc71;
    margin-top: 15px;
    display: none;
}

.answer.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.answer .answer-text {
    color: #27ae60;
    font-weight: 500;
}

.answer .explanation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #2ecc71;
    color: #333;
}

/* Canvas Container */
.canvas-container {
    background-color: #fff;
    border-radius: 5px;
    padding: 15px;
    border: 1px solid #ddd;
}

/* Calculator Styles */
.calculator-form {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
}

.result-display {
    margin-top: 15px;
    padding: 10px;
    background-color: #e8f4f8;
    border-radius: 5px;
    font-weight: bold;
}

/* Table Styles */
.table th {
    background-color: #3498db;
    color: white;
}

/* Accordion Styles */
.accordion .card {
    margin-bottom: 10px;
}

.accordion .card-header {
    cursor: pointer;
}

.accordion .card-header button {
    text-decoration: none;
    width: 100%;
    text-align: left;
}

/* Section Navigation */
.section-nav {
    position: sticky;
    top: 70px;
    z-index: 1000;
}

.section-nav .nav {
    justify-content: center;
}

@media (max-width: 767.98px) {
    .section-nav .nav {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .section-nav .nav .nav-item {
        flex: 1 0 auto;
        text-align: center;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .keyword-badges {
        justify-content: center;
    }
    
    .section-nav {
        top: 0;
    }
    
    .card-body {
        padding: 15px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background-color: white;
        color: black;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .math-formula {
        border-left: 4px solid #000;
    }
    
    .answer {
        border-left: 3px solid #008000;
    }
}

/* Focus Styles for Accessibility */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}