/* CongestionConsole/static/css/style.css */

/* 全体の背景色とフォントカラーの調整 */
html, body {
    background-color: #f8f9fa; /* Bootstrap の背景色に合わせた薄いグレー */
    color: #343a40; /* 文字色をダークグレーに設定 */
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ヘッダー、タイトルのスタイル */
h1, h2, h3 {
    font-weight: 200;
    color: #343a40;
}

/* ヘッダー */
header, .header {
    flex: 0 0 auto;
    height: 60px;
    line-height: 60px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.navbar {
    background-color: #f54e3c;
    padding: 0 !important;
    height: 50px !important;
}

/* メインコンテンツ領域 */
.main-wrapper {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    overflow: visible;
}

/* サイドバーのスタイル */
.sidebar {
    height: 100%;
    width: 230px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    position: relative; /* サブメニューなどをはみ出して表示する場合に必要 */
    overflow: visible;  /* 念のため、こちらも visible に */
}
.sidebar-links {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-link {
    height: 60px;
    line-height: 60px;
    display: block;
    padding: 0 1.25rem;
    /* もともと center だったので left に変更 */
    text-align: left;
    text-decoration: none;
    color: #495057;
    background-color: #f54e3c50;
    border: 1px solid #dee2e6;
    border-radius: 0;
    border-bottom: none;
}
.submenu-link {
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    background-color: #f54e3c33;
    padding-left: 2rem;
    border-top: none;
    border-bottom: 1px solid #dee2e6
}
.sidebar-msg {
    flex: 0 0 auto;
    margin-top: auto;
    text-align: center;
    color: #9e9e9e;
    font-size: 10px;
}
.sidebar-msgp {
    height: 4px;
}
.sidebar-link.active {
  background-color: #f54e3c95;
  color: #fff;
}
.sidebar-link:hover {
  background-color: #f54e3c25;
}

/* サブメニュー関連 */
.accordion-item {
  position: relative; 
}
.submenu-accordion {
  display: none;
  background-color: #fff;
  margin-left: 0;
}
.accordion-item:hover .submenu-accordion {
  display: block;
}
.submenu-accordion.show {
  display: block;
}
.submenu-link.active-submenu {
  background-color: #f54e3c95;
  color: #fff;
}

/* アイコンの配置・サイズ調整 */
.icon-left {
  margin-right: 8px;
  height: 25px;
  width: auto;
}
.submenu-accordion .icon-left {
  margin-right: 8px;
  height: 20px;
  width: auto;
}

/* メインコンテンツ領域 */
.content {
    flex: 1 1 auto;
    background-color: #ffffff;
    overflow: hidden;
    padding: 10px;
    min-height: 0;
}

/* フッターのスタイル（画面下部に固定） */
.footer {
    flex: 0 0 auto;
    width: 100%;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background-color: #f54e3c;
    color: #ffffff;
    font-size: 12px;
}

/* ログイン画面専用のコンテナ（中央配置用） */
.login-container {
    margin-top: 10%;
    margin-bottom: 10%;
}

/* カードのスタイル調整 */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ボタンのカスタム */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* ログアウトボタンのスタイル調整 */
.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}
.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* ナビゲーションリンクのスタイル */
.nav-link {
    color: #007bff;
}
.nav-link:hover {
    color: #0056b3;
}
.navbar-text {
    font-size: 14px;
    padding-left: 10px;
    padding-right: 10px;
}
.navbar-logo {
  height: 40px;
}
.navbar-logo-img {
  height: 90%;
}

/* 管理コンソールトップページ用のダッシュボードプレースホルダ */
.dashboard-placeholder {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* お知らせ欄用のプレースホルダ */
.notification-section {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* レスポンシブ対応 */
@media (max-width: 767.98px) {
    .login-container {
        margin-top: 20%;
    }
    #sidebar {
        display: none; /* 小さい画面ではサイドバー非表示 */
    }
    .main-content {
        margin-left: 0;
    }
}

/* dashboard.html用 */
.d-wrapper {
  display: flex;
  flex-direction: row;
  height: 100%;
}
.d-left {
  padding: 10px;
  width: 250px;
}
.d-right {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#d-graph-container {
  height: 100%;
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}
#d-camera-container {
  height: 100%;
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.plotly-container {
  position: relative; /* 相対配置にすることで、この中にオーバーレイを絶対配置できる */
}
#plotly-graph {
  flex: 1;
  min-height: 0;
}
.modal-overlay {
  display: none; 
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(100, 100, 100, 0.5);
  z-index: 9999;
  /* Flexレイアウトで中央揃え */
  align-items: center;
  justify-content: center;
}
.modal-content {
  position: relative;  /* 絶対配置の子要素の基準に */
  width: 80%;
  height: 95%;
  background-color: #fff;
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
  overflow: hidden;
}
.close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  color: #b7b7b7;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 32px;
  cursor: pointer;
  z-index: 11;
  border: none;
}

.modal-body {
  width: 100%;
  height: 100%;
  display: flex;          /* フレックスレイアウト */
  flex-direction: row;    /* 横並び */
  align-items: center;    /* 垂直方向中央寄せ */
  justify-content: space-between;
  gap: 8px;               /* ボタンと画像の間の余白 */
  position: relative;  
}
.nav-button {
  position: relative;
  width: 40px;
  height: 120px;
  background-color: #f54e3c50;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}
#prevImage::before,
#nextImage::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px 10px;
}
#prevImage::before {
  background-image: url("/static/img/prev.png");
}
#nextImage::before {
  background-image: url("/static/img/next.png");
}
#spinner-overlay-modal {
  align-items: center;
  justify-content: center;
}
.modal-image-container {
  position: relative;
  overflow: hidden;
}
.modal-image {
  display: none;
  position: absolute;
  transform-origin: 0 0;
}
.modal-image.cursor-default {
  cursor: auto;
}
.modal-image.cursor-grab {
  cursor: grab;
  cursor: -webkit-grab;
}
.modal-image.cursor-grabbing {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}
.zoom-button {
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: 22px;
  height: 41px;
  background-color: #ffffff;
  cursor: pointer;
  z-index: 2;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
}
.zoom-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  line-height: 20px;
  background: url("/static/img/zoom-in.png") center no-repeat;
  background-size: 16px 16px;
  border-bottom: 1px solid #b7b7b7
}
.zoom-button::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: url("/static/img/zoom-out.png") center no-repeat;
  background-size: 16px 16px;
}

