/* iCal(.ics) 이벤트 생성기 전용 스타일 */

nav { max-width: 1000px; }
main { max-width: 1000px; }

.ics-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* 폼 */
.ics-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.form-row {
  display: grid;
  gap: 0.6rem;
}

.form-row-2 {
  grid-template-columns: 1fr 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.form-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--primary);
}

.form-field textarea {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
  line-height: 1.45;
}

.opt-chk {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0;
}
.opt-chk input {
  accent-color: var(--primary);
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.btn-clear {
  margin-top: 0.4rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-clear:hover {
  border-color: var(--error);
  color: var(--error);
}

/* 미리보기 */
.ics-preview {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-h, 56px) + 12px);
  height: fit-content;
  max-height: calc(100vh - var(--header-h, 56px) - 24px);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.preview-actions {
  display: flex;
  gap: 0.35rem;
}

.btn-mini {
  padding: 0.32rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-mini:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-download {
  padding: 0.32rem 0.85rem;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn-download:hover {
  filter: brightness(1.08);
}

.preview-code {
  margin: 0;
  padding: 1rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  flex: 1;
}

@media (max-width: 800px) {
  .ics-grid { grid-template-columns: 1fr; }
  .ics-preview { position: static; max-height: none; }
  .preview-code { max-height: 320px; }
}

@media (max-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr; }
}
