/* From simulator_top.css */
.sim-container {
    padding: 20px;
    text-align: center;
}

.sim-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
}

.sim-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sim-title h1 {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin: 0;
    cursor: pointer;
}

.sim-controls {
    display: flex;
    gap: 15px;
}

.mode-box,
.sim-box,
.speed-box,
.light-box,
.source-box,
.pump-box,
.demand-box {
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 20px 15px 10px 15px;
    position: relative;
    background-color: #fff;
}

.speed-box,
.demand-box {
    padding: 20px 8px 10px 8px;
    /* top, right, bottom, left */
}

.box-title {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 3px 10px;
    font-size: 16px;
    font-weight: bold;
    color: #BF5700;
    white-space: nowrap;
}

.mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 2px;
}

.light-box .mode-grid,
.source-box .mode-grid,
.pump-box .mode-grid {
    grid-template-columns: 1fr;
    margin-top: 0px;
}

.mode-btn {
    padding: 5px 10px;
    font-size: 14px;
    font-weight: bold;
    background-color: #ddd;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.mode-btn.active {
    background-color: #BF5700;
    color: white;
}

.mode-btn:hover {
    background-color: #ccc;
}

.speed-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.speed-input {
    width: 60px;
    padding: 5px 5px;
    font-size: 12px;
    border-radius: 6px;
}

.speed-input input {
    width: 50px;
    font-size: 12px;
    text-align: left;
}

.speed-unit {
    position: absolute;
    right: 5px;
    font-size: 14px;
    color: #555;
}

.demand-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.demand-input {
    display: flex;
    padding: 5px 0px;
    gap: 5px;
    align-items: center;
}

.demand-input input {
    width: 35px;
    font-size: 12px;
}

.demand-unit {
    width: 40px;
    font-size: 12px;
}

.scram-box {
    display: flex;
    align-items: center;
}

.scram-btn {
    background-color: red;
    color: white;
    font-size: 28px;
    font-weight: bold;
    padding: 30px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
}

.scram-btn:hover {
    background-color: darkred;
}

/* Overall simulator layout */
.sim-layout {
    display: flex;
    height: calc(100vh - 160px);
    margin: 0px 20px;
    gap: 10px;
    min-width: 0;
}

.sim-left {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sim-right {
    flex: 7;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 10px;
}

.warning-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% - 40px);
    /* 좌우 마진 고려 */
    margin: 0px 20px 10px 20px;
    /* 윗쪽 margin을 0으로 조정 */
    gap: 5px;
}

.warning-box {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    background-color: #9dfb71;
    color: #000000;
    font-weight: bold;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}

/* From simulator_left.css */
.left-box {
    background-color: #f4e8d4;
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 0;
    font-weight: bold;
    text-align: center;
}

.left-top {
    flex: 4;
    background-color: #ffefd5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0; /* Allow shrinking below content size */
}

.left-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.left-mid {
    flex: 4;
    background-color: #e0ffff;
    display: flex;
    flex-direction: column;
}

.left-bot {
    flex: 2;
    background-color: #ffe4e1;
}

.rod-track-container {
    flex: 1;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    background: linear-gradient(to bottom, blue 55%, red 45%);
    padding: 0;
    border-radius: 10px;
    gap: 2%;
}

.rod-track {
    flex: 0 0 8%;
    height: 100%;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: transparent;
    border: 1px solid #aaa;
}

.rod-gray-wrapper {
    position: absolute;
    top: 0;
    width: 100%;
    height: 55%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.2s ease;
    z-index: 1;
}

