/* Mean Estimation Simulation Styles - MathsVault Styling */

:root {
    --primary: #C90C0F;
    --secondary: #FAB719;
    --light: #FFFFFF;
    --dark: #1D1D1B;
    --gray: #6c757d;
    --light-gray: #f8f9fa;
    --border: #dee2e6;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Main container styling */
.mean-estimation-container {
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: var(--dark);
    line-height: 1.6;
}

.mean-estimation-container h1 {
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: var(--primary);
    font-weight: bold;
    text-transform: capitalize;
    margin-bottom: 1rem;
}

.mean-estimation-container h2,
.mean-estimation-container h3,
.mean-estimation-container h4 {
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: var(--primary);
    text-transform: capitalize;
}

.simulation-area {
    background: var(--light-gray);
    border: 3px solid var(--primary);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.controls {
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.controls .form-range {
    margin: 10px 0;
}

.controls .form-select {
    margin: 10px 0;
}

.controls .form-label {
    font-weight: bold;
    color: var(--dark);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.stat-item {
    padding: 1rem 0;
    border-bottom: 2px solid var(--border);
    font-size: 1.1em;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item strong {
    color: var(--dark);
    display: inline-block;
    width: 200px;
    font-weight: bold;
}

.group-details {
    max-height: 300px;
    overflow-y: auto;
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1rem;
}

.group-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.group-item:last-child {
    border-bottom: none;
}

.group-range {
    font-weight: bold;
    color: var(--dark);
}

.group-midpoint {
    color: var(--primary);
    font-weight: bold;
}

.group-frequency {
    color: var(--secondary);
    font-weight: bold;
}

.formula-box {
    background: var(--light-gray);
    border: 3px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    font-size: 1.2em;
    color: var(--dark);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-weight: bold;
    box-shadow: var(--shadow);
}

.btn {
    margin: 5px;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-weight: bold;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--light);
}

.btn-primary:hover {
    background: #a00a0c;
    border-color: #a00a0c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 12, 15, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #e6a517;
    border-color: #e6a517;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(250, 183, 25, 0.3);
}

.card {
    box-shadow: var(--shadow);
    border: 3px solid var(--primary);
    border-radius: 16px;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
    background: var(--primary);
    color: var(--light);
    border: none;
    font-weight: bold;
    padding: 1.5rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.card-header h3,
.card-header h4 {
    margin: 0;
    color: var(--light);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-weight: bold;
}

.card-body {
    padding: 1.5rem;
    background: var(--light);
}

.lead {
    font-size: 1.1em;
    color: var(--gray);
    margin-bottom: 2rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

/* Form styling to match site */
.form-range {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.form-range::-webkit-slider-track {
    background: var(--border);
    height: 8px;
    border-radius: 4px;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--primary);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-range::-moz-range-track {
    background: var(--border);
    height: 8px;
    border-radius: 4px;
    border: none;
}

.form-range::-moz-range-thumb {
    background: var(--primary);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.form-select {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    background: var(--light);
    color: var(--dark);
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(201, 12, 15, 0.25);
    outline: none;
}

/* Value display styling */
#dataSizeValue,
#groupCountValue {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1em;
    margin-left: 0.5rem;
}

/* Animation for value changes */
.stat-item span {
    transition: color 0.3s ease;
}

.stat-item span.updated {
    color: var(--secondary);
    font-weight: bold;
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "Generating...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary);
    color: var(--light);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: bold;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    z-index: 1000;
}

/* Chart styling overrides */
#histogramChart {
    max-width: 100%;
    height: auto;
}

/* Icon styling */
.fas.fa-chart-bar {
    color: var(--secondary);
    margin-right: 0.5rem;
}

/* Chart legend styling */
.chart-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    background: var(--light);
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-weight: bold;
    color: var(--dark);
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
        padding: 1rem;
    }
    
    .controls {
        padding: 1rem;
    }
    
    .stat-item strong {
        width: 150px;
        font-size: 0.9em;
    }
    
    .formula-box {
        font-size: 1em;
        padding: 1.5rem;
    }
    
    .simulation-area {
        padding: 1rem;
    }
    
    .chart-legend {
        gap: 1rem;
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 250px;
        padding: 0.75rem;
    }
    
    .stat-item {
        font-size: 1em;
    }
    
    .stat-item strong {
        width: 120px;
        font-size: 0.8em;
    }
    
    .group-item {
        font-size: 0.8em;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .formula-box {
        font-size: 0.9em;
        padding: 1rem;
    }
    
    .chart-legend {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .legend-item {
        font-size: 0.9em;
    }
}
