/* ============================================================
   엔터프라이즈 그룹웨어 미학 (2000년대 풍)
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  background: #c8d3e5 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4'><path d='M0 0h1v1H0zM2 2h1v1H2z' fill='%23b6c3d8' opacity='0.4'/></svg>") repeat;
  margin: 0;
  padding: 0;
  font-family: Tahoma, '돋움', Dotum, '굴림', Gulim, Arial, sans-serif;
  font-size: 11px;
  color: #1a1a1a;
}

body {
  padding: 16px;
}

main {
  max-width: 760px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #5a7ba8;
  box-shadow: 1px 1px 0 #ffffff inset, 2px 2px 6px rgba(0,0,0,0.2);
}

/* ===== 타이틀 바 ===== */

h1 {
  margin: 0;
  padding: 6px 10px 5px;
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  background: linear-gradient(to bottom,
    #4170b8 0%,
    #2e5896 50%,
    #1d4181 51%,
    #2c548a 100%);
  border-bottom: 1px solid #1a3868;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

h1::before {
  content: '■ ';
  color: #ffd966;
  font-size: 10px;
}

.subtitle {
  background: #ecedf0;
  margin: 0;
  padding: 4px 10px;
  font-size: 11px;
  color: #555;
  border-bottom: 1px solid #b5b5b5;
}

/* ===== 카드(섹션) ===== */

.card {
  margin: 0;
  padding: 8px 10px 10px;
  background: #ffffff;
  border-bottom: 1px solid #d4d4d4;
}

.card h2 {
  margin: 0 0 6px;
  padding: 3px 6px 3px 18px;
  font-size: 11px;
  font-weight: bold;
  color: #2c548a;
  background: #e9eef7 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'><path d='M2 3l3 3 3-3' fill='none' stroke='%232c548a' stroke-width='1.5'/></svg>") no-repeat 6px center;
  border: 1px solid #b5c4dd;
  border-left: 3px solid #2c548a;
}

/* ===== 라벨/입력 ===== */

label {
  display: block;
  font-size: 11px;
  color: #333;
  margin-bottom: 3px;
  font-weight: bold;
}

label::after {
  content: ':';
}

label.checkbox::after { content: ''; }

textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #7f9db9;
  padding: 3px 5px;
  color: #1a1a1a;
  font-family: Tahoma, '돋움', Dotum, sans-serif;
  font-size: 11px;
  border-radius: 0;
  box-shadow: 1px 1px 0 #e6e6e6 inset;
}

textarea {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: 1px dotted #2c548a;
  outline-offset: -3px;
  border-color: #2c548a;
}

input[readonly] {
  background: #f0f0f0 !important;
  color: #555 !important;
  cursor: default;
}

/* ===== 행/필드 ===== */

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.field { min-width: 0; }

/* ===== 버튼 (XP 스타일) ===== */

.actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding: 6px 0 0;
  border-top: 1px dotted #b5b5b5;
}

button {
  padding: 3px 14px;
  font-family: Tahoma, '돋움', Dotum, sans-serif;
  font-size: 11px;
  font-weight: normal;
  color: #1a1a1a;
  background: linear-gradient(to bottom,
    #fdfdfd 0%,
    #ecedf0 45%,
    #d6d8de 50%,
    #c8cbd3 100%);
  border: 1px solid #707b8e;
  border-radius: 2px;
  cursor: pointer;
  min-width: 70px;
  box-shadow: 1px 1px 0 #ffffff inset;
}

button:hover:not(:disabled) {
  background: linear-gradient(to bottom,
    #ffffff 0%,
    #f5f9ff 45%,
    #d3e4fc 50%,
    #b8d3f5 100%);
  border-color: #4a72c8;
}

button:active:not(:disabled) {
  background: linear-gradient(to bottom,
    #b8d3f5 0%,
    #d3e4fc 50%,
    #f5f9ff 55%,
    #ffffff 100%);
  box-shadow: 1px 1px 1px rgba(0,0,0,0.2) inset;
  padding: 4px 13px 2px 15px;
}

button:disabled {
  color: #888;
  background: linear-gradient(to bottom, #ececec, #d5d5d5);
  border-color: #aaa;
  cursor: not-allowed;
  text-shadow: 1px 1px 0 #fff;
}

#download-btn {
  font-weight: bold;
  color: #1a3868;
}

/* ===== 쿠키 섹션 (details) ===== */

.cookie-section {
  margin-top: 8px;
  border: 1px solid #b5c4dd;
  background: #f7f9fc;
}

.cookie-section summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  color: #2c548a;
  padding: 4px 8px;
  background: #e9eef7;
  border-bottom: 1px solid #b5c4dd;
  user-select: none;
  list-style: none;
}

.cookie-section summary::before {
  content: '[+] ';
  font-family: monospace;
  color: #2c548a;
}

.cookie-section[open] summary::before {
  content: '[-] ';
}

.cookie-section[open] summary {
  margin-bottom: 0;
}

.cookie-section > *:not(summary) {
  margin-left: 8px;
  margin-right: 8px;
}

.cookie-section > *:first-of-type {
  margin-top: 8px;
}

.cookie-section > *:last-child {
  margin-bottom: 8px;
}

.hint {
  font-size: 11px;
  color: #555;
  line-height: 1.5;
  margin: 0 0 8px;
  padding: 4px 6px;
  background: #fffceb;
  border: 1px solid #d4c89a;
}

.hint::before {
  content: '※ ';
  color: #c0793c;
  font-weight: bold;
}

.hint code {
  background: #ffffff;
  padding: 0 4px;
  border: 1px solid #c8c8c8;
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: #1a3868;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #333;
  margin-top: 6px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox input {
  width: auto;
  margin: 0;
}

/* ===== 영상 메타 (테이블 느낌) ===== */

#vod-meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  background: #f7f9fc;
  border: 1px solid #b5c4dd;
}

#vod-meta img {
  width: 120px;
  height: 68px;
  border: 1px solid #7f9db9;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

#vod-meta .meta-text {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.6;
}

#vod-meta .meta-title {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #1a3868;
  word-break: break-word;
}

