/* QR Code Reader Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.subtitle {
    text-align: center;
    margin-bottom: 40px;
    color: #666;
    font-size: 1.2em;
}

.hidden {
    display: none !important;
}

/* セクション共通スタイル */
.upload-section,
.result-section,
.error-section,
.feature-section,
.usage-section,
.ad-section {
    background: white;
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* ===== セクションタイトル ===== */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== アップロードエリア ===== */
.upload-area {
    border: 3px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 200px;
    margin-bottom: 2rem;
}

.upload-area:hover {
    border-color: #10b981;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #059669;
    background: linear-gradient(135deg, #a7f3d0, #86efac);
}

.upload-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
}

.upload-area p {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.upload-link {
    color: #10b981;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.upload-note {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 1rem;
}

/* ===== プライバシー通知 ===== */
.privacy-notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: 10px;
}

.privacy-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.privacy-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.privacy-content p {
    font-size: 0.875rem;
    color: #1e3a8a;
    line-height: 1.5;
}

/* ===== ローディング ===== */
.upload-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ===== 画像プレビュー ===== */
.image-preview-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    position: relative;
}

.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
}

.qr-count {
    font-size: 1rem;
    font-weight: 700;
    color: #10b981;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    border: 2px solid #10b981;
}

/* ===== QR結果表示 ===== */
.qr-results {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.qr-result-card {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #bbf7d0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.qr-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 12px 12px 0 0;
}

.qr-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
}

.qr-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qr-type-badge {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.qr-type-badge.url {
    background: #3b82f6;
}

.qr-type-badge.text {
    background: #6b7280;
}

.qr-type-badge.email {
    background: #f59e0b;
}

.qr-type-badge.phone {
    background: #8b5cf6;
}

.qr-copy-btn {
    background: transparent;
    color: #10b981;
    border: 1px solid #10b981;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qr-copy-btn:hover {
    background: #10b981;
    color: white;
}

.qr-content {
    margin-bottom: 1rem;
}

.qr-data {
    font-size: 1rem;
    color: #374151;
    word-break: break-all;
    line-height: 1.6;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.qr-url {
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
}

.qr-url:hover {
    color: #1d4ed8;
}

.qr-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===== エラーセクション ===== */
.error-card {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 2px solid #fecaca;
    border-radius: 12px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.error-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1rem;
    color: #7f1d1d;
    margin-bottom: 2rem;
}

.error-tips {
    text-align: left;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #fca5a5;
}

.error-tips h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 1rem;
}

.error-tips ul {
    list-style-type: disc;
    padding-left: 1.25rem;
}

.error-tips li {
    font-size: 0.875rem;
    color: #7f1d1d;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ===== アクションボタン ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* ===== 特徴カード ===== */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #10b981;
}

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.feature-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.feature-content p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
}

/* ===== 使い方カード ===== */
.usage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.usage-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.usage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #10b981;
}

.usage-step {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.usage-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.usage-content p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
}

/* ===== アニメーション ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section, .error-section {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-result-card {
    animation: slideInUp 0.3s ease-out;
}

/* ===== レスポンシブデザイン ===== */
@media (max-width: 768px) {
    .subtitle {
        font-size: 1rem;
    }
    
    .upload-section,
    .result-section,
    .error-section,
    .feature-section,
    .usage-section,
    .ad-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .upload-area h3 {
        font-size: 1.25rem;
    }
    
    .privacy-notice {
        flex-direction: column;
        text-align: center;
    }
    
    .qr-result-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .qr-actions {
        justify-content: center;
    }
    
    .error-card {
        padding: 2rem 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .feature-cards,
    .usage-cards {
        grid-template-columns: 1fr;
    }
    
    .feature-card,
    .usage-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 1.5rem 0.75rem;
    }
    
    .error-icon {
        font-size: 3rem;
    }
    
    .feature-card,
    .usage-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .qr-data {
        font-size: 0.875rem;
    }
}