/* ============================================================
   modals.css — 彈窗、預覽、打包面板
   ============================================================ */

/* ─── 彈窗遮罩 ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

/* ─── 彈窗本體 ─── */
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  position: relative;
}
.modal h3 { font-size: 18px; margin-bottom: 16px; text-align: center; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  background: none;
  border: none;
}
.modal-close:hover { color: #1f2937; }
.modal-submit {
  width: 100%;
  padding: 10px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
}
.modal-submit:hover { background: #059669; }
.modal-msg { text-align: center; margin-top: 8px; font-size: 13px; color: #10b981; }
.modal-msg.error { color: #ef4444; }

/* ─── 彈窗欄位 ─── */
.modal-field { display: flex; flex-direction: column; gap: 4px; }
.modal-field label { font-size: 12px; color: #6b7280; }
.modal-field input,
.modal-field select {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
}
.modal-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
  resize: vertical;
}

/* ─── 通知面板 ─── */
.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  z-index: 1001;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-header {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-panel-header h3 { font-size: 16px; }
.notif-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}

/* ─── 預覽覆層 ─── */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}
.preview-overlay.active { display: flex; }
.preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10;
}
.preview-title { color: #fff; font-size: 18px; margin-bottom: 16px; }
.preview-main { max-width: 90vw; margin-bottom: 16px; }
.preview-main-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
}
.preview-thumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.preview-thumb {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
}
.preview-thumb.active { border-color: #10b981; }
.preview-files { display: flex; gap: 8px; margin-bottom: 16px; }
.preview-files span {
  padding: 4px 10px;
  background: #374151;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
}
.preview-dl-area { text-align: center; }
.preview-dl-area button {
  padding: 8px 24px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.preview-dl-area button:hover { background: #059669; }
.preview-dl-area .locked-msg { color: #9ca3af; font-size: 13px; }

/* ─── 打包面板 ─── */
.pack-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
}
.pack-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  z-index: 10000;
  display: none;
  min-width: 300px;
}
.pack-panel h3 { margin: 0 0 20px 0; font-size: 20px; color: #1f2937; }
.pack-category-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.pack-category-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.pack-category-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.pack-close-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 15px;
  background: #f3f4f6;
  color: #6b7280;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.pack-close-btn:hover { background: #e5e7eb; }
