/* ==========================================================================
   AI試着ツール (tryon) 専用スタイル
   ========================================================================== */

/* ── 基本レイアウト ── */
body {
    border-top: 14px solid #83B2D0;
    border-bottom: 15px solid #83B2D0;
}

h1 {
    letter-spacing: 2px;
    font-weight: bold !important;
}
h1 span {
    color: #83B2D0;
}

#chatbot-toggle { display: none; }

.flex.justify-center.mb-4 { padding-top: 1vmin !important; }
.min-h-screen.p-4.md\:p-8.xl\:p-12 { padding: 2% !important; }
.bg-white.p-6.md\:p-8.rounded-sm.shadow-sm.border.border-stone-100 { padding: 5vmin 2% !important; margin: 0 !important; }
.text-center.space-y-3.pb-4.border-b.border-stone-200 { padding: 0 !important; background: white !important; }

body, div, button, input, textarea, h1, h2, h3, h4, h5, h6, p, span, label, select, a {
    font-family: "YuGothic", "游ゴシック体", "Yu Gothic", "游ゴシック", ryo-gothic-plusn, Hiragino Sans, "ヒラギノ角ゴシック", Hiragino Kaku Gothic ProN, "ヒラギノ角ゴ ProN W3", "Meiryo", sans-serif !important;
}

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-pulse-slow { animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

input, textarea, select { font-size: 16px !important; }

/* ── ピン ── */
.pin-crosshair * { cursor: crosshair !important; }
.pin-crosshair { cursor: crosshair !important; }

@keyframes pin-drop {
    0%   { transform: translate(-50%, -120%) scale(1.3); opacity: 0; }
    65%  { transform: translate(-50%, -95%) scale(0.92); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}
.pin-marker { animation: pin-drop 0.22s cubic-bezier(.36,.07,.19,.97) both; }

.product-chip { transition: border-color .15s, box-shadow .15s; }

/* ── Before/After スライダー ── */
.ba-wrapper { width: 100%; }
.ba-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
    margin-bottom: 6px;
}
.ba-label-before,
.ba-label-after {
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.ba-label-before { background: rgba(0,0,0,.55); color: white; }
.ba-label-after  { background: #83B2D0; color: white; }

/* ── ハンバーガーメニュー ── */
.hm-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1.5px solid #E7E5E4;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow .15s;
    padding: 0;
}
.hm-btn:hover { box-shadow: 0 3px 12px rgba(0,0,0,.18); }

/* ドロワー */
.hm-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.hm-overlay.open { opacity: 1; pointer-events: auto; }

.hm-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 35;
    width: min(320px, 85vw);
    background: white;
    box-shadow: none;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.hm-drawer.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
}

.hm-drawer-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #E7E5E4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.hm-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ── サブカテゴリー タグクラウド ── */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #FAFAF9;
    border: 1px solid #E7E5E4;
    border-radius: 8px;
}
.tag-chip {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1.5px solid #E7E5E4;
    background: white;
    font-size: 11px;
    color: #57534E;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.tag-chip:hover {
    border-color: #83B2D0;
    color: #2E6A8A;
}
.tag-chip.active {
    background: #83B2D0;
    border-color: #83B2D0;
    color: white;
    font-weight: bold;
}
.tag-chip .tag-count {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 3px;
}

/* ── アップロードゾーン（floorplan.php と統一感のあるスタイル） ── */
.upload-zone-empty {
    border: 2px dashed #D6D3D1;
    background: #FAFAF9;
    transition: border-color .15s, background .15s;
    cursor: pointer;
}
.upload-zone-empty:hover {
    border-color: #83B2D0;
    background: #F0F7FB;
}
.upload-zone-empty.dragging {
    border-color: #83B2D0;
    background: #EAF4FB;
}

/* ── インテリア試着中ローディング ── */

/* 家具が空中から下に落ちて配置される動き */
@keyframes furniture-drop {
    0%   { transform: translateY(-30px) scale(0.85); opacity: 0; }
    20%  { opacity: 1; }
    50%  { transform: translateY(2px) scale(1.02); }
    65%  { transform: translateY(-1px) scale(0.99); }
    80%  { transform: translateY(0) scale(1); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.tryon-furniture {
    animation: furniture-drop 2.4s cubic-bezier(.25,.85,.4,1) infinite;
    transform-origin: center bottom;
}
.tryon-furniture-2 { animation-delay: 0.8s; }
.tryon-furniture-3 { animation-delay: 1.6s; }

/* キラキラ */
@keyframes sparkle-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
    50%      { opacity: 1; transform: scale(1) rotate(180deg); }
}
.tryon-sparkle {
    animation: sparkle-twinkle 1.8s ease-in-out infinite;
    transform-origin: center center;
}
.tryon-sparkle-1 { animation-delay: 0s; }
.tryon-sparkle-2 { animation-delay: 0.45s; }
.tryon-sparkle-3 { animation-delay: 0.9s; }
.tryon-sparkle-4 { animation-delay: 1.35s; }

/* 部屋全体の光（フェード） */
@keyframes room-glow {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.55; }
}
.tryon-glow {
    animation: room-glow 2.4s ease-in-out infinite;
}

/* ピン位置インジケーター（パルス） */
@keyframes pin-pulse {
    0%   { transform: scale(0.8); opacity: 0.4; }
    50%  { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(0.8); opacity: 0; }
}
.tryon-pin-pulse {
    animation: pin-pulse 1.6s ease-out infinite;
    transform-origin: center center;
}

/* ステップドット（進捗） */
@keyframes step-dot-active {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50%      { transform: scale(1.4); opacity: 1; }
}
.tryon-step-active { animation: step-dot-active 1s ease-in-out infinite; }

/* ── ローディングのお部屋イラスト サイズ制御 ── */
.loading-illust {
    max-height: 130px;
    max-width: 220px;
}
@media (min-width: 768px) {
    .loading-illust {
        max-height: 200px;
        max-width: 320px;
    }
}