/* =====================================================
   日常ツールポータル  style.css
   - ChatGPT風レイアウト：左サイドバー + 右メイン(iframe)
   - 配色はスマホ料金比較ツールに合わせた白ベース＋青系
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: #1f2933;
}

body {
  display: flex;
  background: #f5f7fa;
  overflow: hidden;
}

/* ---------- サイドバー ---------- */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0b5394 0%, #083d6f 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  transition: transform .25s ease;
}

.sidebar-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sidebar-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: none; /* デスクトップでは非表示 */
  transition: background .15s;
}
.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tool-list {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background .15s;
}
.tool-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.tool-item.is-active {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 3px 0 0 #ffd166;
}

.tool-icon {
  font-size: 20px;
  line-height: 1.2;
  flex-shrink: 0;
}

.tool-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tool-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.tool-desc {
  font-size: 11px;
  opacity: 0.75;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 12px 18px 14px;
  font-size: 11px;
  opacity: 0.55;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  line-height: 1.4;
}

/* ---------- メイン ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

.main-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid #e4e8ef;
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.04);
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #0b5394;
  padding: 2px 8px;
  border-radius: 6px;
  display: none; /* モバイル表示時のみ */
  transition: background .15s;
}
.menu-toggle:hover {
  background: #eef3f9;
}

.main-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  color: #0b5394;
  font-weight: 700;
}

.open-new-tab {
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid #e4e8ef;
  border-radius: 6px;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.open-new-tab:hover {
  background: #eef3f9;
  color: #0b5394;
  border-color: #b8c7db;
}

/* ---------- iframe領域 ---------- */
.iframe-wrap {
  flex: 1;
  background: #f5f7fa;
  position: relative;
  overflow: hidden;
}

#toolFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
  padding: 24px;
  text-align: center;
}

/* ---------- レスポンシブ（モバイル） ---------- */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: block;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .main-title {
    font-size: 15px;
  }
  .open-new-tab {
    padding: 6px 8px;
    font-size: 11px;
  }
}