#vod-meta .meta-row {
  font-size: 11px;
  color: #555;
}

#vod-meta .meta-row::before {
  display: inline-block;
  width: 50px;
  color: #888;
  font-weight: normal;
}

#vod-meta .channel {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dotted #c8c8c8;
}

#vod-meta .channel img {
  width: 16px;
  height: 16px;
  border: 1px solid #aaa;
  border-radius: 50%;
}

/* ===== 구간 선택 ===== */

#range-display {
  margin-top: 4px;
  padding: 8px;
  background: #f7f9fc;
  border: 1px solid #b5c4dd;
}

.range-time {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}

.range-time input,
.range-time select {
  text-align: center;
  text-align-last: center;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: bold;
  color: #1a3868;
  padding: 4px 4px;
}

.range-arrow {
  color: #888;
  font-size: 11px;
  user-select: none;
  font-weight: bold;
}

.range-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 6px;
  font-size: 10px;
  color: #888;
  margin-top: 2px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.range-labels span:nth-child(1) { grid-column: 1; }
.range-labels span:nth-child(2) { grid-column: 3; }
.range-labels span:nth-child(3) { grid-column: 5; }

/* ===== 진행 상황 ===== */

#progress-card {
  background: #f7f9fc;
}

progress {
  width: 100%;
  height: 16px;
  margin-bottom: 4px;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #7f9db9;
  background: #ffffff;
  border-radius: 0;
}

progress::-webkit-progress-bar {
  background: #ffffff;
}

progress::-webkit-progress-value {
  background: linear-gradient(to bottom,
    #6ba3e5 0%,
    #3b78c8 50%,
    #2c548a 100%);
}

progress::-moz-progress-bar {
  background: linear-gradient(to bottom,
    #6ba3e5 0%,
    #3b78c8 50%,
    #2c548a 100%);
}

#progress-text {
  font-size: 11px;
  color: #1a3868;
  margin-bottom: 4px;
  font-weight: bold;
}

#progress-text::before {
  content: '> ';
  color: #2c548a;
}

#log {
  background: #1a1a1a;
  border: 1px solid #444;
  border-top: 2px solid #000;
  color: #b5e3b5;
  padding: 6px 8px;
  font-size: 10px;
  font-family: 'Courier New', monospace;
  line-height: 1.4;
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-error { color: #ff8585; }
.log-success { color: #ffeb70; }

/* ===== 푸터 ===== */

footer {
  padding: 8px 12px 10px;
  background: linear-gradient(to bottom, #ecedf0, #d4d6dd);
  border-top: 1px solid #b5b5b5;
  text-align: center;
}

.footer-note {
  font-size: 10px;
  color: #6b6b6b;
  line-height: 1.5;
  letter-spacing: -0.2px;
}

.footer-link {
  margin-top: 3px;
  font-size: 10px;
}

.footer-link a {
  color: #4a72a8;
  text-decoration: none;
  border-bottom: 1px dotted #8aa4c2;
}

.footer-link a:hover {
  color: #1a3868;
  border-bottom-style: solid;
  border-bottom-color: #1a3868;
}

.footer-link a:visited {
  color: #6b5a8a;
}