/* Derivative Pricing 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 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* Canvas Styles */
canvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    width: 100%;
    max-width: 500px;
    height: auto;
}

/* Form Styles */
.form-control, .form-control-range {
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-control-range:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Button Styles */
.btn {
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-success:hover {
    background-color: #219653;
    border-color: #219653;
}

.btn-info {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-info:hover {
    background-color: #1c6ea4;
    border-color: #1c6ea4;
}

/* Accordion Styles */
.accordion .card {
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.accordion .card-header {
    background-color: #f8f9fa;
    border-bottom: 0;
    padding: 15px;
    cursor: pointer;
}

.accordion .card-body {
    padding: 20px;
}

/* MCQ Styles */
.mcq-container .card {
    border-left: 4px solid #3498db;
}

.mcq-container .form-check {
    margin-bottom: 10px;
}

.mcq-container .form-check-label {
    cursor: pointer;
}

.show-answer-btn {
    font-size: 0.85rem;
}

.answer-section {
    margin-top: 10px;
}

/* Table Styles */
.table {
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.table th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
}

.table td, .table th {
    padding: 12px;
    vertical-align: middle;
}

/* Section Navigation */
.section-nav {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.nav-tabs .nav-link {
    color: #333;
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.nav-tabs .nav-link.active {
    color: #3498db;
    background-color: #fff;
    border-color: #3498db #3498db #fff;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #f8f9fa;
}

/* Footer */
footer {
    margin-top: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .keyword-badges {
        justify-content: center;
    }
    
    .keyword-badges .badge {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    section {
        padding: 20px 0;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    canvas {
        max-width: 100%;
        height: auto;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background-color: #fff;
        color: #000;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .table th {
        background-color: #000;
        color: #fff;
    }
    
    .btn {
        border: 2px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .hero-section {
        background: linear-gradient(135deg, #4a0eb0 0%, #1a5ca3 100%);
    }
    
    .card {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }
    
    .card-header {
        background-color: #3a3a3a;
        color: #e0e0e0;
    }
    
    .table {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }
    
    .table th {
        background-color: #1a5ca3;
        color: #fff;
    }
    
    footer {
        background-color: #0d0d0d;
    }
}

/* Animation for interactive elements */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus, .form-control:focus, .form-check-input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar, .section-nav, .btn {
        display: none;
    }
    
    body {
        background-color: #fff;
        color: #000;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Formula styling */
.formula {
    font-family: 'Cambria Math', 'Times New Roman', serif;
    font-size: 1.2em;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    overflow-x: auto;
}

/* Greeks specific styling */
.greeks-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.greeks-table th, .greeks-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.greeks-table th {
    background-color: #f2f2f2;
}