/* 기본 타이포 & 배경 */
body {
  padding: 0px;
  margin: 0;
  margin-bottom :20px;
  font-family: "Segoe UI", "맑은 고딕", sans-serif;
  background-color: #ffffff;
  color: #232f3e;
}

.page-inner {
  width: 97%;
  max-width: 900px;
  margin: 0 auto;
}

h1,
h2 {
  color: #232f3e;
}

h1 {
  margin: 22px 0 14px 2px;
  font-size: 21px;
  font-weight: 600;
}

h2 {
  font-size: 17px;
  font-weight: 600;
  border-left: 4px solid #fdb515;
  padding-left: 10px;
  margin-bottom: 12px;
}

.log-title {
  margin-top: 20px;
  font-size: 16px;
}

/* 공통 카드 박스 */
.card {
  background-color: #f8f9fa;
  border: 1px solid #d0d6de;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 세부 카드별 패딩/마진 */
.box,
.ws-box {
  padding: 0 12px 12px 14px;
  margin: 10px 0px 20px 0px;
  
}

.op-box {
  padding: 5px 18px 14px 18px;
  margin-bottom: 18px;
}

/* 행 레이아웃 */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* 텍스트 영역 */
textarea {
  width: 97%;
  min-height: 60px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background-color: #ffffff;
  color: #232f3e;
  border: 1px solid #c4ccd6;
  border-radius: 6px;
  padding: 10px;
}

.json-textarea {
  font-size: 9.5px;
}

#json-area.hidden {
  display: none;
}

#nonjson-area.hidden {
  display: none;
}

/* 버튼 */
button {
  font-size: 14px;
  padding: 8px 14px;
  border: none;
  border-radius: 5px;
  background-color: #2e3b4d;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* 파일 입력 */
input[type="file"] {
  font-size: 12px;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f0f0f0;
  color: #333;
}

input[type="file"]:hover {
  background-color: #e4e4e4;
}

/* 로그 박스 */
.log {
  white-space: pre-wrap;
  background: #f3f5f8;
  border: 1px dashed #c1c7cf;
  border-radius: 8px;
  padding: 12px;
  color: #1f2a37;
}

/* 상단 안내문 */
.notice {
  padding: 12px;
  background-color: #eef2f6;
  border-left: 4px solid #232f3e;
  border-radius: 6px;
  font-size: 13px;
  line-height: 22px;
  color: #333;
}

/* REST URL 텍스트 */
.rest-url {
  font-size: 13px;
  color: #3b4a5f;
  margin: 0;
}

/* 헤더 */
.header-wrap {
  background-color: #232f3e;
  width: 100%;
  height: 75px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 98%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  padding:0px 10px;
}

.header-text {
  color: #ffffff;
  font-size: 14px;
}

/* WebSocket 상태 표시 줄 */
.ws-status {
  margin-top: 8px;
  font-size: 12px;
  color: #4b5563;
}

/* 버튼 행 */
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
  justify-content: flex-end;
}

/* 버튼 링크 */
.btn-link {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  background-color: #2e3b4d;
  color: #ffffff;
  font-size: 14px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  text-align:center;
}

.btn-link:hover {
  background-color: #40516a;
  box-shadow: 0 0 0 2px rgba(253, 181, 21, 0.25);
}

/* 운전 모드 박스 */
.op-title {
  font-size: 17px;
  font-weight: 600;
  border-left: 4px solid #232f32;
  padding-left: 10px;
  margin-bottom: 12px;
}

.op-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  column-gap: 10px;
  row-gap: 8px;
}

.op-btn {
  flex: 1 1 0;
  min-width: 90px;
  padding: 10px 8px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: default;
  background-color: #d1d5db;
  color: #111827;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.op-btn span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}

/* 운전모드 활성 색상 */
.op-btn--auto.is-active {
  background-color: #1b963a;
  color: #ffffff;
}

.op-btn--manual.is-active {
  background-color: #ff9f0a;
  color: #ffffff;
}

.op-btn--stop.is-active {
  background-color: #ff3b30;
  color: #ffffff;
}

.op-btn--mute.is-active {
  background-color: #Ef4b20;
  color: #ffffff;
}

/* WebSocket 입력 박스 */
.ws-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  column-gap: 10px;
  row-gap: 8px;
}

.ws-field {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-field--send {
  flex: 0 0 auto;
}

.ws-label {
  font-size: 13px;
  color: #4b5563;
  font-weight: 600;
}

.ws-input {
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid #c4ccd6;
  background-color: #ffffff;
  box-sizing: border-box;
}

.ws-send-btn {
  align-self: flex-start;
  margin-top: 2px;
}

/* WebSocket send preview */
.ws-preview {
  margin-top: 10px;
  font-size: 13px;
  color: #374151;
}

/* Read용 Grid */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  column-gap: 16px;
  row-gap: 0;
}

/* Read용 field */
.field-half {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 28px;
}

.ws-ReadLabel {
  font-size: 13px;
  color: #4b5563;
  font-weight: 600;
  width: 38%;
  letter-spacing: -0.8px;
}

.ws-ReadValue {
  font-size: 13px;
  font-weight: 200;
  color:#000;
}

/* 배지 영역 */
.badge-row {
  display: flex;
  flex-wrap: wrap;
}

.badge {
  min-width: 80px;
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;  
  border: 1px solid transparent;
  text-align: center;
  margin: 5px 10px 10px 0;
}

/* 배너들의 Boolean 버튼 */

.badge-true {
  background-color: #0966A2;
  color: #FFF;
  border-color: #000;
  font-weight: 600;
}

.badge-false {
  background-color: #e5e7eb;
  color: #4b5563;
  border-color: #d1d5db;
  font-weight: 400;
}

/* 서브 라벨 */
.sub-label {
  font-size: 11px;
  font-weight: 400;
}

/* 모바일 레이아웃 보정 */
@media (max-width: 700px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
  .op-buttons {
    grid-template-columns: 1fr 1fr;
  }
}


@media (max-width: 500px) {
  .ws-grid {
    grid-template-columns: 1fr;
  }

  .btn-row {
    flex-direction: column;
  }
}

/* 모바일용 헤더 스타일 및 여백 조정 */
@media (max-width: 480px) {
  .header-wrap {
    height: auto;
    padding-top: 5px;
    padding-bottom: 6px;
    align-items: flex-start;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .header-text {
    align-self: flex-start;
    margin-top: 5px;
    font-size: 13px;
    text-align: left;
    padding: 0 0 2px 7px;
  }



  .notice {
    margin: 12px 8px 0 8px;
  }

  .btn-row {
    margin: 25px 8px 5px 8px;
  }

  h1 {
    margin: 22px 0 14px 8px;
    font-weight: 800;
  }
  
  .ws-ReadValue {
	width:82px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: clip;
	font-size: 12px;
  }
  
  
  
  .badge {		
	padding: 5px 5px;	
	font-size: 11.5px;
	font-weight: 400;		
	margin: 0px 5px 7px 0px;
  }
  
  
  
}
