/* 検索ポップアップスタイル - CakePHP版互換 */
.sec-popup {
  background: rgba(110, 162, 206, 0.9);
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  padding-top: 20px;
}

.sec-popup.open {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.box-popup {
  width: 96%;
  max-width: 1140px;
  margin: 0 auto;
  display: block;
}

.box-popup--01 {
  max-width: 1100px;
}

.box-popup__w {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.box-popup__w--nopd {
  padding: 48px 50px 34px;
  background: #FFFFFF;
  border-radius: 10px;
}

.box-popup__wclose {
  display: inline-block;
  right: 15px;
  position: absolute;
  top: 15px;
  cursor: pointer;
  z-index: 1;
}

/* .box-popup__wmaps--nopd {
  text-align: center;
} */

.box-popup__wmaps--nopd .c-ttl__05 {
  margin-bottom: 20px;
}

.box-popup__wmaps--nopd .box-popup__maps {
  padding: 0;
  margin-bottom: 10px;
}

.box-popup__maps {
  padding: 48px 119px 34px;
  background: #FFFFFF;
  border-radius: 10px;
  display: -ms-flexbox;
  display: -webkit-box;
  display: flex;
  -ms-flex-align: center;
  -webkit-box-align: center;
  align-items: center;
  margin-bottom: 25px;
}

.box-popup__maps-l {
  width: 46%;
  position: relative;
}

.box-popup__maps-r {
  padding-left: 47px;
  width: 54%;
}

.box-popup__maps-rsub {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.857;
  color: #000000;
  margin-bottom: 5.5px;
}

.box-popup__maps-rsubttl {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.box-popup__maps-rsublist01 {
  list-style: none;
  padding: 0;
  margin: 0;
}

.box-popup__maps-rsublist01 li {
  margin-bottom: 5px;
}

.box-popup__maps-rsublist01 li a {
  color: #0066cc;
  text-decoration: none;
  padding: 2px 5px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

/* .box-popup__maps-rsublist01 li a:hover {
  background-color: #f0f0f0;
  text-decoration: underline;
} */

.box-popup__search {
  padding: 20px;
}

.box-popup__search--maxh {
  max-height: 400px;
  overflow-y: auto;
}

.box-popup__search-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.box-popup__search-item {
  padding: 5px;
}

.box-popup__search-item label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 5px;
  transition: background-color 0.2s;
}

.box-popup__search-item label:hover {
  background-color: #f5f5f5;
  border-radius: 4px;
}

.box-popup__search-item input[type="checkbox"] {
  margin-right: 8px;
}

.box-popup__wback {
  margin-bottom: 20px;
}

.box-popup__wback a {
  color: #0066cc;
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid #0066cc;
  border-radius: 4px;
  transition: all 0.2s;
}

.box-popup__wback a:hover {
  background-color: #0066cc;
  color: white;
}

/* .c-ttl__01 {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: #333;
} */

/* .c-ttl__05 {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: #333;
} */

.c-al--c {
  text-align: center;
  margin-top: 26px;
}

.link-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.link-btns__item {
  display: flex;
  align-items: center;
}

.link-btns__count {
  font-size: 1.1rem;
  color: #333;
}

.link-btns__number {
  font-weight: bold;
  color: #ff6600;
  margin: 0 3px;
}

/* .c-btn__01 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  gap: 8px;
} */

.c-btn__01--black {
  background: #333;
  color: white;
}

.c-btn__01--black:hover {
  background: #555;
}

.c-btn__01:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.c-btn__01 .arr img {
  filter: brightness(0) invert(1);
}

.search-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.search-popup {
  background: white;
  border-radius: 8px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.popup-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  opacity: 0.7;
}

.popup-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.tab-buttons button {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  color: #666;
  position: relative;
  transition: all 0.3s;
}

.tab-buttons button.active {
  color: #ff6600;
  font-weight: bold;
}

.tab-buttons button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #ff6600;
}

.region-group {
  margin-bottom: 30px;
}

.region-group h3 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 5px;
  transition: background-color 0.2s;
}

.checkbox-label:hover {
  background-color: #f5f5f5;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  margin-right: 8px;
  cursor: pointer;
}

.checkbox-label span {
  font-size: 14px;
  color: #333;
}

.prefecture-list,
.city-list,
.highway-section,
.ic-section,
.route-section,
.station-section {
  margin-bottom: 20px;
}

.size-filter,
.ceiling-filter {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.size-filter h3,
.ceiling-filter h3 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.size-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.size-inputs input,
.ceiling-filter input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 120px;
}

.size-inputs span {
  color: #666;
}

.popup-footer {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cancel-btn,
.search-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cancel-btn {
  background: #f0f0f0;
  color: #666;
}

.cancel-btn:hover {
  background: #e0e0e0;
}

.search-btn {
  background: #ff6600;
  color: white;
  font-weight: bold;
}

.search-btn:hover {
  background: #ff5500;
}

.search-btn img {
  filter: brightness(0) invert(1);
}

/* CakePHP版との互換性のため、重複スタイルを整理 */
.box-mainmaps {
  width: 100%;
}

.box-popup__maps-rsubfl {
  margin-bottom: 20px;
}

.js-maxh {
  max-height: 400px;
  overflow-y: auto;
}

.box-popup__wmain {
  padding: 20px;
}

/* 日本地図SVG用のスタイル */
.japan-map-svg {
  width: 100%;
  height: auto;
  max-width: 500px;
}

.japan-map-svg path {
  fill: #e0e0e0;
  stroke: #999;
  stroke-width: 0.5;
  cursor: pointer;
  transition: fill 0.2s;
}

.japan-map-svg path:hover {
  fill: #ffd700;
}

.japan-map-svg path.selected {
  fill: #ff6600;
}

/* チェックボックスのスタイル改善 */
input[type="checkbox"] {
  margin-right: 6px;
  transform: scale(1.1);
}

/* スクロールバーのスタイル改善 */
.box-popup__search--maxh::-webkit-scrollbar {
  width: 8px;
}

.box-popup__search--maxh::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.box-popup__search--maxh::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.box-popup__search--maxh::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* CakePHP版互換: 選択済みエリア表示スタイル */
.selected_area {
    width: 640px;
    height: 150px;
    border: solid 1px #C0C0C0;
    text-align: left;
    float: left;
    overflow-y: scroll;
    padding: 0;
    margin-bottom: 20px;
    background: #ffffff;
}


/* CakePHP版と完全一致: draggableスタイル */
/* .draggable {
    width: 190px;
    padding: 0 10px;
    border: 1px solid #ccc;
    background: #eee;
    text-align: left;
    margin: 5px 5px;
    float: left;
    position: relative;
    min-height: 20px;
    line-height: 20px;
} */

.draggable .close {
    position: absolute;
    right: 0;
    top: 0;
    width: 16px;
    height: 16px;
    color: #AAAAAA;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 1px 1px 1px #ddc inset;
    text-shadow: 1px 1px 0 #fff;
}

.draggable .close:hover {
    color: #666;
}

/* 空の状態のプレースホルダー */
.selected-area-placeholder {
    padding: 20px;
    color: #999;
    font-size: 14px;
    text-align: center;
}

/* connectedSortableの互換性 */
.connectedSortable {
    min-height: 20px;
}

/* CakePHP版のmy_select_areaスタイルも追加 */
.my_select_area {
    display: inline-block;
    width: 210px;
    position: relative;
    vertical-align: bottom;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .box-popup__maps {
    padding: 30px;
  }
  
  .selected_area,
  .box-popup__searcht-listtags {
    width: 100%;
    max-width: 640px;
  }
  
  .box-popup__wmaps {
    max-height: calc(100vh - 200px);
    overflow-y: scroll;
  }
}

@media (max-width: 834px) {
  .box-popup__w {
    max-height: calc(100% - 50px);
    overflow-y: scroll;
  }
  
  .box-popup__w--nopd {
    padding: 45px 15px 25px 22px;
  }
  
  .box-popup__wclose {
    right: 2.2vw;
    top: 2.2vw;
  }
  
  .box-popup__wclose img {
    width: 23px;
  }
  
  .box-popup__wmaps--nopd .c-ttl__05 {
    margin-bottom: 15px;
  }
  
  .box-popup__maps {
    padding: 25px 15px 25px 30px;
  }
  
  .box-popup__maps-l {
    display: none;
  }
  
  .box-popup__maps-r {
    width: 100%;
    padding-left: 0;
  }
  
  .box-popup__search-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .link-btns {
    flex-direction: column;
    gap: 15px;
  }
  
  /* .c-btn__01 {
    width: 100%;
    padding: 15px 20px;
  } */
}

.box-popup__wmaps {
  max-height: calc(100vh - 200px);
  overflow-y: scroll;
}

@media (max-width: 768px) {
  .search-popup {
    width: 95%;
    max-height: 90vh;
  }
  
  .checkbox-group {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .popup-footer {
    flex-direction: column;
  }
  
  .cancel-btn,
  .search-btn {
    width: 100%;
    justify-content: center;
  }
  
  .selected_area,
  .box-popup__searcht-listtags {
    width: 100%;
    height: 120px;
    font-size: 12px;
  }
  
  .box-popup__searcht-listtags li span {
    padding: 3px 6px;
    font-size: 11px;
  }
}