/* --- PAGE BASE --- */

body.page-simulation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 10px 20px 20px 20px;
    position: relative;
}

/* --- STATUS BADGE --- */

#stateText {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: var(--av-grey-ui);
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#stateDot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-settled { color: #e74c3c; }
.status-settled #stateDot {
    background-color: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}

.status-active { color: var(--av-orange); }
.status-active #stateDot {
    background-color: var(--av-orange);
    box-shadow: 0 0 8px rgba(255, 69, 0, 0.4);
}

.status-complete { color: #27ae60; }
.status-complete #stateDot {
    background-color: #27ae60;
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.4);
}

.status-config { color: #95a5a6; }
.status-config #stateDot { background-color: #95a5a6; }



/* --- SIMULATION JAR --- */
.simulation-wrapper {
    position: relative;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.25);
    border-radius: 24px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 400/380;
    background: #2c3e50;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#simCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* --- LAYOUT --- */

.sim-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 130px; 
    gap: 30px;
}

.header-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
    margin-bottom: 0; 
    gap: 30px;
}

h2 {
    margin: 0;
    color: #111;
    font-family: var(--font-header);
    font-size: clamp(1.5rem, 5vw, 3rem);
    white-space: nowrap;
    line-height: 1.1;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    color: #444;
    line-height: 1.6;
    margin: 0;
    max-width: 700px;
}

.canvas-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* --- CONTROLS --- */

.control-capsule {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 6px;
    border-radius: 100px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    gap: 8px;
}

.toggle-group {
    display: flex;
    background: var(--av-grey-ui);
    border-radius: 50px;
    padding: 3px;
    flex: 1;
}

.btn-toggle {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    height: 36px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: #95a5a6;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-toggle.active {
    background: #ffffff;
    color: #2c3e50;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-toggle:hover:not(.active) { color: #555; }

.btn-action {
    border: 1px solid transparent;
    background: var(--av-orange);
    color: #ffffff;
    height: 42px;
    padding: 0 28px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.2);
    min-width: 110px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.btn-action:hover {
    transform: translateY(-1px);
    background: var(--av-orange-dark);
    box-shadow: 0 6px 16px rgba(255, 69, 0, 0.3);
}

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

.btn-reset {
    background: rgba(255, 69, 0, 0.1);
    color: var(--av-orange);
    box-shadow: none;
    font-weight: 700;
}

.btn-reset:hover {
    background: rgba(255, 69, 0, 0.18);
    transform: translateY(-1px);
}

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

@keyframes border-breathe {
    0% { border-color: transparent; }
    50% { border-color: var(--av-orange); }
    100% { border-color: transparent; }
}

.btn-breathe { animation: border-breathe 3s infinite ease-in-out; }

/* --- DISCLAIMER --- */

.disclaimer {
    margin-top: 50px;
    font-size: 0.75rem;
    color: #666;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-align: center;
    padding: 20px;
}

/* --- MOBILE RESPONSIVE --- */

@media (max-width: 600px) {
    body.page-simulation { padding-top: 20px; }
    .sim-container { margin-top: 100px; }
    h2 { font-size: 2.2rem; white-space: nowrap; }
    .info { font-size: 1.0rem; }
    .control-capsule { gap: 8px; padding: 5px; }
    .toggle-group { flex: 1; padding: 4px; }
    .btn-toggle { height: 44px; font-size: 0.85rem; gap: 6px; }
    .btn-action { height: 44px; padding: 0 26px; font-size: 0.85rem; }
}
