/**
 * Secretary Panel Styles
 * Left-side floating panel for Pinot Secretary
 * Version: 2.0
 */

/* Secretary パネル - 左側固定 */
.secretary-panel {
  position: fixed;
  top: 50px; /* ヘッダー高さ分下げる */
  left: 0;
  width: 400px;
  height: calc(100vh - 50px);
  background: white;
  border-right: 1px solid #ddd;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: transform 0.3s ease;
}

/* 閉じた状態 */
.secretary-panel.closed {
  transform: translateX(-100%);
}

/* Secretary iframe */
.secretary-panel iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* トグルボタン */
.secretary-toggle {
  position: fixed;
  top: 50%;
  left: 400px; /* パネルの右端（開いている時） */
  transform: translateY(-50%);
  width: 20px;
  height: 40px;
  background: hsl(var(--theme-bordeaux));
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 1001; /* パネルより上 */
  transition: left 0.3s ease, background 0.2s ease;
}

/* 閉じた状態のボタン位置（隣接セレクタ） */
.secretary-panel.closed + .secretary-toggle {
  left: 0; /* 画面左端に配置 */
}

.secretary-toggle:hover {
  background: hsl(var(--theme-bourgogne));
}

/* アイコン表示制御（隣接セレクタ） */
.secretary-panel:not(.closed) + .secretary-toggle .icon-open {
  display: inline;
}

.secretary-panel:not(.closed) + .secretary-toggle .icon-close {
  display: none;
}

.secretary-panel.closed + .secretary-toggle .icon-open {
  display: none;
}

.secretary-panel.closed + .secretary-toggle .icon-close {
  display: inline;
}

/* メインコンテンツのマージン調整 */
/* JavaScript で body.secretary-open class を追加/削除する */
body.secretary-open .main-content {
  margin-left: 400px;
  transition: margin-left 0.3s ease;
}

/* モバイルでは Secretary パネルを非表示 */
@media (max-width: 768px) {
  .secretary-panel {
    display: none;
  }

  body .main-content {
    margin-left: 0 !important;
  }
}

/* Global Chat は右下に維持（z-index 調整） */
.space-chat-panel {
  z-index: 999; /* Secretary より下 */
}
