body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #7f8c8d;
    display: flex;
    flex-direction: column; /* ボタンを縦に並べるため */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #ecf0f1;
}

/* ボタン用の基本的なスタイリング */
.control-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}
.control-button:hover {
    background-color: #2980b9;
}


/* オーバーレイのスタイル */
.popup-overlay {
    display: none; /* 初期状態は非表示 */
    position: fixed; /* 画面全体を覆う */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明の黒 */
    z-index: 9999999; /* ポップアップ本体より手前、他のコンテンツより奥 */
}

.popup-dialog {
    background-color: #424242; /* ダイアログの背景色 (濃いグレー) */
    border-radius: 16px; /* 大きめの角丸 */
    padding: 25px 30px;
    width: 700px; /* 画像の幅に合わせる */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: none; /* JavaScriptで制御するため初期は非表示 */
    position: fixed;
    flex-direction: column;
    gap: 20px; /* 各セクション間のスペース */
    z-index: 10000000; /* オーバーレイより手前に表示 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.popup-dialog__title {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffffff;
    margin: 0 0 5px 0; /* タイトルの下のマージンを少し調整 */
    text-align: left;
}

.popup-dialog__content-wrapper {
    display: flex;
    gap: 20px; /* カメラビューと情報ビューの間のスペース */
    align-items: stretch; /* 高さを揃える */
}

.popup-dialog__camera-view {
    flex: 2; /* カメラビューの幅を広めに */
    background-color: #333;
    border-radius: 8px;
    overflow: hidden; /* 画像が角丸からはみ出ないように */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px; /* カメラフィードの最小高さ */
}

.popup-dialog__camera-img {
    width: 100%;
    height: 100%;
    display: fixed;
    object-fit: cover; /* アスペクト比を保ちつつコンテナにフィット */
    border-radius: 8px;
}

.popup-dialog__info-view {
    flex: 1; /* 情報ビューの幅 */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 内容を中央に配置 */
}

.scanned-data-box {
    background-color: #ffffff;
    color: #2c3e50; /* 暗めのテキストカラー */
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.scanned-data-box p {
    margin: 8px 0;
    word-break: break-all;
}
.scanned-data-box p:first-child {
    margin-top: 0;
}
.scanned-data-box p:last-child {
    margin-bottom: 0;
}

.popup-dialog__selection-area {
    display: flex;
    flex-direction: column;
    gap: 8px; /* ラベルと入力行の間のスペース */
}

.popup-dialog__selection-label {
    font-size: 0.9em;
    color: #bdc3c7; /* やや暗めの明るい色 */
    margin: 0;
    text-align: left;
}

.popup-dialog__selected-item-row {
    display: flex;
    gap: 15px; /* テキスト表示とボタンの間のスペース */
    align-items: stretch; /* 高さを揃える */
}

.selected-display {
    flex-grow: 1;
    background-color: #ffffff;
    color: #2c3e50;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1em;
    display: flex;
    align-items: center; /* テキストを垂直中央に */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 48px; /* ボタンの高さと合わせるため */
    box-sizing: border-box;
}

.action-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    min-height: 48px; /* テキスト表示部分と高さを合わせる */
    box-sizing: border-box;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn.btn-orange {
    background-color: #F4A261;
}
.action-btn.btn-orange:hover {
    background-color: #e8924e;
}

.action-btn.btn-blue {
    background-color: #2A9D8F;
}
.action-btn.btn-blue:hover {
    background-color: #258a7e;
}

.action-btn.btn-green {
    background-color: #8CB369;
}
.action-btn.btn-green:hover {
    background-color: #7da05b;
}

.action-btn.btn-default {
    background-color: #6c757d;
}
.action-btn.btn-default:hover {
    background-color: #5a6268;
}


/* QRコード読み取り成功時のアニメーション */
@keyframes highlightSuccess {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseEffect {
  0% { background-color: rgba(46, 204, 113, 0.5); }
  50% { background-color: rgba(46, 204, 113, 0.8); }
  100% { background-color: rgba(46, 204, 113, 0.5); }
}

.qr-success-highlight {
  animation: highlightSuccess 0.5s ease-in-out 2;
  font-weight: bold;
  transition: all 0.3s ease;
}

.qr-success-pulse {
  animation: pulseEffect 0.8s ease-in-out 3;
  /* border: 2px solid #2ecc71; */
  transition: all 0.1s ease;

}



.floating-button {
    position: fixed;
    bottom: 320px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1000; /* Ensures button appears above other elements */
    border: none;
    transition: background-color 0.3s, transform 0.2s;
  }

  .floating-button:hover {
    background-color: #2980b9;
    transform: scale(1.05);
  }

  .floating-button:active {
    transform: scale(0.95);
  }

  .floating-button span {
    font-size: 32px;
  }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* モバイル対応 */
@media (max-width: 768px) {
    #reader {
        width: 90%;
        height: 70vh;
        max-height: 600px;
    }
}

/* ポップアップヘッダー用のスタイル */
.popup-dialog__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* 閉じるボタンのスタイル */
.popup-dialog__close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.popup-dialog__close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}