/* Monte Carlo Interface */
.monte-carlo-interface {
    margin-bottom: 3rem;
}

/* Simulator Card */
.simulator-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.simulator-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Two Column Layout */
.simulator-layout {
    display: flex;
    min-height: 600px;
}

.input-column,
.results-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.input-column {
    min-width: 0;
    padding: 2rem 3rem;
}

.results-column {
    min-width: 0;
    background: #f9fafb;
}

/* Divider */
.divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e5e7eb 10%, #e5e7eb 90%, transparent);
    flex-shrink: 0;
}

/* Column Headers */
.column-header {
    margin-bottom: 1.5rem;
}

.column-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #111827;
}

.column-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.simulator-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

/* Control Groups */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.label-text {
    color: #111827;
}

.label-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.control-input,
.control-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
}

.control-input:focus,
.control-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.control-input:hover,
.control-select:hover {
    border-color: #d1d5db;
}

.control-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    pointer-events: none;
}

.control-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Parameter Rows */
.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    font-size: 0.9375rem;
}

/* Results Column Content */
.results-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-text {
    font-size: 1rem;
    color: #9ca3af;
    margin: 0;
}

.results-display {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.simulation-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(236px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid;
}

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

.stat-primary {
    border-left-color: #3b82f6;
}

.stat-success {
    border-left-color: #10b981;
}

.stat-warning {
    border-left-color: #f59e0b;
}

.stat-info {
    border-left-color: #6366f1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.stat-primary .stat-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.stat-success .stat-icon {
    background: #d1fae5;
    color: #10b981;
}

.stat-warning .stat-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.stat-info .stat-icon {
    background: #e0e7ff;
    color: #6366f1;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    word-break: break-all;
}

/* Visualization Card */
.visualization-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.viz-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.viz-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bins-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.bins-input {
    width: 60px;
    padding: 0.375rem 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
}

.bins-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.histogram-container {
    width: 100%;
    height: 300px;
    position: relative;
    min-height: 300px;
    background: #ffffff;
    border-radius: 8px;
}

#histogram-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Sample Data Card */
.sample-data-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sample-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sample-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.btn-copy {
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.sample-content {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
}

.sample-values {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

.sample-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.sample-note {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .simulator-layout {
        flex-direction: column;
        min-height: auto;
    }

    .divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(to right, transparent, #e5e7eb 10%, #e5e7eb 90%, transparent);
    }

    .input-column,
    .results-column {
        padding: 1.5rem;
    }

    .results-column {
        background: #f9fafb;
    }
}

@media (max-width: 767px) {
    .input-column,
    .results-column {
        padding: 1.25rem;
    }

    .column-title {
        font-size: 1.25rem;
    }

    .simulator-controls {
        gap: 1.25rem;
    }

    .param-row {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .visualization-card,
    .sample-data-card {
        padding: 1rem;
    }

    .histogram-container {
        height: 250px;
    }

    .viz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .input-column,
    .results-column {
        padding: 1rem;
    }

    .simulator-controls {
        gap: 1rem;
    }

    .control-input,
    .control-select {
        padding: 0.625rem 0.875rem;
        font-size: 0.9375rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .histogram-container {
        height: 200px;
    }

    .empty-state {
        padding: 1.5rem 1rem;
    }
}

/* Loading State */
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}
