/* Mario's Epidemic Adventure - Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --background-color: #f8f9fa;
    --deterministic-color: #805ad5;
    --stochastic-color: #3182ce;
    --deterministic_i-color: #e53e3e;
    --stochastic_i-color: #ff6b6b;
    --success-color: #38a169;
    --error-color: #e53e3e;
    --border-color: #e2e8f0;
    
    /* Mario Theme Colors */
    --mario-red: #ff0000;
    --mario-blue: #0099ff;
    --mario-green: #00cc00;
    --mario-yellow: #ffff00;
    --mario-orange: #ff6600;
    --mario-brown: #8b4513;
    --mario-sky: #87ceeb;
    --mario-cloud: #ffffff;
    --mario-grass: #90ee90;
    --mario-dirt: #cd853f;
}

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 20, 0, 0.6) 50%, rgba(0, 0, 0, 0.8) 100%);
    color: var(--primary-color);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Matrix-style falling code background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.matrix-column {
    position: absolute;
    top: -100%;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00;
    animation: matrixFall linear infinite;
    opacity: 0.7;
}

.matrix-column:nth-child(odd) {
    color: #00cc00;
    text-shadow: 0 0 3px #00cc00;
}

.matrix-column:nth-child(3n) {
    color: #00ff66;
    text-shadow: 0 0 4px #00ff66;
}

.matrix-column:nth-child(5n) {
    color: #66ff00;
    text-shadow: 0 0 6px #66ff00;
}

/* Add some epidemiological symbols */
.matrix-column::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff00, transparent);
    animation: matrixGlow 2s ease-in-out infinite;
}

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

@keyframes matrixFall {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Mario Title */
.mario-title {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--mario-red) 0%, #cc0000 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 
        0 8px 0 #8b0000,
        0 12px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid #8b0000;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    text-shadow: 3px 3px 0px #000;
}

.mario-title::before {
    content: '🎮';
    margin-right: 1rem;
}

.mario-title::after {
    content: '🏥';
    margin-left: 1rem;
}

/* Dragon Ball Styles */
.dragon-ball {
    position: fixed;
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 30% 30%, #ffecb3 60%, #ff9800 100%);
    border-radius: 50%;
    border: 3px solid #e65100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    animation: ballSpin 2s linear infinite;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

/* Top ball (1-star) */
.dragon-ball-1 {
    top: 8%;
    right: 4%;
}

/* Bottom right (2-star) */
.dragon-ball-2 {
    top: 16%;
    right: 2%;
}

/* Bottom left (3-star) */
.dragon-ball-3 {
    top: 16%;
    right: 6%;
}

@keyframes ballSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.dragon-ball svg {
    width: 60%;
    height: 60%;
    display: block;
    margin: auto;
}

/* Remove Mario coin styles if desired */
.mario-coin { display: none !important; }

/* Mario Cloud Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, var(--mario-cloud) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, var(--mario-cloud) 0%, transparent 50%),
        radial-gradient(circle at 40% 70%, var(--mario-cloud) 0%, transparent 50%);
    background-size: 200px 200px, 150px 150px, 180px 180px;
    background-position: 0 0, 100px 50px, 50px 150px;
    opacity: 0.3;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.sidebar {
    background: linear-gradient(135deg, var(--mario-brown) 0%, #a0522d 100%);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 
        0 8px 0 #654321,
        0 12px 20px rgba(0, 0, 0, 0.3);
    height: fit-content;
    border: 3px solid #654321;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, var(--mario-yellow), var(--mario-orange));
    border-radius: 15px;
    z-index: -1;
}

.main-content {
    background: linear-gradient(135deg, var(--mario-cloud) 0%, #f0f8ff 100%);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 
        0 8px 0 #d3d3d3,
        0 12px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid #d3d3d3;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, var(--mario-blue), var(--mario-sky));
    border-radius: 15px;
    z-index: -1;
}

.chart-container {
    position: relative;
    height: 500px;
    margin-bottom: 1rem;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--mario-grass) 0%, #98fb98 100%);
    border-radius: 12px;
    box-shadow: 
        0 4px 0 #228b22,
        0 6px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid #228b22;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--mario-red) 0%, #cc0000 100%);
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Press Start 2P', cursive;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
    box-shadow: 
        0 4px 0 #8b0000,
        0 6px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    border: 2px solid #8b0000;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0 #8b0000,
        0 8px 12px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #8b0000,
        0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn.play {
    background: linear-gradient(135deg, var(--mario-green) 0%, #228b22 100%);
    box-shadow: 
        0 4px 0 #006400,
        0 6px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #006400;
}

.btn.play:hover {
    box-shadow: 
        0 6px 0 #006400,
        0 8px 12px rgba(0, 0, 0, 0.4);
}

.btn.play:active {
    box-shadow: 
        0 2px 0 #006400,
        0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn.reset {
    background: linear-gradient(135deg, var(--mario-red) 0%, #cc0000 100%);
    box-shadow: 
        0 4px 0 #8b0000,
        0 6px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #8b0000;
}

.btn.reset:hover {
    box-shadow: 
        0 6px 0 #8b0000,
        0 8px 12px rgba(0, 0, 0, 0.4);
}

.btn.reset:active {
    box-shadow: 
        0 2px 0 #8b0000,
        0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn.speed {
    background: linear-gradient(135deg, var(--mario-yellow) 0%, #ffd700 100%);
    box-shadow: 
        0 4px 0 #b8860b,
        0 6px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #b8860b;
    color: #000;
}

.btn.speed:hover {
    box-shadow: 
        0 6px 0 #b8860b,
        0 8px 12px rgba(0, 0, 0, 0.4);
}

.btn.speed:active {
    box-shadow: 
        0 2px 0 #b8860b,
        0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn.analyze {
    background: linear-gradient(135deg, var(--mario-blue) 0%, #4169e1 100%);
    box-shadow: 
        0 4px 0 #000080,
        0 6px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #000080;
}

.btn.analyze:hover {
    box-shadow: 
        0 6px 0 #000080,
        0 8px 12px rgba(0, 0, 0, 0.4);
}

.btn.analyze:active {
    box-shadow: 
        0 2px 0 #000080,
        0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn-text {
    font-size: 0.9rem;
    font-weight: 700;
}

.status {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-family: 'Press Start 2P', cursive;
    border: 2px solid;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status.running {
    background: linear-gradient(135deg, var(--mario-green) 0%, #98fb98 100%);
    color: #000;
    border-color: #228b22;
}

.status.paused {
    background: linear-gradient(135deg, var(--mario-yellow) 0%, #ffd700 100%);
    color: #000;
    border-color: #b8860b;
}

.status.stopped {
    background: linear-gradient(135deg, var(--mario-red) 0%, #ff6b6b 100%);
    color: white;
    border-color: #cc0000;
}

.error-message {
    display: none;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--mario-red) 0%, #ff6b6b 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 2px solid #cc0000;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--mario-cloud) 0%, #f0f8ff 100%);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #d3d3d3;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Press Start 2P', cursive;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000000;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--mario-red);
    text-shadow: none;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.parameter-controls {
    margin-top: 1.5rem;
}

.parameter-group {
    margin-bottom: 1rem;
}

.parameter-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

.parameter-name {
    font-weight: 500;
    color: var(--mario-cloud);
}

.parameter-value {
    color: var(--mario-yellow);
    font-size: 0.8rem;
}

.parameter-input {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.parameter-input input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--mario-dirt);
    outline: none;
    border: 2px solid #654321;
}

.parameter-input input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--mario-red);
    cursor: pointer;
    border: 2px solid #8b0000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.parameter-input input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #654321;
    border-radius: 4px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    background: var(--mario-cloud);
}

.apply-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--mario-green) 0%, #228b22 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    margin-top: 1rem;
    transition: all 0.2s;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    box-shadow: 0 4px 0 #006400;
    border: 2px solid #006400;
}

.apply-button:hover {
    background: linear-gradient(135deg, #228b22 0%, var(--mario-green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #006400;
}

.apply-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #006400;
}

.summary-stats {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.summary-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.pattern-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.pattern-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.pattern-count {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.pattern-details {
    margin-top: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    color: var(--secondary-color);
}

.detail-value {
    font-weight: 500;
}

.pattern-chart {
    height: 200px;
    margin-top: 1rem;
}

/* Modal styles for pattern details */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background: #fff;
    margin: auto;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    max-width: 700px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    font-family: 'Inter', 'Press Start 2P', cursive, sans-serif;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #e53e3e;
}

