/* プロフィール画像専用スタイル */

.profile-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.profile-image-placeholder {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* プロフィール写真スライダー専用スタイル */
.profile-gallery {
  position: relative;
  border-radius: 0.375rem;
  overflow: hidden;
  width: 100%;
}

.profile-gallery-item {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.profile-gallery-item img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.profile-gallery-item:hover img {
  transform: translate(-50%, -50%) scale(1.05);
}

/* カルーセルアイテム自体も300px高さに固定 */
#favoritePhotosCarousel .carousel-item {
  height: 300px !important;
  position: relative;
}

#favoritePhotosCarousel .carousel-item > .profile-gallery-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* カルーセル全体も300px高さに固定 */
#favoritePhotosCarousel {
  height: 300px !important;
  width: 100% !important;
}

#favoritePhotosCarousel .carousel-inner {
  height: 100% !important;
}

/* スライダーコントロールのスタイル */
#favoritePhotosCarousel .carousel-control-prev,
#favoritePhotosCarousel .carousel-control-next {
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* ホバー時に矢印ボタンを表示 */
#favoritePhotosCarousel:hover .carousel-control-prev,
#favoritePhotosCarousel:hover .carousel-control-next {
  opacity: 0.8;
  pointer-events: auto;
}

#favoritePhotosCarousel .carousel-control-prev:hover,
#favoritePhotosCarousel .carousel-control-next:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.7);
}

#favoritePhotosCarousel .carousel-control-prev {
  left: 10px;
}

#favoritePhotosCarousel .carousel-control-next {
  right: 10px;
}

/* インジケーターのスタイル */
#favoritePhotosCarousel .carousel-indicators {
  bottom: 10px;
  margin-bottom: 0;
}

#favoritePhotosCarousel .carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  margin: 0 3px;
  transition: background-color 0.3s ease;
}

#favoritePhotosCarousel .carousel-indicators button.active {
  background-color: rgba(255, 255, 255, 0.9);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  #favoritePhotosCarousel {
    height: 250px !important;
  }

  #favoritePhotosCarousel .carousel-item {
    height: 250px !important;
  }

  #favoritePhotosCarousel .carousel-control-prev,
  #favoritePhotosCarousel .carousel-control-next {
    width: 35px;
    height: 35px;
  }

  #favoritePhotosCarousel .carousel-control-prev {
    left: 5px;
  }

  #favoritePhotosCarousel .carousel-control-next {
    right: 5px;
  }

  /* モバイルでのタッチ操作改善 */
  .profile-gallery-item {
    touch-action: pan-y pinch-zoom;
  }

  #favoritePhotosCarousel .carousel-control-prev,
  #favoritePhotosCarousel .carousel-control-next {
    touch-action: manipulation;
  }
}

@media (max-width: 576px) {
  #favoritePhotosCarousel {
    height: 200px !important;
  }

  #favoritePhotosCarousel .carousel-item {
    height: 200px !important;
  }

  #favoritePhotosCarousel .carousel-control-prev,
  #favoritePhotosCarousel .carousel-control-next {
    width: 30px;
    height: 30px;
  }

  /* 小画面でのインジケーター調整 */
  #favoritePhotosCarousel .carousel-indicators {
    bottom: 5px;
  }

  #favoritePhotosCarousel .carousel-indicators button {
    width: 6px;
    height: 6px;
    margin: 0 2px;
  }
}

/* プロフィール写真編集オーバーレイ */
.profile-photo-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
  z-index: 10;
}

.profile-gallery-item:hover .profile-photo-edit-overlay {
  opacity: 1;
}

.profile-photo-edit-overlay i {
  font-size: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* モバイルでの編集オーバーレイ調整 */
@media (max-width: 768px) {
  .profile-photo-edit-overlay {
    opacity: 0.3; /* モバイルでは常に少し表示 */
  }

  .profile-photo-edit-overlay i {
    font-size: 1.5rem;
  }
}

/* アクセシビリティ改善 */
#favoritePhotosCarousel .carousel-control-prev:focus,
#favoritePhotosCarousel .carousel-control-next:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

#favoritePhotosCarousel .carousel-indicators button:focus {
  outline: 2px solid #007bff;
  outline-offset: 1px;
}

/* 自動めぐり用のアニメーション調整 */
#favoritePhotosCarousel .carousel-item {
  transition: transform 0.6s ease-in-out;
}

/* プロフィール写真サイズに合わせたカード調整 */
.profile-photo-container .card {
  max-width: 300px;
  margin: 0 auto;
}

.profile-photo-container .card-img-top {
  height: 200px;
  object-fit: cover;
}