.area-item,
.device-item {
  cursor: pointer;
  white-space: nowrap;
  overflow-x: auto;
}
#datasource-tree {
  overflow-y: auto;
}
.item-content.selected-tree-item {
  background-color: #f54e3c50 !important; /* 薄オレンジなら#fff2cc */
}
.emoji {
   font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", "emojisymbols", "emojione mozilla", "twemoji mozilla", "Segoe UI Symbol", "Noto Emoji";
}

/* settings共通 */
.settings-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.settings-title {
  padding-left: 24px;
  font-size: 20px;
}
.settings-content {
  height: 100%;
}
.d-r-sprt {
  height: 100%;
  display: flex;
  flex-direction: row; 
}
.d-r-left {
  flex: 1 1 auto;
  padding: 8px;
  background-color: #fff;
  width: 50%;
  margin-right: 30px;
}
.d-r-right {
  flex: 0 0 auto;
  padding: 8px;
  background-color: #fff;
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: start;
}
.form-container {
  margin: 0 auto;
  text-align: center;;
}
.form-group {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.form-group label {
  width: 30%;
  min-width: 130px;
  max-width: 150px;
  text-align: right;
  margin-right: 20px;
}
.form-group input {
  flex: 1;
  padding: 4px;
  font-size: 14px;
}
#device-area-selector {
  text-align: left;
  border: 1px solid #767676;
  border-radius: 3px;
  height: 150px;
  width: 220px;
  overflow: auto;
  padding: 3px;
}
#parent-area-selector {
  text-align: left;
  border: 1px solid #767676;
  border-radius: 3px;
  height: 150px;
  width: 220px;
  overflow: auto;
  padding: 3px;
}
.form-group button.emoji-picker-btn {
  margin-left: 8px;
  font-size: 12px;
  padding: 4px;
}
.save-btn {
  background-color: #f54e3c;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  margin-top: 8px;
  align-items: center;
  margin: 0 auto;
  width: 100px;
  border-radius: 5px;
}
.save-btn:hover {
  opacity: 0.9;
}
#reload-btn {
  background-color: #f54e3c;
}