.pattern-runs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.run-card {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.run-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.run-radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.run-number {
    font-weight: 600;
    color: var(--accent-color);
    cursor: pointer;
}

.run-stats {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.run-chart {
    height: 150px;
    margin-top: 0.5rem;
}

.download-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    text-align: center;
}

.download-btn {
    background: linear-gradient(145deg, var(--success-color), #2f855a);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all 0.2s;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mario-btn {
    background: linear-gradient(135deg, var(--mario-red) 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Press Start 2P', cursive;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem;
    box-shadow: 
        0 4px 0 #8b0000,
        0 6px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    border: 2px solid #8b0000;
}

.mario-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0 #8b0000,
        0 8px 12px rgba(0, 0, 0, 0.4);
}

.mario-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #8b0000,
        0 4px 6px rgba(0, 0, 0, 0.3);
}

.mario-btn:first-of-type {
    background: linear-gradient(135deg, var(--mario-green) 0%, #228b22 100%);
    box-shadow: 
        0 4px 0 #006400,
        0 6px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #006400;
}

.mario-btn:first-of-type:hover {
    box-shadow: 
        0 6px 0 #006400,
        0 8px 12px rgba(0, 0, 0, 0.4);
}

.mario-btn:first-of-type:active {
    box-shadow: 
        0 2px 0 #006400,
        0 4px 6px rgba(0, 0, 0, 0.3);
}

.pattern-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pattern-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.zoom-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.zoom-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: 2px solid #e55a2b;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    padding: 8px 12px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-family: 'Inter', sans-serif;
}

.zoom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #f7931e, #ff6b35);
}

.zoom-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fit-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-color: #4CAF50;
}

.fit-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.info-icon {
    position: absolute;
    top: 1.5rem;
    right: 2.5rem;
    z-index: 20;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 0.5rem 0.7rem;
    transition: box-shadow 0.2s;
}

.info-icon:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    background: #f0f8ff;
}

#patternModal { display: none; }

@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 0 4vw;
  }
  .sidebar, .main-content {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }
  .sidebar {
    margin-bottom: 24px;
  }
  .threshold-box, .stats, .parameter-group, .parameter-controls {
    max-width: 100vw;
    box-sizing: border-box;
  }
  .parameter-input {
    flex-direction: column;
    gap: 8px;
  }
  .chart-container {
    min-width: 0;
    width: 100vw;
    overflow-x: auto;
  }
  .modal-content {
    width: 95vw !important;
    min-width: 0;
    max-width: 100vw;
  }
  .summary-grid, .threshold-grid {
    grid-template-columns: 1fr;
  }
  input[type="range"], input[type="number"], button, .btn {
    font-size: 1.1em;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
  }
  .parameter-group, .parameter-controls {
    margin-bottom: 18px;
  }
  .parameter-label, .parameter-name, .parameter-value {
    font-size: 1.1em;
  }
} 