/* static/css/calendar_schedule_link.css */

/* ====== リンク方式選択 ====== */

.schedule-link-mode-box {
  text-align: left;
}

.schedule-link-mode-buttons {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.schedule-link-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 0.0625rem solid #2563eb;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #2563eb;
  font-size: 0.95rem;
  font-weight: bold;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
}

.schedule-link-mode-button:hover {
  background: #eff6ff;
}

.schedule-link-mode-button.is-active {
  background: #2563eb;
  color: #ffffff;
}

.schedule-link-mode-description {
  display: block;
  margin: 0.75rem 0 0;
  padding: 0.2rem 1rem;
  max-width: none;
  border: 0.0625rem solid #bfdbfe;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #1f2937;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.6;
  box-sizing: border-box;
}

.schedule-link-mode-description p {
  margin: 0.25rem 0;
}

/* ====== リンクコピー操作 ====== */

.schedule-link-action-box {
  margin: 0;
  text-align: center;
}

.schedule-link-open-button,
.preview-modal-open-btn {
  width: 100%;
  min-width: 0;
  height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: #767676;
  color: #ffffff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-sizing: border-box;
}

.schedule-link-open-button:hover,
.preview-modal-open-btn:hover {
  background: #4b5563;
  opacity: 0.95;
}

.current-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: stretch;
  margin: 0.75rem 0 0;
}

.current-action-grid .schedule-link-action-box {
  width: 100%;
}

.current-action-grid .schedule-link-open-button,
.current-action-grid .preview-modal-open-btn {
  font-size: 0.85rem;
  padding: 0.625rem 0.25rem;
}

.current-action-grid .schedule-link-action-box[style*="display: none"] + .preview-modal-open-btn {
  grid-column: 1 / -1;
}

/* ====== 日程調整リンクモーダル ====== */

.schedule-link-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
}

.schedule-link-modal.is-open {
  display: block;
}

.schedule-link-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.schedule-link-modal__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(45rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.25);
}

.schedule-link-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f7fbff;
  border-bottom: 0.0625rem solid #dddddd;
}

.schedule-link-modal__header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.schedule-link-modal__close {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.schedule-link-modal__body {
  padding: 1.25rem;
  max-height: calc(100vh - 10.625rem);
  overflow: auto;
}

.schedule-link-modal__footer {
  padding: 0.875rem 1.25rem 1.25rem;
  border-top: 0.0625rem solid #dddddd;
  text-align: right;
}

.schedule-link-modal__button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #4b5563;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
}

.schedule-link-modal__button:hover {
  opacity: 0.9;
}

/* ====== CSV確認モーダル ====== */

.csv-confirm-modal__dialog {
  width: min(22rem, calc(100vw - 2rem));
}

.csv-confirm-modal__body p {
  margin: 0;
  font-size: 1rem;
}

.csv-confirm-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.csv-confirm-modal__cancel {
  background: #9ca3af;
}

.csv-confirm-modal__ok {
  background: #2563eb;
}

/* ====== リンクコピー操作 ====== */

.schedule-link-item {
  border: 0.0625rem solid #d1d5db;
  border-radius: 0.625rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #f9fafb;
}

.schedule-link-item-title {
  font-weight: bold;
  text-align: left;
  margin-bottom: 0.5rem;
}

.schedule-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.schedule-link-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem;
  border: 0.0625rem solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.9rem;
}

.schedule-link-copy-button {
  white-space: nowrap;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
}

.schedule-link-copy-button:hover {
  opacity: 0.9;
}

.schedule-link-open-url-button {
  white-space: nowrap;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  background: #16a34a;
  color: #ffffff;
  cursor: pointer;
}

.schedule-link-open-url-button:hover {
  background: #15803d;
}

.schedule-link-empty {
  padding: 0.75rem;
  color: #555555;
  background: #f3f4f6;
  border-radius: 0.5rem;
  text-align: left;
}

/* ====== スマホ補助 ====== */

@media only screen and (max-width: 43.75rem) {
  .schedule-link-mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .schedule-link-mode-button {
    width: 100%;
  }

  .schedule-link-mode-description {
    max-width: none;
    font-size: 0.85rem;
  }

  .current-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
  }

  .current-action-grid .schedule-link-action-box[style*="display: none"] + .preview-modal-open-btn {
    grid-column: 1 / -1;
  }

  .current-action-grid .schedule-link-open-button,
  .current-action-grid .preview-modal-open-btn {
    width: 100%;
    height: 2.5rem;
    font-size: clamp(0.6rem, 3.2vw, 0.85rem);
    padding: 0.2rem 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.02em;
  }

  .schedule-link-modal__dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .schedule-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .schedule-link-copy-button {
    width: 100%;
  }

  .schedule-link-open-url-button {
    width: 100%;
  }
}