/* Q4CL カスタムスタイル */

/* フォント設定 */
body {
  font-family: "Biz UDPGothic", "Noto Sans JP", sans-serif;
  line-height: 1.5;
  font-size: 16px;
}

/* 見出しのデフォルトスタイル（Ionic風） */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 500;
  margin-top: 16px;
  margin-bottom: 16px;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 22px;
}

h4 {
  font-size: 20px;
}

h5 {
  font-size: 18px;
}

h6 {
  font-size: 16px;
}

/* 段落のスタイル（Ionic風） */
p {
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* リストのスタイル */
ul, ol {
  margin-top: 0;
  margin-bottom: 16px;
  padding-left: 32px;
}

li {
  margin-bottom: 8px;
}

/* 300ms タップ遅延を回避 */
html {
  touch-action: manipulation;
}

/* カスタムスクロールバー（Webkit系） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* アラート・ダイアログのカスタムスタイル */
.alert-wrapper {
  max-width: min(90vw, 600px);
  max-height: 90vh;
}

/* モーダル背景 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* モーダルコンテンツ */
.modal-content {
  background: white;
  border-radius: 0.5rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 署名パッドモーダル（横向き専用） */
.signpad-modal {
  width: 100%;
  height: 70%;
}

@media (orientation: portrait) {
  .signpad-modal {
    height: 30%;
    top: 35%;
  }
}

/* レンジスライダーのカスタムスタイル */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

/* Webkit系ブラウザ */
input[type="range"]::-webkit-slider-track {
  background: #ddd;
  height: 8px;
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #1d4ed8;
}

/* Firefox */
input[type="range"]::-moz-range-track {
  background: #ddd;
  height: 8px;
  border-radius: 4px;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #2563eb;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb:hover {
  background: #1d4ed8;
}

/* フォーカススタイル */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  border-color: #2563eb;
}

/* ボタン無効化スタイル */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

/* 既に送信済みの背景色 */
.already-sent {
  background-color: #fef9c3 !important; /* bg-yellow-50 */
}

/* デバイス表示モード（デスクトップでのプレビュー用） */
[data-screentype="smartphone"] {
  position: relative;
  width: 360px;
  height: 640px;
  margin: auto;
  border: 16px black solid;
  border-top-width: 60px;
  border-bottom-width: 60px;
  border-radius: 36px;
}

[data-screentype="smartphone"]:before {
  content: "";
  display: block;
  width: 60px;
  height: 5px;
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #333;
  border-radius: 10px;
}

[data-screentype="smartphone"]:after {
  content: "";
  display: block;
  width: 35px;
  height: 35px;
  position: absolute;
  left: 50%;
  bottom: -65px;
  transform: translate(-50%, -50%);
  background: #333;
  border-radius: 50%;
}

[data-screentype="tablet"] {
  position: relative;
  width: 768px;
  height: 1024px;
  margin: auto;
  border: 16px black solid;
  border-top-width: 60px;
  border-bottom-width: 60px;
  border-radius: 36px;
}

[data-screentype="desktop"] {
  position: relative;
  width: 768px;
  margin: auto;
  border: 16px lavender solid;
  border-top-width: 0;
  border-bottom-width: 0;
}

/* 印刷用スタイル */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }
}

/* Ripple Effect (Ionic風) */
.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::after {
  width: 200px;
  height: 200px;
  transition: width 0s, height 0s;
}

/* 太いボーダー */
.border-l-6 {
  border-left-width: 6px;
}

/* ボタンの共通スタイル */
.btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.btn-icon:active {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(0.95);
}

/* ダークモード対応（将来的に） */
@media (prefers-color-scheme: dark) {
  /* ダークモードのスタイルは現状では適用しない */
}