/* /devices.html */
/* 地図プレースホルダ */
.map-placeholder {
  border: 1px solid #666666;
  height: 50%;
  width: 100%;
  display: flex;
  align-items: start;
  justify-content: center;
  border-radius: 3px;
  position: relative;
}
.map-placeholder-full {
  border: 1px solid #666666;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: start;
  justify-content: center;
  border-radius: 3px;
  position: relative;
}

.camera-placeholder-full {
  border: 1px solid #666666;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column; /* 縦方向に配置 */
  align-items: stretch;   /* 子要素を横幅いっぱいに */
  justify-content: flex-start; /* 上から配置 */
  border-radius: 3px;
  position: relative;
  min-height: 0; /* Flexboxで縮小を許可 */
  overflow: hidden; /* はみ出しを隠す */
}

/* mapview.html */
.maplibregl-popup-content {
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  text-align: center;
  padding: 0 10px;
  background-color: inherit; 
}
/* 吹き出しの先端（tip）を完全に非表示にする */
.maplibregl-popup-tip-container,
.maplibregl-popup-tip {
  display: none !important;
}

/* ポップアップ全体のスタイル：単なる長方形に */
.maplibregl-popup {
  background: #ffffff !important;  /* 背景色 */
  border: none !important;          /* 枠線なし */
  border-radius: 10px !important;   /* 角丸10px */
  box-shadow: 3px 3px 2px 0px rgb(0 0 0 / 50%);
}
.popup-timestamp {
  font-size: 0.75em;
  line-height: 0.75em;
  text-align: center;
  margin-top: 3px;
  font-weight: normal;
}
/* 自動更新スイッチ */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;   /* 横幅はお好みで調整 */
  height: 26px;  /* 縦幅もお好みで調整 */
  margin-right: 10px;
}

.switch input {
  opacity: 0;    /* 実際のチェックボックスは非表示 */
  width: 0;
  height: 0;
}

/* トグルのスライダー部分 */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ffffff;      /* オフ時の背景 */
  border: 2px solid #f54e3c;      /* 縁の色 */
  transition: .4s;
}

/* 丸スタイルの指定 */
.slider.round {
  border-radius: 34px;
}

/* スライダー内の丸 */
.slider::before {
  position: absolute;
  content: "";
  height: 18px;          /* スライダー内の丸の高さ */
  width: 18px;           /* スライダー内の丸の幅 */
  left: 3px;             /* 左余白 */
  top: 2px;
  bottom: auto;           /* 下余白 */
  background-color: #f54e3c;  /* 丸の色(オフ時) */
  transition: .4s;
  border-radius: 50%;
}

/* チェック状態: スライダー背景色を #f54e3c にし、丸は白に */
input:checked + .slider {
  background-color: #f54e3c;  /* オン時背景 */
}
input:checked + .slider::before {
  transform: translateX(24px); /* 丸を右側に移動 */
  background-color: #ffffff;   /* 丸の色を白に */
}

/* フォーカス時のシャドウ(お好みで) */
input:focus + .slider {
  box-shadow: 0 0 1px #f54e3c;
}

.area-checkbox {
    vertical-align: middle;
}

/* サムネイルサイズ選択ラジオボタン */
input[name="thumbnail-size"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #f54e3c;
    border-radius: 50%;
    background-color: #ffffff;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 3px;
    position: relative;
}

input[name="thumbnail-size"]:checked {
    background-color: #f54e3c;
}

input[name="thumbnail-size"]:checked::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ffffff;
}

input[name="thumbnail-size"]:focus {
    outline: none;
    box-shadow: 0 0 2px #f54e3c;
}

#camera {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
  grid-auto-rows: min-content;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}
.modal-camera-image-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-camera-image {
  display: none;
  position: absolute;
  transform-origin: center;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}