/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    outline: none; /* ペースト機能のためのtabindexでのフォーカス時のアウトラインを非表示 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
.main-header {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.main-header h1 {
    font-size: 1.8em;
    margin-bottom: 0;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* メインコンテンツ */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* アップロードセクション */
.upload-section {
    margin-bottom: 30px;
}

/* サンプル画像セクション */
.sample-images-section {
    margin-bottom: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.sample-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sample-image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
}

.sample-image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.sample-image-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.sample-image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 8px 4px 4px;
    font-size: 0.8em;
    font-weight: bold;
    text-align: center;
}

.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #3498db;
    background: #ecf0f1;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #e74c3c;
    background: #ffeaa7;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: auto;
}


.upload-area p {
    font-size: 1em;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* プレビューセクション */
.preview-section {
    text-align: center;
    margin-bottom: 30px;
}

.image-preview {
    margin-bottom: 20px;
}

.image-preview img {
    max-width: 600px;
    max-height: 600px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.analyze-btn {
    background: linear-gradient(135deg, #fd79a8 0%, #fdcb6e 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.analyze-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

/* 結果セクション */
.result-section {
    text-align: center;
}

.result-box {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border: 5px solid #e91e63;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.result-text {
    font-size: 4em;
    font-weight: 900;
    color: #ff1744;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.confidence-text {
    font-size: 1.5em;
    color: #c2185b;
    font-weight: bold;
}

.detail-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
    font-family: 'Courier New', monospace;
    white-space: pre-line;
    border: 2px solid #dee2e6;
}


/* ローディングセクション */
.loading-section {
    text-align: center;
    padding: 40px;
}

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

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

.loading-section p {
    font-size: 1.2em;
    color: #7f8c8d;
}

/* 情報セクション */
.info-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.info-content h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.info-content h3 {
    color: #34495e;
    margin: 20px 0 10px 0;
    font-size: 1.2em;
}

.info-content ul {
    list-style-type: none;
    padding-left: 0;
}

.info-content li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.info-content li::before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .main-header h1 {
        font-size: 1.5em;
    }
    
    .main-content {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .upload-area {
        padding: 15px;
        min-height: 60px;
    }
    
    .upload-area p {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    .sample-images-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .result-text {
        font-size: 2.5em;
    }
    
    .image-preview img {
        max-width: 100%;
        max-height: 300px;
    }
    
    .sample-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sample-image-item img {
        height: 80px;
    }
    
    .info-section {
        padding: 20px;
    }
    
    .info-content h2 {
        font-size: 1.3em;
    }
    
    .info-content h3 {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 12px;
    }
    
    .main-header h1 {
        font-size: 1.3em;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .upload-area {
        padding: 10px;
        min-height: 50px;
    }
    
    
    .upload-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .sample-images-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .result-text {
        font-size: 2em;
    }
    
    .image-preview img {
        max-width: 100%;
        max-height: 250px;
    }
    
    .sample-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .sample-image-item img {
        height: 60px;
    }
    
    .sample-image-label {
        font-size: 0.7em;
        padding: 4px 2px 2px;
    }
    
    .detail-box {
        font-size: 0.9em;
        padding: 15px;
    }
}