@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  .btn-primary {
    @apply inline-block px-4 py-2 bg-primary text-white rounded-lg font-semibold text-center transition-all duration-200 ease-in-out;
    @apply hover:bg-primary-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50;
    @apply active:bg-primary-dark transform active:scale-95;
  }
  
  .btn-primary-outline {
    @apply inline-block px-4 py-2 border-2 border-primary text-primary rounded-lg font-semibold text-center transition-all duration-200 ease-in-out;
    @apply hover:bg-primary hover:text-white focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50;
  }
  
  .btn-primary-sm {
    @apply btn-primary px-3 py-1.5 text-sm;
  }
  
  .btn-primary-lg {
    @apply btn-primary px-6 py-3 text-lg;
  }


}
  @property --radialprogress {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
  }
/* Devise Forms Common Styles */

.devise-form-container {
  width: 90%;
  max-width: 400px;
  padding: 40px 30px;
  /* background-color: white; */
  border-radius: 12px;
  /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); */
  text-align: center;
  margin: 0 auto;
  position: relative;
}

.devise-form-title {
  margin: 0 0 40px 0;
  padding: 0;
  font-size: 28px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.devise-form-description {
  margin: 0 0 32px 0;
  padding: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

.devise-form-field {
  margin-bottom: 24px;
  text-align: left;
}

.devise-form-field.last {
  margin-bottom: 32px;
}

.devise-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.devise-form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
  background-color: white;
  color: black;
}

.devise-form-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #FC913A 100%);
  background-color: #FC913A;
  color: white;
  border: 2px solid #FC913A;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  margin-bottom: 32px;
}

.devise-form-divider {
  border-top: 1px solid #FED7AA;
  padding-top: 24px;
}

.devise-form-options-title {
  margin: 0 0 32px 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.devise-form-password-hint {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #666;
}

/* Devise Links Styles */

.devise-primary-link {
  display: inline-block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #FC913A 100%);
  background-color: #FC913A;
  color: white;
  text-decoration: none;
  border: 2px solid #FC913A;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  margin-bottom: 16px;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.devise-secondary-link {
  color: #FC913A;
  text-decoration: underline;
  font-size: 14px;
  margin-bottom: 8px;
  display: inline-block;
}

.devise-secondary-link:hover {
  color: #e8820a;
}
/* ギフト記録フォーム用スタイル */

/* selectフィールドの統一的なスタイリング（二重矢印問題の解決） */
select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* 必須フィールドのインジケーター */
.form-label.required::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* 日付フィールドの強化 */
input[type="date"] {
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  background: transparent;
  bottom: 0;
  color: transparent;
  cursor: pointer;
  height: auto;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
}

/* フォームバリデーション状態 */
.form-control.is-valid {
  border-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.8-.77-.1-.1.1.1-.8.77-.8-.77.1-.1-.1.1.8.77.8-.77.1.1-.1-.1.8.77L3.3 7.5l-.5-.5-.5.5-.5-.5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4M8.2 4.6l-2.4 2.4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* クイック選択ボタンのアニメーション */
.btn-outline-secondary:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease-in-out;
}

/* 入力フィールドのフォーカス状態 */
.form-control:focus {
  border-color: #e91e63;
  box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
}

/* ヘルプテキストのアイコン */
.form-text i {
  opacity: 0.7;
}

/* エラーメッセージのスタイル */
.invalid-feedback i {
  margin-right: 0.25rem;
}

/* 金額入力フィールドの通貨アイコン */
.input-group-text {
  background-color: #f8f9fa;
  border-color: #ced4da;
  color: #6c757d;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .form-control {
    font-size: 16px; /* iOS Safariでのズーム防止 */
  }
  
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* アクセシビリティ向上 */
@media (prefers-reduced-motion: reduce) {
  .btn-outline-secondary:hover {
    transform: none;
    transition: none;
  }
}

/* イベント選択プルダウンの強化 */
#gift_record_event_id {
  /* ブラウザデフォルトの矢印を非表示 */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* カスタム矢印アイコン */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* 人気イベントボタンのスタイル */
.btn-outline-info:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
  transition: all 0.2s ease-in-out;
}

