/*
 * Kerangka gaya bersama untuk seluruh bahan ajar visual.
 * Dipakai oleh semua halaman materi (mis. flash.html) lewat:
 *   <link rel="stylesheet" href="assets/css/common.css">
 */

* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #0d3b66; /* senada dengan warna navy header di index.html */
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

h2 {
    text-align: center;
    color: #333;
    margin-top: 0;
}

/* Controls Section */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    background: #dfeaf7; /* senada dengan --blue-light di index.html, sedikit lebih pekat dari body */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    font-weight: bold;
    color: #444;
}

.control-group label {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn:hover {
    background: #1976D2;
}

/* Layout berdampingan untuk diagram + grafik (dipakai materi apa pun yang butuh) */
.simulation-layout {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap; /* Responsif untuk layar kecil */
}

.canvas-container {
    border: 2px solid #ccc;
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden; /* Mencegah konten keluar dari border */
    max-width: 100%;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Konten yang hanya perlu terbaca screen reader, tidak tampil visual */
.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;
}

/* Modal / Pop-up Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 650px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    line-height: 1.6;
    font-size: 14px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
}

.modal-content h3 {
    margin-top: 0;
    border-bottom: 2px solid #2196F3;
    padding-bottom: 8px;
}
