/* Probability Page Styles */

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    margin-bottom: 0;
}

.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="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-explore {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    font-weight: 600;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
}

.btn-explore:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    color: white;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

.breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 30px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.section-title p {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 700px;
    margin: 0 auto;
}

.section-title::after {
    content: '';
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: block;
    margin: 20px auto 0;
    border-radius: 2px;
}

/* Definition Section */
.definition-section {
    padding: 80px 0;
    background: white;
}

.definition-card {
    background: #f8f9fa;
    border-left: 5px solid #667eea;
    padding: 40px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.definition-card h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 2rem;
}

.definition-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #555;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 8px 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.badge-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.badge-success {
    background: linear-gradient(45deg, #26de81, #1dd1a1);
}

.badge-info {
    background: linear-gradient(45deg, #4b6584, #778ca3);
}

.badge-warning {
    background: linear-gradient(45deg, #f7b731, #f5cd79);
}

.badge-danger {
    background: linear-gradient(45deg, #ff6b6b, #ff9ff3);
}

.badge-secondary {
    background: linear-gradient(45deg, #546de5, #8395a7);
}

/* Simulation Cards */
.simulation-card, .calculator-card, .concept-card, .comparison-card, .export-card, .import-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.simulation-card::before, .calculator-card::before, .concept-card::before, 
.comparison-card::before, .export-card::before, .import-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.simulation-card:hover::before, .calculator-card:hover::before, .concept-card:hover::before,
.comparison-card:hover::before, .export-card:hover::before, .import-card:hover::before {
    transform: scaleX(1);
}

.simulation-card:hover, .calculator-card:hover, .concept-card:hover,
.comparison-card:hover, .export-card:hover, .import-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.simulation-card h3, .calculator-card h3, .concept-card h3, 
.comparison-card h3, .export-card h3, .import-card h3 {
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.simulation-card p, .calculator-card p, .concept-card p, 
.comparison-card p, .export-card p, .import-card p {
    color: #7f8c8d;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Simulation Controls */
.simulation-controls {
    background: #f1f2f6;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.simulation-controls label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 10px;
}

.simulation-controls input[type="range"] {
    width: 200px;
    margin-right: 15px;
    vertical-align: middle;
}

.simulation-controls span {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
    display: inline-block;
}

.btn-simulate, .btn-calculate, .btn-export, .btn-import {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    font-weight: 600;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
}

.btn-simulate:hover, .btn-calculate:hover, .btn-export:hover, .btn-import:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    color: white;
}

.btn-export.btn-lg, .btn-import.btn-lg {
    padding: 15px 25px;
    font-size: 1.1rem;
}

/* Canvas Container */
.simulation-canvas-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ddd;
}

.simulation-canvas-container canvas {
    max-width: 100%;
    height: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Simulation Results */
.simulation-results {
    background: #f1f2f6;
    padding: 20px;
    border-radius: 10px;
}

.result-box {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.result-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.result-box h4 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
}

.result-box p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* Formula Styling */
.formula {
    font-family: 'Cambria Math', 'Times New Roman', serif;
    font-size: 1.2rem;
    background: #f1f2f6;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    font-style: italic;
    color: #2c3e50;
    border-left: 3px solid #667eea;
}

/* Calculator Inputs */
.calculator-inputs {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Calculator Results */
.calculator-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.result-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.result-item h4 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.result-item p {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* Concept Icon */
.concept-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.concept-card ol, .concept-card ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.concept-card li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.concept-card strong {
    color: #2c3e50;
}

/* Comparison Cards */
.comparison-card ul {
    padding-left: 0;
    list-style: none;
}

.comparison-card li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
}

.comparison-card li:last-child {
    border-bottom: none;
}

.comparison-card li strong {
    min-width: 120px;
    display: inline-block;
    color: #2c3e50;
}

/* Export/Import Section */
.export-card, .import-card {
    text-align: center;
}

.export-card h3, .import-card h3 {
    justify-content: center;
}

.export-card p, .import-card p {
    margin-bottom: 25px;
}

.form-control-file {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
}

.export-options, .import-options {
    text-align: left;
    background: #f1f2f6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.export-options label, .import-options label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    display: block;
}

.export-options .form-control, .import-options .form-control {
    margin-bottom: 15px;
}

.preview-content {
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.preview-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.export-history {
    text-align: left;
    margin-top: 20px;
}

.export-history h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.list-group {
    max-height: 150px;
    overflow-y: auto;
}

.list-group-item {
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 5px !important;
    margin-bottom: 5px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.simulation-card, .calculator-card, .concept-card, .comparison-card, 
.export-card, .import-card {
    animation: fadeInUp 0.6s ease forwards;
}

.simulation-card:nth-child(1) { animation-delay: 0.1s; }
.simulation-card:nth-child(2) { animation-delay: 0.2s; }
.simulation-card:nth-child(3) { animation-delay: 0.3s; }

.calculator-card:nth-child(1) { animation-delay: 0.1s; }
.calculator-card:nth-child(2) { animation-delay: 0.2s; }

.concept-card:nth-child(1) { animation-delay: 0.1s; }
.concept-card:nth-child(2) { animation-delay: 0.2s; }
.concept-card:nth-child(3) { animation-delay: 0.3s; }
.concept-card:nth-child(4) { animation-delay: 0.4s; }
.concept-card:nth-child(5) { animation-delay: 0.5s; }
.concept-card:nth-child(6) { animation-delay: 0.6s; }

.comparison-card:nth-child(1) { animation-delay: 0.1s; }
.comparison-card:nth-child(2) { animation-delay: 0.2s; }
.comparison-card:nth-child(3) { animation-delay: 0.3s; }

.export-card { animation-delay: 0.1s; }
.import-card { animation-delay: 0.2s; }

/* Responsive Design */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.8rem;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
    
    .simulation-card, .calculator-card, .concept-card, 
    .comparison-card, .export-card, .import-card {
        padding: 25px;
    }
    
    .calculator-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 70px 0;
    }
    
    .hero-section h1 {
        font-size: 2.3rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .definition-card {
        padding: 25px;
    }
    
    .simulation-controls {
        text-align: center;
    }
    
    .simulation-controls input[type="range"] {
        width: 150px;
        margin: 10px 0;
    }
    
    .calculator-results {
        grid-template-columns: 1fr;
    }
    
    .result-box {
        margin-bottom: 15px;
    }
    
    .comparison-card li {
        flex-direction: column;
    }
    
    .comparison-card li strong {
        min-width: auto;
        margin-bottom: 5px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .simulation-card, .calculator-card, .concept-card, 
    .comparison-card, .export-card, .import-card {
        padding: 20px;
    }
    
    .simulation-controls input[type="range"] {
        width: 120px;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .simulation-card:hover, .calculator-card:hover, .concept-card:hover,
    .comparison-card:hover, .export-card:hover, .import-card:hover {
        transform: none;
    }
    
    .btn-explore:hover, .btn-simulate:hover, .btn-calculate:hover,
    .btn-export:hover, .btn-import:hover {
        transform: none;
    }
    
    .result-box:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background: white;
        color: black;
    }
    
    .hero-section {
        background: #000;
        color: white;
    }
    
    .simulation-card, .calculator-card, .concept-card, 
    .comparison-card, .export-card, .import-card {
        border: 2px solid black;
    }
    
    .definition-card {
        border-left: 5px solid black;
    }
}

/* Focus Styles for Keyboard Navigation */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Skip Link for Screen Readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #667eea;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Exercises Section */
.exercises-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
    padding: 60px 0;
}

.exercises-section .section-title h2 {
    color: #2c3e50;
}

.card-header {
    background-color: #667eea;
    color: white;
    border-radius: 8px 8px 0 0 !important;
}

.card-header button {
    color: white;
    text-decoration: none;
    width: 100%;
    text-align: left;
    padding: 15px;
    font-weight: 600;
}

.card-header button:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.card-body {
    background: #fff;
}

.card-body h5 {
    color: #2c3e50;
    margin-top: 15px;
}

.card-body ul {
    padding-left: 20px;
}

.card-body li {
    margin-bottom: 8px;
}

/* MCQ Section */
.mcq-section {
    background: #fff;
    padding: 60px 0;
}

.mcq-section .section-title h2 {
    color: #2c3e50;
}

.mcq-card {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.mcq-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.options .form-check {
    margin-bottom: 10px;
}

.btn-answer {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-answer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: white;
}

.answer {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #667eea;
}

/* Visualization Section */
.visualization-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
    padding: 60px 0;
}

.visualization-section .section-title h2 {
    color: #2c3e50;
}

.visualization-card {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.visualization-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.visualization-card canvas {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 8px;
}

.controls {
    text-align: center;
    margin-top: 20px;
}

.controls .btn {
    margin: 0 5px;
}

/* Applications Section */
.applications-section {
    background: #fff;
    padding: 60px 0;
}

.applications-section .section-title h2 {
    color: #2c3e50;
}

.application-card {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.application-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.application-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.application-card ul {
    padding-left: 20px;
}

.application-card li {
    margin-bottom: 8px;
}

/* Print Styles */
@media print {
    .hero-section, .breadcrumb-nav, .simulation-controls, 
    .btn-simulate, .btn-calculate, .btn-export, .btn-import,
    .export-options, .import-options, .export-history,
    .btn-answer, .controls {
        display: none;
    }
    
    .simulation-card, .calculator-card, .concept-card, 
    .comparison-card, .export-card, .import-card,
    .mcq-card, .visualization-card, .application-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}