@charset "utf-8";

/* (1) チャットウィジェット全体のコンテナ */
#my-chat-widget {
  position: fixed;
  bottom: 20px; /* 画面下からの距離 */
  /* right: 20px;  /* 画面右からの距離 */
  left: 20px;
  width: 350px;   /* ウィンドウの幅 */
  z-index: 9998;
  border-radius: 10px; /* 角丸 */
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  overflow: hidden; /* 角丸を子要素にも適用 */
  background-color: #fff;
}

/* (2) ヘッダー兼クリックボタンのスタイル */
#my-chat-header {
  height: 50px; /* ヘッダーの高さ */
  background-color: #007bff; /* ヘッダーの背景色 (例: 青) */
  color: white;
  display: flex;
  justify-content: space-between; /* テキストとアイコンを両端に */
  align-items: center;
  padding: 0 15px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 10px; /* 閉じている時は全体が角丸 */
  transition: border-radius 0.1s ease;
}

/* (3) チャット本体 (iframeのコンテナ) のスタイル */
#my-chat-content {
  height: 500px;  /* チャット部分の高さ */
  display: none; /* ★★★ 重要：最初は非表示にする ★★★ */
  background-color: white;
  border-top: 1px solid #eee; /* ヘッダーとの境界線 */
}

/* iframeのスタイル */
#my-chat-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* (4) 開閉アイコンのスタイル (上向きの矢印をCSSで作成) */
#my-chat-toggle-icon {
  width: 12px;
  height: 12px;
  border-top: 2px solid white;
  border-right: 2px solid white;
  transform: rotate(-45deg); /* 上向き矢印 */
  transition: transform 0.3s ease; /* アニメーション */
}


/* ----- JavaScriptでクラスを切り替えた時のスタイル ----- */

/* ウィジェットが「開いている」状態 (openクラスが付いた時) */
#my-chat-widget.open #my-chat-header {
  /* 開いている時は下側の角丸をなくす */
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

#my-chat-widget.open #my-chat-content {
  display: block; /* ★開いたら表示 */
}

#my-chat-widget.open #my-chat-toggle-icon {
  transform: rotate(135deg); /* 下向き矢印 (180度回転) */
}
