@charset "UTF-8";

/**
 * Nature Remo Webコントローラー スタイルシート
 * モダンなスマートホームダッシュボード・Glassmorphism・操作アニメーション
 */

/* ==========================================================================
   ベース設定 & ライト/ダークモード変数
   ========================================================================== */

:root {
  --bg-color: #030712;
  --card-bg: rgba(17, 24, 39, 0.75);
  --card-border: rgba(55, 65, 81, 0.6);
  --accent-color: #10b981;
  --accent-hover: #059669;
}

html.light {
  --bg-color: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-border: rgba(226, 232, 240, 0.8);
}

html.light body {
  background-color: #f1f5f9;
  color: #1e293b;
}

html.light header {
  background-color: rgba(255, 255, 255, 0.85);
  border-color: #e2e8f0;
}

html.light .bg-slate-900,
html.light .bg-slate-950 {
  background-color: #ffffff;
  color: #1e293b;
}

html.light .border-slate-800,
html.light .border-slate-700 {
  border-color: #e2e8f0;
}

html.light .bg-slate-800 {
  background-color: #f8fafc;
  color: #334155;
}

html.light .text-slate-400,
html.light .text-slate-500 {
  color: #64748b;
}

html.light .text-white {
  color: #0f172a;
}

/* ==========================================================================
   家電カードのスタイリング (Glassmorphism & Transition)
   ========================================================================== */

.appliance-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.appliance-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

/* センサーカードのスタイル */
.sensor-card {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(55, 65, 81, 0.5);
  border-radius: 1rem;
  padding: 0.875rem 1rem;
  transition: all 0.2s ease;
}

html.light .sensor-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: #e2e8f0;
}

.sensor-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   ドラッグ＆ドロップ並び替えスタイル (SortableJS) & 行レイアウト
   ========================================================================== */

/* 行（Row）コンテナ */
.appliance-row {
  position: relative;
  transition: all 0.2s ease;
}

/* 編集モード時の行スタイル */
.edit-mode-active .appliance-row {
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: 1.25rem;
  padding: 1rem;
}

html.light .edit-mode-active .appliance-row {
  background: rgba(241, 245, 249, 0.6);
  border-color: rgba(245, 158, 11, 0.4);
}

/* 空行のドロップゾーン */
.row-empty-dropzone {
  min-height: 120px;
  border: 2px dashed rgba(100, 116, 139, 0.3);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.row-empty-dropzone.sortable-ghost {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

/* 列数別グリッドクラス (1〜5列) */
.grid-cols-layout-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.grid-cols-layout-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .grid-cols-layout-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-cols-layout-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .grid-cols-layout-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .grid-cols-layout-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.grid-cols-layout-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .grid-cols-layout-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .grid-cols-layout-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.grid-cols-layout-5 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .grid-cols-layout-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .grid-cols-layout-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .grid-cols-layout-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* 編集モード時のカード挙動 */
.edit-mode-active .appliance-card {
  cursor: grab;
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.edit-mode-active .appliance-card:active {
  cursor: grabbing;
}

.edit-mode-active .card-edit-controls {
  display: flex !important;
}

/* ドラッグ中のプレースホルダー（移動先を示す枠線） */
.sortable-ghost {
  opacity: 0.35;
  border: 2px dashed #10b981 !important;
  background: rgba(16, 185, 129, 0.05) !important;
  transform: scale(0.98);
}

/* ドラッグ中に掴んでいる要素 */
.sortable-chosen {
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.4);
  border-color: #10b981 !important;
}

.sortable-drag {
  opacity: 0.95 !important;
  transform: rotate(2deg) scale(1.02);
  z-index: 100 !important;
}

/* ==========================================================================
   インタラクティブボタン・コントロール
   ========================================================================== */

/* タップ・クリックフィードバック（リップル風） */
.btn-action {
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn-action:active {
  transform: scale(0.94);
  filter: brightness(0.9);
}

/* エアコンの電源ON/OFFインジケーター */
.power-indicator-on {
  box-shadow: 0 0 12px #10b981;
}

/* テレビのチャンネルテンキーグリッド */
.tv-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.tv-ch-btn {
  height: 2.75rem;
  border-radius: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  transition: all 0.15s ease;
}

.tv-ch-btn:hover {
  background-color: rgba(51, 65, 85, 0.8);
  color: #fff;
}

.tv-ch-btn:active {
  transform: scale(0.92);
  background-color: #10b981;
  color: #fff;
}

/* ==========================================================================
   トースト通知
   ========================================================================== */

.toast-item {
  animation: slide-in-bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.toast-item.toast-exit {
  animation: slide-out-bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-in-bottom {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slide-out-bottom {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(1rem) scale(0.9);
  }
}

/* ==========================================================================
   カスタムスクロールバー
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.6);
}

/* ==========================================================================
   アフィリエイト・広告ウィジェット最適化
   ========================================================================== */

div[id^="msmaflink-"] {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

div[id^="msmaflink-"] .easyLink-box {
  margin: 0 auto !important;
  border-radius: 1rem !important;
  border: 1px solid rgba(55, 65, 81, 0.6) !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
}


