/**
 * @fileoverview 단축키 표(오른쪽 서랍 #rd-sec-shortcut) 및 코멘트 편집 모달(#comment-modal) 스타일.
 */

/* Modal overlay with glassmorphism */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Content Box */
.modal-content {
  background: rgba(95, 128, 206, 0.4); /* Dynamic background, will be overridden by JS */
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 16px;
  width: 90%;
  max-width: 650px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(59, 130, 246, 0.25);
  display: flex;
  flex-direction: column;
  color: #f8fafc;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

/* Modal Header */
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #3b82f6;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #ef4444;
}

/* Modal Body */
.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* Modal Table */
.shortcut-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
}

.shortcut-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  text-transform: uppercase;
}

.shortcut-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.shortcut-row {
  cursor: pointer;
  transition: background 0.2s;
}

.shortcut-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.shortcut-row:hover {
  background: rgba(59, 130, 246, 0.12);
}

.shortcut-key-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 6px;
  color: #60a5fa;
  font-family: 'Outfit', 'Inter', monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  min-width: 90px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  white-space: nowrap;
}

.shortcut-row:hover .shortcut-key-btn {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.shortcut-key-btn.recording {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Modal Footer */
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-btn {
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-size: 13px;
  transition: all 0.2s;
}

.modal-btn.reset {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

.modal-btn.reset:hover {
  background: rgba(148, 163, 184, 0.2);
}

.modal-btn.close {
  background: #3b82f6;
  color: #ffffff;
}

.modal-btn.close:hover {
  background: #2563eb;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

/* === Modal Utility Classes === */
.modal-save-btn {
  background: #3b82f6;
  color: #fff;
}

.modal-description {
  margin-bottom: 12px;
  font-size: 13px;
  opacity: 0.8;
}

.modal-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.modal-theme-row-mb {
  margin-bottom: 15px;
}

.modal-theme-row-mt {
  margin-top: 10px;
}

.modal-theme-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-theme-group-grow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  justify-content: flex-end;
}

.modal-theme-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.comment-modal-textarea {
  width: 100%;
  height: 120px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  box-sizing: border-box;
  margin-bottom: 15px;
  outline: none;
}

.comment-duration-input {
  width: 65px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  padding: 3px 5px;
  outline: none;
  text-align: center;
}