.rod-gray {
    height: 90%;
    width: 100%;
    background: linear-gradient(to right, #555, #aaa, #555);
    transition: height 0.2s ease;
}

.rod-yellow {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 10%;
    background: linear-gradient(to right, #cccc00, #ffff00, #cccc00);
    z-index: 2;
}

.rod-green {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 45%;
    background: linear-gradient(to right, #006400, #32cd32, #006400);
    z-index: 2;
    transition: transform 0.2s ease;
}

.rod-name {
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    padding: 5px 0;
}

.rod-controls {
    padding: 10px;
    background-color: #f7f7f7;
    border-radius: 8px;
}

.rod-grid {
    display: grid;
    grid-template-columns: 0.5fr repeat(4, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 5px;
    text-align: center;
}

.rod-value {
    font-weight: bold;
    font-size: 15px;
    background-color: #fff;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
}

.rod-btn {
    font-size: 15px;
    padding: 6px;
    border: none;
    border-radius: 6px;
    background-color: #eee;
    cursor: pointer;
}

.rod-btn:hover {
    background-color: #ccc;
}

.rod-btn.active {
    background-color: #BF5700;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

#fire-btn {
    grid-row: 1 / 5; /* Span all 4 rows */
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    font-size: 18px;
    font-weight: bold;
    background-color: #d9534f; /* A shade of red */
    color: white;
}

#fire-btn:hover {
    background-color: #c9302c;
}

/* From simulator_right.css */
.right-box {
    background-color: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    height: 100%;
    box-sizing: border-box;
}

.dual-panel {
    flex: 4;
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    gap: 10px;
}

.status-panel {
    flex: 2;
    line-height: 1.2;
    padding: 0.2vh;
    height: 100%;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: calc(1.0vh + 2px);
    font-weight: bold;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 1fr; /* Each row takes equal space */
    gap: 0.5vh; /* Reduced gap */
    height: 100%; /* Make it fill the remaining space */
    padding: 0.2vh;
    box-sizing: border-box;
}

.status-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2vh; /* Reduced padding */
    font-weight: bold;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-title-cell {
    text-align: center;
    font-size: calc(1.5vh + 6px); /* Responsive font size for title */
    font-weight: bold;
    color: #BF5700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0; /* Removed margin */
}

.chatbot-panel h3 {
    margin-top: 0;
    margin-bottom: 1.5vh; /* Responsive margin */
    font-size: calc(1.5vh + 6px); /* Responsive font size for title */
    text-align: center;
    color: #BF5700;
}

.status-line {
  display: grid;
  grid-template-columns: 70px auto;
  /* margin-bottom: 15px; */
  font-size: 1em;
}

.status-label {
  text-align: right;
  padding-right: 5px;
  font-weight: bold;
}

.text-display {
    flex-grow: 1; /* Allow text display to take available space */
    overflow-y: auto; /* Enable scrolling for long content */
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    margin-bottom: 10px; /* Space before separator */
    line-height: 1.5;
    font-size: calc(1.0vh + 2px);
}

.right-bot {
    flex: 6;
    background-color: #b0e0e6;
    min-height: 0;
    overflow: hidden;
}

.plot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  height: 100%;
}

.plot-box {
  border: 1px solid #ccc;
  background-color: #fafafa;
  border-radius: 8px;
  padding: 0px;
  overflow: hidden;
}

.plotly .xtick text,
.plotly .ytick text,
.plotly .legend text {
  font-size: 10px !important;
}

.chatbot-controls label {
    font-weight: normal;
    font-size: calc(1.0vh + 1px);
}

#restart-button {
    background-color: #d3d3d3;
    color: black;
    width: 80px; /* Match Python's fixed width */
    margin-left: auto; /* Push to the right */
}

/* From simulator.html */
.download-section {
    margin-top: 10px;
    color: rgb(0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 20px;
}

.download-section span {
    margin-right: 10px;
}

.download-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    font-weight: bold;
}

.download-btn:hover {
    background-color: #e0e0e0;
}

.download-section a:not(:last-child) {
    margin-right: 10px;
}

.chatbot-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    height: 100%;
    box-sizing: border-box;
    flex: 6;
}

.chatbot-panel h3 {
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
}

.chatbot-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.chatbot-controls select,
.chatbot-controls button {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-weight: normal;
    height: 35px;
}

#restart-button:hover {
    background-color: #b0b0b0;
}

#restart-button:active {
    background-color: #808080;
    border-style: inset;
}

.separator {
    border: none;
    border-top: 1px solid #ccc;
    margin: 10px 0;
}

.step-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background-color: white;
    z-index: 10;
}

.step-controls button {
    padding: 8px 16px;
    border: 1px solid #999;
    border-radius: 5px;
    background-color: #d3d3d3;
    color: black;
    font-weight: normal;
    height: 35px;
    width: 100px;
}

.step-controls button:hover {
    background-color: #b0b0b0;
}

.step-controls button:active {
    background-color: #808080;
    border-style: inset;
}

#step-label {
    font-weight: normal;
    text-align: center;
    flex-grow: 1;
}

.new-panel-placeholder {
    flex: 1.2;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.rho-calc-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5vh;
    padding: 1vh;
    align-items: center;
    font-size: calc(1.0vh + 2px);
}

.rho-calc-grid input {
    width: 100%;
    padding: 0.5vh;
    box-sizing: border-box;
    font-size: 1em;
}

.rho-calc-grid .hr-div {
    grid-column: 1 / -1;
    height: 1px;
    background-color: #ccc;
    margin: 0.5vh 0;
}

.rho-calc-btn-container {
    grid-column: 1 / -1;
    padding-top: 0.5vh;
}

#rho-calc-apply-btn {
    width: 100%;
    padding: 1vh;
    font-weight: normal;
    font-size: calc(1.0vh + 2px);
    border: 1px solid #999;
    border-radius: 5px;
    background-color: #d3d3d3;
    color: black;
    cursor: pointer;
}

#rho-calc-apply-btn:hover {
    background-color: #b0b0b0;
}

/* Fullscreen styles */
#fullscreen-container:fullscreen {
    background-color: white; /* Or your desired background */
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: auto; /* In case content overflows */
}

#fullscreen-container:-webkit-full-screen {
    background-color: white;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

#fullscreen-container:-moz-full-screen {
    background-color: white;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

#fullscreen-container:-ms-fullscreen {
    background-color: white;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* Hide header and footer when in fullscreen */
:fullscreen ~ header,
:fullscreen ~ footer {
    display: none !important;
}

:-webkit-full-screen ~ header,
:-webkit-full-screen ~ footer {
    display: none !important;
}

:-moz-full-screen ~ header,
:-moz-full-screen ~ footer {
    display: none !important;
}

:-ms-fullscreen ~ header,
:-ms-fullscreen ~ footer {
    display: none !important;
}

/* Adjust main content padding when in fullscreen */
:fullscreen ~ main {
    padding: 0 !important;
}

:-webkit-full-screen ~ main {
    padding: 0 !important;
}

:-moz-full-screen ~ main {
    padding: 0 !important;
}

:-ms-fullscreen ~ main {
    padding: 0 !important;
}