/**
 * @fileoverview 기보 보관함 목록(.saved-record-row), 메타데이터 폼 스타일. 2026-11-20부터 기보보기 패널(#preview-panel) 안에 들어 있다.
 */

.record-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  position: relative;
  background: rgba(15, 23, 42, 0.2);
}

.record-title {
  font-size: 1.25em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

#close-record-btn {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.4em;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.1s;
}

#close-record-btn:hover {
  color: #f8fafc;
}

#close-record-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.record-header-actions {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}

.record-header-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #f8fafc;
  font-weight: bold;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s, transform 0.1s, border-color 0.2s;
}

.record-header-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.record-header-btn:active {
  transform: scale(0.95);
}

.record-header-btn.primary {
  background: #3b82f6;
  border: none;
  color: white;
}

.record-header-btn.primary:hover {
  background: #2563eb;
}

.record-textarea-wrapper textarea {
  width: 100%;
  height: 100px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f1f5f9;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  resize: none;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.record-textarea-wrapper textarea:focus {
  border-color: #3b82f6;
}

.record-import-btn {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: #3b82f6;
  color: white;
  font-weight: bold;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.record-import-btn:hover {
  background: #2563eb;
}

.record-import-btn:active {
  transform: scale(0.98);
}

/* Saved Records List Container & Items */
.saved-records-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
  padding-right: 4px;
}

.saved-records-empty {
  text-align: center;
  padding: 24px 0;
  color: #64748b;
  font-size: 0.9em;
}

.saved-record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 16px;
  transition: background-color 0.2s, border-color 0.2s;
}

.saved-record-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.saved-record-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.saved-record-name {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.92em;
  word-break: break-all;
  line-height: 1.4;
}

.saved-record-date {
  font-size: 0.78em;
  color: #94a3b8;
}

.saved-record-actions {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.saved-record-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, transform 0.1s;
}

.saved-record-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.saved-record-btn:active {
  transform: scale(0.9);
}

.saved-record-btn.load-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.saved-record-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Square buttons for record save/load */
.record-square-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.55);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.record-square-btn:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.record-square-btn:active {
  transform: scale(0.95);
}

.record-square-btn.success {
  background: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.6) !important;
}

/* Highlight style for currently loaded record */
.saved-record-row.active {
  background: rgba(59, 130, 246, 0.12) !important;
  border-left: 3px solid #3b82f6 !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}

.saved-record-row.active .saved-record-name {
  color: #60a5fa !important;
  font-weight: bold;
}

/* Edit button inline next to record name */
.record-edit-inline-btn {
  background: none;
  border: none;
  padding: 2px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  border-radius: 4px;
}

.record-edit-inline-btn:hover {
  color: #60a5fa;
}

.record-edit-inline-btn:active {
  transform: scale(0.9);
}

.saved-record-btn.edit-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Collapsible accordion and icon action buttons in record-box */
.record-header-action-icon-btn {
  background: none;
  border: none;
  padding: 6px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.record-header-action-icon-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

.record-header-action-icon-btn:active {
  transform: scale(0.92);
}

.record-header-action-icon-btn.success {
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* === Record Utility Classes === */
.record-meta-textarea {
  width: 100%;
  height: 50px;
  resize: none;
  font-size: 0.95em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: #cbd5e1;
  padding: 8px 10px;
  font-family: inherit;
}

.record-full-width-input {
  width: 100%;
}

.meta-summary-textarea {
  width: 100%;
  height: 50px;
  resize: none;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  padding: 4px;
  font-size: 0.9em;
  box-sizing: border-box;
}

.step-comment-section {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

.step-comment-title {
  font-size: 0.9em;
  display: block;
  margin-bottom: 6px;
}

.step-comment-input {
  width: 100%;
}