.btn-outline-info:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 123, 255, 0.1);
}

/* イベント選択フィールドのフォーカス状態 */
#gift_record_event_id:focus {
  border-color: #17a2b8;
  box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

/* イベント選択フィールドの必須状態（未選択時の警告） */
#gift_record_event_id.is-invalid {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4M8.2 4.6l-2.4 2.4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* イベント選択フィールドの有効状態 */
#gift_record_event_id.is-valid {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.8-.77-.1-.1.1.1-.8.77-.8-.77.1-.1-.1.1.8.77.8-.77.1.1-.1-.1.8.77L3.3 7.5l-.5-.5-.5.5-.5-.5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* フォームセクションの区切り */
.form-section {
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
/* ギフト記録カードレイアウト - シンプル版 */

/* ==================== 一覧ページレイアウト ==================== */

/* 一覧ページの外枠コンテナ（中央寄せ・最大幅） */
.gift-records-container {
  max-width: 72rem; /* Tailwind max-w-6xl 相当 */
  margin-left: auto;
  margin-right: auto;
}

/* 見出し周りの余白・中央寄せ */
.gift-records-header {
  margin-top: 0.5rem; /* mt-2 */
  margin-bottom: 0.5rem; /* mb-2 */
  text-align: center;
}

/* カードグリッド（レスポンシブ列数・間隔・中央寄せ） */
.gift-records-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem; /* gap-2 */
  justify-items: center;
}

@media (min-width: 768px) { /* md */
  .gift-records-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem; /* md:gap-3 */
  }
}

@media (min-width: 1024px) { /* lg */
  .gift-records-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem; /* lg:gap-4 */
  }
}

