/* モーダルとイメージブラウザのスタイル */

/* モーダルオーバーレイ（全画面背景） */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

/* モーダル本体 */
.modal-container {
  max-width: 90vw;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  margin: 20px;
}

/* モーダルヘッダー */
.modal-header {
  padding: 20px 30px;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #333;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: #888;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

/* モーダルボディ（スクロール可能） */
.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

/* 画像グリッド */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

/* 画像カード */
.image-card {
  border: 2px solid #b0b0b0;
  border-radius: 8px;
  padding: 15px;
  background: #fafafa;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* サムネイル画像 */
.image-thumbnail {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #d1d1d1;
  object-fit: contain;
  background: #fff;
}

/* ファイル情報 */
.image-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.image-filename {
  font-size: 0.9rem;
  font-weight: bold;
  color: #333;
  word-break: break-all;
}

.image-aspect {
  font-size: 0.85rem;
  color: #666;
  background: #e8f5e9;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  font-weight: 500;
}

/* カードボタン */
.image-card-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-card button {
  background: linear-gradient(90deg, #bdbdbd 0%, #e0e0e0 100%);
  border: 2px solid #b0b0b0;
  border-radius: 6px;
  padding: 10px 15px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s, border-color 0.2s;
  outline: none;
}

.image-card button:hover {
  background: linear-gradient(90deg, #9e9e9e 0%, #cccccc 100%);
  border-color: #888;
  box-shadow: 0 4px 12px rgba(120, 120, 120, 0.18);
  transform: translateY(-2px) scale(1.03);
}

.image-card button:active {
  background: linear-gradient(90deg, #757575 0%, #bdbdbd 100%);
  border-color: #888;
  transform: translateY(1px) scale(0.98);
}

/* モーダルフッター */
.modal-footer {
  padding: 20px 30px;
  border-top: 2px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-footer button {
  background: linear-gradient(90deg, #bdbdbd 0%, #e0e0e0 100%);
  border: 2px solid #b0b0b0;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s, border-color 0.2s;
  outline: none;
}

.modal-footer button:hover {
  background: linear-gradient(90deg, #9e9e9e 0%, #cccccc 100%);
  border-color: #888;
  box-shadow: 0 4px 12px rgba(120, 120, 120, 0.18);
  transform: translateY(-2px) scale(1.03);
}

.modal-footer button:active {
  background: linear-gradient(90deg, #757575 0%, #bdbdbd 100%);
  border-color: #888;
  transform: translateY(1px) scale(0.98);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .modal-container {
    max-width: 95vw;
    max-height: 90vh;
    margin: 10px;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px;
  }
}
