/* index.css - Styles for the editor page */

:root {
  --brand: #06C755;
  --primary: #2860ff;
  --bg: #f7f7f9;
  --card-bg: #fff;
  --text: #1c1c1c;
  --text-light: #666;
  --border: #e0e0e0;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

/* Container & Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

/* Panel */
.panel {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

.panel h2 {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

label .required {
  color: #e74c3c;
  margin-left: 4px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

input[type="text"].error,
textarea.error,
select.error {
  border-color: #e74c3c;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-light);
}

.button-inputs {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f0f0f0;
  color: var(--text);
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Status Messages */
.status-message {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  display: block;
}

.status-message.error {
  background: #f8d7da;
  color: #721c24;
  display: block;
}

.status-message.loading {
  background: #d1ecf1;
  color: #0c5460;
  display: block;
}

/* Preview Styles - Full Page Preview */
.loading-text {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 14px;
}

.preview-full-page {
  max-width: 400px;
  margin: 0 auto;
}

.preview-page-header {
  margin-bottom: 16px;
  text-align: left;
}

.preview-page-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #1c1c1c;
}

.preview-page-hint {
  font-size: 13px;
  color: #666;
}

.preview-content-section {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 16px;
  margin: 16px 0;
}

.preview-section-title {
  font-size: 18px;
  margin: 0 0 8px;
  font-weight: 600;
  color: #1c1c1c;
}

.preview-section-desc {
  margin: 0 0 12px;
  color: #555;
  line-height: 1.6;
  font-size: 14px;
}

.preview-section-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 8px;
}

.preview-section-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-helper-text {
  font-size: 12px;
  color: #666;
}

.preview-helper-link {
  color: #2860ff;
  text-decoration: none;
}

.preview-share-btn {
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  background: #06C755;
  color: #fff;
  cursor: default;
  font-size: 14px;
  margin: 16px 0;
}

.preview-divider {
  margin: 32px 0 24px;
  padding-top: 24px;
  border-top: 2px dashed #ddd;
}

.preview-section-label {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
  color: #666;
  text-align: center;
}

/* Preview Styles - LINE Flex Message Card */
.preview-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.preview-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 350px;
  width: 100%;
}

.preview-hero {
  position: relative;
  width: 100%;
  padding-top: 66.67%;
  background: #000;
  overflow: hidden;
}

.preview-hero img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-body {
  padding: 20px;
}

.preview-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #111;
  line-height: 1.4;
}

.preview-info-row {
  display: flex;
  margin-bottom: 20px;
  font-size: 13px;
  gap: 8px;
}

.preview-info-label {
  color: #aaa;
  font-weight: 600;
  min-width: 70px;
  flex-shrink: 0;
}

.preview-info-value {
  color: #666;
  flex: 1;
  word-break: break-word;
}

.preview-desc {
  font-size: 13px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 6px;
}

.preview-footer {
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-btn {
  width: 100%;
  padding: 12px;
  margin: 0;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: default;
  background: #f7f7f7;
  color: #111;
}

.preview-btn-row {
  display: flex;
  gap: 8px;
}

.preview-btn-row .preview-btn {
  flex: 1;
}

.preview-btn.share-btn {
  background: #f0f0f0;
  color: #333;
}
