body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.example-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#scanning-overlay {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    z-index: 1000;
    transition: all 0.3s ease;
    font-family: 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fade-out {
    opacity: 0 !important;
    pointer-events: none;
    transform: translateX(-50%) translateY(-10px);
}

/* 撮影共有モーダル */
.share-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(6px);
    opacity: 1;
}

.share-modal.hidden {
    opacity: 0;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 22px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    overflow: hidden;
}

.image-container {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #111;
}

.captured-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 60vh;
    object-fit: contain;
}

.save-text {
    font-size: 14px;
    color: #8e8e93;
    text-align: center;
    margin: 0;
}

.modal-buttons {
    width: 100%;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-btn {
    flex: 1 1 140px;
    padding: 14px 20px;
    font-size: 16px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-btn {
    background: linear-gradient(135deg, #007aff, #4da3ff);
    color: #fff;
}

.close-btn {
    background: rgba(242, 242, 247, 0.95);
    color: #000;
}

.modal-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.modal-btn:active {
    transform: scale(0.97);
}

@media (max-width: 480px) {
    .modal-content {
        padding: 18px;
        border-radius: 20px;
    }

    .modal-btn {
        flex: 1 1 100%;
    }
}

/* ボタンコンテナ */
#button-container {
    position: fixed;
    bottom: calc(40px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 20px;
    z-index: 1000;
}

/* 動画制御ボタン（メインボタン） */
#video-control {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    color: #333;
    border: none;
    font-size: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

#video-control:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

#video-control:active {
    transform: scale(0.95);
}

.fa-play {
    margin-left: 4px;
}

/* サブボタン */
.social-links {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 3px solid #ffffff;
    font-size: 24px;
    box-sizing: border-box;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    overflow: hidden;
}

.social-links:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.8);
}

.social-links:active {
    transform: scale(0.95);
}

/* ボタン内の画像 */
.button-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
}

#record-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    color: white;
    font-size: 24px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
    backdrop-filter: blur(5px);
    overflow: hidden;
    line-height: 1;
}

#record-button i {
    font-size: 24px;
    color: #ffffff;
}

#record-button:hover {
    transform: scale(1.05);
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

#record-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#record-button.capturing {
    animation: capturePulse 0.45s ease;
}

@keyframes capturePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ページのスタイル調整 */
#page-base {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#page-flip {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* 動画スクリーンのエフェクト */
#video-screen {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    border-radius: 0.02;
}

/* ローディングアニメーション */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 999;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}


/* アニメーション用のキーフレーム */
@keyframes page-flip {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

@keyframes video-appear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes text-glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.6);
    }
}

/* シークバー */
#seekbar-container {
    position: fixed;
    bottom: calc(140px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 15px 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#seekbar-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

#current-time,
#duration-time {
    color: white;
    font-size: 14px;
    font-family: 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    min-width: 40px;
    text-align: center;
}

#seekbar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

#seekbar-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

#seekbar-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.2s ease;
}

#seekbar-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

#seekbar-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #scanning-overlay {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    #video-control {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .social-links {
        width: 60px;
        height: 60px;
        font-size: 22px;
        border-width: 3px;
    }

    .button-logo {
        width: 38px;
        height: 38px;
    }

    #record-button {
        width: 60px;
        height: 60px;
    }
    
    #button-container {
        gap: 15px;
        bottom: calc(30px + env(safe-area-inset-bottom));
    }
    
    #seekbar-container {
        bottom: calc(120px + env(safe-area-inset-bottom));
        width: 80%;
        padding: 12px 20px;
        margin: 0 auto;
    }
    
    #seekbar-wrapper {
        gap: 10px;
    }
    
    #current-time,
    #duration-time {
        font-size: 12px;
        min-width: 35px;
    }
}

/* 小型スマートフォン向けの追加調整 */
@media (max-width: 480px) {
    #seekbar-container {
        width: 75%;
        padding: 10px 15px;
    }
    
    #seekbar-wrapper {
        gap: 8px;
    }
    
    #current-time,
    #duration-time {
        font-size: 11px;
        min-width: 30px;
    }
}