@media (min-width: 1280px) { /* xl */
  .gift-records-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ==================== お気に入りハートボタン ==================== */

.favorite-button-container {
  display: inline-flex;
  align-items: center;
  position: relative;
  z-index: 5 !important;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px; /* クリック余白は維持 */
  background: transparent; /* 背景なし */
  border: none; /* 枠線なし */
  border-radius: 0; /* 丸みを削除 */
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none; /* 影なし */
  font-size: 14px;
  font-weight: 500;
  position: relative;
  z-index: 5 !important;
}

.favorite-button:hover {
  transform: scale(1.05);
}

.favorite-heart {
  font-size: 16px;
  transition: all 0.2s ease;
  color: #ec4899; /* Pink */
}

.favorite-button:not(.favorited) .favorite-heart {
  color: #ec4899 !important; /* Pink for unfavorited (outline) */
}

.favorite-button:not(.favorited):hover .favorite-heart {
  color: #ec4899;
  transform: scale(1.1);
}

.favorite-button.favorited { /* 背景・枠線なしのまま */ }

.favorite-button.favorited .favorite-heart {
  color: #ec4899 !important;
  animation: heartBeat 0.3s ease;
}

/* お気に入り数（通常表示）をピンクに統一 */
.favorite-count {
  color: #ec4899; /* 数字もピンク */
  font-size: 12px;
  font-weight: 500;
  margin-left: 2px;
}

.favorite-button.favorited .favorite-count {
  color: #ec4899;
}

/* 未ログインユーザー用の静的表示 */
.favorite-button-static {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: transparent; /* 背景なし */
  border: none; /* 枠線なし */
  border-radius: 0; /* 丸みを削除 */
  font-size: 14px;
}

/* 未ログイン時の静的なお気に入り数もピンクに */
.favorite-count-static {
  color: #ec4899; /* 数字もピンク（静的） */
  font-size: 12px;
  font-weight: 500;
}

/* 詳細ページ用のスタイル調整 */
.favorite-show-page .favorite-button {
  background: transparent; /* 詳細でも丸背景を表示しない */
  border: none;
  color: inherit;
}

.favorite-show-page .favorite-button:hover { }

.favorite-show-page .favorite-button.favorited { }

.favorite-show-page .favorite-button.favorited .favorite-heart {
  color: #ec4899 !important;
}

.favorite-show-page .favorite-button:not(.favorited) .favorite-heart {
  color: #ec4899 !important; /* Pink for unfavorited on show page */
}

.favorite-show-page .favorite-button:not(.favorited):hover .favorite-heart {
  color: #ec4899;
}

/* 詳細ページでも常にピンクで表示 */
.favorite-show-page .favorite-button .favorite-count {
  color: #ec4899; /* 詳細ページでもピンク */
}

/* いいね済み状態でもピンクを維持 */
.favorite-show-page .favorite-button.favorited .favorite-count {
  color: #ec4899; /* いいね済みでもピンク */
}

/* ハートビートアニメーション */
@keyframes heartBeat {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* ローディング状態 */
.favorite-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

.favorite-button.loading .favorite-heart {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ==================== カード基本スタイル ==================== */

.gift-title-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gift-record-card {
  /* 縦長の長方形デザイン */
  width: 200px !important; /* 基本固定幅 - 強制適用 */
  min-width: 200px !important; /* 最小幅制限 */
  max-width: 200px !important; /* 最大幅制限 */
  height: 420px; /* 固定高さで縦長を保証 */
  display: flex !important;
  flex-direction: column;
  flex-shrink: 0 !important; /* 縮小防止 */
  flex-grow: 0 !important; /* 拡大防止 */
  flex-basis: auto !important; /* flex-basis制御 */
  justify-self: center !important; /* gridアイテム内で中央配置 */
  align-self: start !important; /* gridアイテム内で上端揃え */
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  box-sizing: border-box !important;
}

/* ==================== ギフト相手カード（一覧） ==================== */
.gift-person-card-fixed {
  height: 300px; /* PC版 */
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 内容が溢れるのを防止 */
  box-sizing: border-box;
}

/* モバイル */
@media (max-width: 639px) {
  .gift-person-card-fixed {
    height: 220px;
  }
}

.gift-record-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #f9a8d4;
}

/* ==================== 画像プレースホルダーエリア ==================== */

.gift-image-placeholder {
  /* カードの上半分（画像エリア） */
  flex: 0 0 50%; /* 固定で50%の高さ */
  background: linear-gradient(135deg, #fff9fc 0%, #fdeffd 50%, #fee6f8 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
}

.gift-image-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* プレースホルダーアイコンとテキスト */
.gift-image-placeholder .w-16 {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
  border: none;
  box-shadow: none;
}

.gift-image-placeholder p {
  position: relative;
  z-index: 1;
  font-weight: 500;
  color: #6b7280;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* ==================== カード情報エリア ==================== */

.gift-record-card .p-4,
.gift-record-card .p-5 {
  /* カードの下半分（情報エリア） */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  background: #ffffff;
}

/* ==================== 画像エリア固定高さ（画像あり/なし共通） ==================== */
.gift-card-image {
  height: 12rem; /* Tailwind h-48 相当 */
  min-height: 12rem; /* 画像エリアが縮まないよう固定 */
  flex-shrink: 0; /* テキスト量で画像が縮まないようにする */
}

@media (min-width: 640px) { /* sm */
  .gift-card-image {
    height: 13rem; /* sm:h-52 相当 */
    min-height: 13rem;
  }
}

@media (min-width: 768px) { /* md */
  .gift-card-image {
    height: 14rem; /* md:h-56 相当 */
    min-height: 14rem;
  }
}

@media (min-width: 1024px) { /* lg */
  .gift-card-image {
    height: 13rem; /* lg:h-52 相当 */
    min-height: 13rem;
  }
}

@media (min-width: 1280px) { /* xl */
  .gift-card-image {
    height: 14rem; /* xl:h-56 相当 */
    min-height: 14rem;
  }
}

.gift-card-image > img,
.gift-card-image > div {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==================== ユーザー情報エリア ==================== */

.gift-record-card .w-8.h-8 {
  background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
  border: 1px solid #d1d5db;
}

/* ==================== バッジとラベル ==================== */

/* 金額バッジ */
.gift-record-card .bg-green-100 {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1px solid #86efac;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* 操作ボタン */
.gift-record-card .absolute.top-3.right-3 a {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.gift-record-card .absolute.top-3.right-3 a:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==================== アイコンの色分け ==================== */

.text-purple-500 { color: #8b5cf6; }
.text-blue-500 { color: #3b82f6; }
.text-pink-500 { color: #ec4899; }
.text-red-400 { color: #f87171; }
.text-yellow-500 { color: #eab308; }

/* ==================== レスポンシブデザイン ==================== */

/* デスクトップ5列レイアウト対応 */
@media (min-width: 1024px) {
  .gift-record-card {
    width: 200px !important; /* 5列レイアウト用の統一幅 */
    min-width: 200px !important;
    max-width: 200px !important;
    height: 480px; /* 5列レイアウト用の高さ */
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    justify-self: center !important;
    align-self: start !important;
  }
}

@media (min-width: 1280px) {
  .gift-record-card {
    width: 200px !important; /* xl画面でも統一幅に変更 */
    min-width: 200px !important;
    max-width: 200px !important;
    height: 500px; /* xl画面での高さ */
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    justify-self: center !important;
    align-self: start !important;
  }
}

/* タブレット対応 */
@media (max-width: 1023px) and (min-width: 768px) {
  .gift-record-card {
    width: 240px !important; /* 3列レイアウト用の統一幅 */
    min-width: 240px !important;
    max-width: 240px !important;
    height: 400px;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }
  
  .gift-image-placeholder {
    min-height: 200px;
  }
}

/* モバイル対応 - より大きなカード（重なり防止） */
@media (max-width: 768px) {
  .gift-record-card {
    width: 179px !important; /* +5% */
    min-width: 179px !important;
    max-width: 179px !important;
    height: 546px !important; /* +5% */
    margin-bottom: 0.25rem;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }
  
  .gift-image-placeholder {
    min-height: 252px !important; /* +5% */
  }
  
  .gift-record-card .p-3,
  .gift-record-card .p-4 {
    padding: 1.25rem !important; /* パディングを大きく */
  }
  
  /* モバイルでは文字サイズを調整 */
  .gift-record-card .text-sm {
    font-size: 0.9rem !important; /* より大きく */
  }
  
  .gift-record-card .text-xs {
    font-size: 0.8rem !important; /* より大きく */
  }
  
  .gift-record-card .text-base {
    font-size: 1.1rem !important; /* より大きく */
  }
  
  .gift-record-card .text-lg {
    font-size: 1.25rem !important; /* より大きく */
  }
}

/* 小さなモバイル対応 - 重なり防止 */
@media (max-width: 480px) {
  .gift-record-card {
    width: 168px !important; /* +5% */
    min-width: 168px !important;
    max-width: 168px !important;
    height: 355px !important; /* +5% */
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }
  
  .gift-image-placeholder {
    min-height: 158px !important; /* +5% */
  }
  
  .gift-image-placeholder .w-14,
  .gift-image-placeholder .w-16,
  .gift-image-placeholder .w-18 {
    width: 4rem !important; /* より大きく */
    height: 4rem !important;
  }
  
  .gift-record-card .absolute.top-2.right-2,
  .gift-record-card .absolute.top-3.right-3 {
    top: 0.5rem;
    right: 0.5rem;
  }
  
  .gift-record-card .absolute.top-2.left-2,
  .gift-record-card .absolute.top-3.left-3 {
    top: 0.5rem;
    left: 0.5rem;
  }
  
  /* 特小モバイル専用の適切な間隔（ギフト一覧に限定して制御） */
  /* removed global .grid overrides to avoid conflicts */
  
  /* 親コンテナーのパディング調整 */
  .mb-0.mt-0 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* モバイル専用の画面幅最大活用 - 重なり防止 */
@media (max-width: 640px) {
  /* removed global .grid overrides to avoid conflicts */
  
  .gift-record-card {
    width: 173px !important; /* +5% */
    min-width: 173px !important;
    max-width: 173px !important;
    height: 355px !important; /* +5% */
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }
  
  /* 画像エリアの高さも縮小 */
  .gift-card-image {
    height: 9.45rem !important; /* +5% */
    min-height: 9.45rem !important;
  }
  .gift-image-placeholder {
    min-height: 158px !important; /* +5% */
  }
  
  /* 親コンテナーも最適化 */
  .mb-0.mt-0 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* ==================== アニメーション効果 ==================== */

/* カード出現時のアニメーション */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gift-record-card {
  animation: cardFadeIn 0.6s ease-out;
}

/* Turboプレビュー表示時はアニメーション */
html[data-turbo-preview] .gift-record-card {
  animation: none !important;
}

/* ==================== アクセシビリティ対応 ==================== */

/* フォーカス状態の強化 */
.gift-record-card:focus-within {
  outline: 2px solid #ec4899;
  outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
  .gift-record-card {
    border-width: 2px;
    border-color: #000000;
  }
  
  .gift-image-placeholder {
    background: #f3f4f6;
    border-bottom: 2px solid #000000;
  }
}

/* 動きを控えめにする設定対応 */
@media (prefers-reduced-motion: reduce) {
  .gift-record-card {
    animation: none;
    transition: none;
  }
  
  .gift-record-card:hover {
    transform: none;
  }
  
  .gift-record-card .absolute.top-3.right-3 a:hover {
    transform: none;
  }
}

/* ==================== グリッドレイアウト基本設定 ==================== */

/* モバイル版の安全なグリッド設定（グローバル上書きを撤廃） */
@media (max-width: 767px) {
  
  .gift-record-card {
    box-sizing: border-box !important;
    position: relative !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }
  
  /* 親コンテナの最終調整 */
  .mb-0.mt-0 {
    box-sizing: border-box !important;
    width: 100% !important;
    overflow-x: hidden !important; /* 横スクロール防止 */
  }
}

/* ==================== ギフト相手カード固定サイズ（統合） ==================== */
/* 幅はTailwindクラス（例: w-[90%] sm:w-40 md:w-full）で制御。
   ここでは強制指定を行わず、上部の .gift-person-card-fixed(height固定) と整合性を保つ。 */

/* ==================== Tailwind Grid オーバーライド（撤廃） ==================== */
/* Removed global overrides of Tailwind grid to prevent conflicts.
   Use .gift-records-grid for gift records pages instead. */

/* ==================== プリント対応 ==================== */

@media print {
  .gift-record-card {
    height: auto;
    box-shadow: none;
    border: 1px solid #000000;
    break-inside: avoid;
    margin-bottom: 1rem;
  }
  
  .gift-record-card .absolute.top-3.right-3 {
    display: none;
  }
  
  .gift-image-placeholder {
    background: #f9f9f9;
    border-bottom: 1px solid #000000;
  }
  
  /* Removed global grid override in print as well */
  
  .gift-person-card-fixed {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
  }
}

/* (reverted) 詳細ページのギャラリーはTailwindのデフォルトグリッドを使用 */
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


*/

.\n+/* Prevent horizontal scroll on mobile */
html, body {
  overflow-x: hidden;
}

.header {
  background-color: #F6B352; /* ヘッダーの色を指定 */
}

/* オートコンプリート用スタイル */
.autocomplete-item mark {
  background-color: #fdf2f8; /* pink-50 */
  color: #be185d; /* pink-700 */
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.autocomplete-item:hover mark {
  background-color: #fce7f3; /* pink-100 */
  color: #a21caf; /* pink-800 */
}

/* オートコンプリートドロップダウンのスクロールバー */
#autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

#autocomplete-dropdown::-webkit-scrollbar-track {
  background: #f1f5f9;
}

#autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* iOS Safari ボタン透明化問題の修正 */
button[style*="background"],
input[type="submit"][style*="background"],
a[style*="background"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  opacity: 1 !important;
}

/* ログイン・新規登録ボタンの特別な修正（scoped to Devise classes to avoid global override） */
.devise-form-container .devise-form-submit,
.devise-form-container .devise-primary-link,
a.devise-primary-link {
  -webkit-appearance: none;
  appearance: none;
  background-color: #FC913A;
  opacity: 1;
}

/* linear-gradientボタンの修正 */
button[style*="linear-gradient"],
input[type="submit"][style*="linear-gradient"],
a[style*="linear-gradient"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  opacity: 1 !important;
}
