/* フォントの定義（ファイルの先頭に追加） */
:root {
  --main-font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans CJK JP', sans-serif;
}

body {
    overflow: hidden;
    font-family: var(--main-font);
}

/* テキストを含む要素にフォントを適用 */
.confirm-content,
.sidebar-content,
.slider-container label,
#saveMessage,
.setting-label,
.sidebar-header h2,
.confirm-buttons button,
.delete-all-button {
    font-family: var(--main-font);
}

#buttonContainer {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 20;
}

#captureButton {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    border: none;
    z-index: 10;
}

#captureButton i {
    font-size: 24px;
}

#closeButton {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 165, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    border: none;
}

#closeButton i {
    font-size: 24px;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 40;
}

#capturedImage {
    max-width: 90%;
    max-height: 90%;
    border: 5px solid #FFFFFF;
    border-radius: 10px;
}

#saveMessage {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    z-index: 45;
}

/* 共通のスライダーコンテナの基本スタイル */
.slider-container {
    display: none;
    position: fixed;
    top: 10px !important;  /* !importantを追加して確実に上書き */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 300px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 10px;
    z-index: 30;
    flex-direction: column;
    align-items: center;
}

/* 共通のスライダーグループスタイル */
.slider-group {
    width: 100%;
    margin-bottom: 15px;
}

.slider-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.slider-wrapper {
    display: flex;
    align-items: center;
}

/* 共通のスライダースタイル */
.slider-wrapper input[type="range"] {
    -webkit-appearance: none;
    width: calc(100% - 60px);
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    outline: none;
    border-radius: 1px;
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.slider-wrapper input[type="range"]::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
    border: none;
}

.slider-wrapper input[type="range"]::-moz-range-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

/* リセットボタンのスタイル */
.reset-button {
    width: 50px;
    height: 36px;
    margin-left: 10px;
    background-color: rgba(255, 165, 0, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* テキスト選択を無効にする */
body,
.slider-container,
button,
label {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#shareButton,
#viewerShareButton {
    position: absolute;
    left: calc(50% - 120px);
    bottom: 0;
    width: 60px;
    height: 60px;
    background-color: #4CAF50;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    border: none;
}

#shareButton i,
#viewerShareButton i {
    font-size: 24px;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* サムネイルのスタイル */
.thumbnail-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 15;
}

.thumbnail-stack {
    position: relative;
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail.has-image {
    opacity: 1;
}

.stack-indicator {
    position: absolute;
    right: -5px;
    top: -10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

/* 画像ビューワーのスタイル */
.image-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-out;
}

.viewer-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-slide img {
    max-width: 90%;
    max-height: 90%;
    border: 5px solid #FFFFFF;
    border-radius: 10px;
    object-fit: contain;
    margin: auto; /* 画像を中央に配置 */
}

/* ビューワーコントロールの位置を通常モードと合わせる */
.viewer-controls {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 45;
}

/* ビューワーの戻るボタンと共有ボタンのスタイルを通常モードと統一 */
#viewerCloseButton {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 165, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    border: none;
}

#viewerCloseButton i {
    font-size: 24px;
}

#viewerShareButton {
    position: absolute;
    left: calc(50% - 120px);
    bottom: 0;
    width: 60px;
    height: 60px;
    background-color: #4CAF50;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    border: none;
}

#viewerShareButton i {
    font-size: 24px;
}

/* 設定ボタンのスタイル */
.settings-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.settings-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* サイドバーのスタイル */
.settings-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    z-index: 30;
    transition: left 0.3s ease;
}

.settings-sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
}

.close-sidebar-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-content {
    padding: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.setting-label {
    font-size: 16px;
}

/* 全削除ボタンのスタイル */
.delete-all-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    z-index: 45;
}

.delete-all-button:hover {
    background-color: rgba(255, 0, 0, 0.8);
}

/* トグルスイッチのスタイル */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 右上のボタングループのスタイル */
.reload-button,
.adjust-button,
.color-adjust-button {
    position: fixed;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.reload-button:hover,
.adjust-button:hover,
.color-adjust-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* 個別の位置調整 */
.reload-button {
    top: 20px;
}

.color-adjust-button {
    top: 74px; /* adjust-buttonの下 (20px + 44px + 10px) */
}

.adjust-button {
    top: 128px; /* reload-buttonの下 (74px + 44px + 10px) */
}

.color-adjust-button i {
    font-size: 18px;
}

/* 確認ダイアログのスタイル */
.confirm-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.confirm-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.confirm-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.confirm-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#confirmYes {
    background-color: #dc3545;
    color: white;
}

#confirmNo {
    background-color: #6c757d;
    color: white;
}

/* Z軸スライダーのスタイルを更新 */
.z-axis-slider-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 40px;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.z-axis-slider-container input[type="range"] {
    width: 100%;
    height: 2px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.5);
    outline: none;
    border-radius: 1px;
}

.z-axis-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.z-axis-slider-container input[type="range"]::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
    border: none;
}

.z-axis-slider-container input[type="range"]::-moz-range-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

/* スライダーのスタイルをカスタマイズ */
#colorSliders .slider-group {
    margin-bottom: 15px;
}

/* グラデーションを削除し、白色に統一 */
#colorSliders input[type="range"] {
    background: rgba(255, 255, 255, 0.5);
}

#colorSliders label {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.upload-button {
    position: fixed;
    bottom: 10px;
    left: 20px;
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 24px;
    border: none;
    z-index: 10;
}

.upload-button i {
    font-size: 24px;
}

  