/* 全体のスタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

h1 {
    margin-bottom: 10px;
    color: #0066cc;
}

/* ビデオとスキャンエリアのスタイル */
.video-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

video {
    width: 100%;
    height: auto;
    display: block;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* スキャンオーバーレイ */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.scanner-frame {
    width: 70%;
    height: 70%;
    border: 2px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 0 0 5000px rgba(0, 0, 0, 0.3);
}

/* ボタンのスタイル */
.controls {
    margin: 20px 0;
}

button {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0055aa;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 結果表示のスタイル */
.result-container {
    margin-top: 20px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.result-status {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
}

.result-status.success {
    color: #00cc66;
}

.result-status.error {
    color: #cc0000;
}

.result-status.loading {
    color: #0066cc;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.result-message {
    font-size: 16px;
    margin-bottom: 10px;
}

.result-name {
    font-size: 20px;
    font-weight: bold;
    color: #0066cc;
}

.auto-rescan-message {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 15px;
    animation: pulse 1.5s infinite;
}

/* ユーティリティクラス */
.hidden {
    display: none;
}

/* レスポンシブデザイン */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .video-container {
        max-width: 100%;
    }
    
    button {
        width: 100%;
        margin: 5px 0;
    }
}
