/* Image Dimension Checker 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,
.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, #f8fafc, #f1f5f9);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 200px;
}

.upload-area:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.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: #3b82f6;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

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

/* ===== ローディング ===== */
.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 #3b82f6;
    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;
}

.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;
}

.image-filename {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #d1d5db;
}

/* ===== 結果カード ===== */
.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 12px 12px 0 0;
}

.size-card::before {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.ratio-card::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.filesize-card::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.result-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.result-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1rem;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    word-break: break-all;
}

.result-detail {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* ===== 詳細情報 ===== */
.detail-info {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.info-card {
    background: linear-gradient(135deg, #fefce8, #fef3c7);
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 2rem;
}

.info-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 1.5rem;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #fbbf24;
}

.info-label {
    font-weight: 600;
    color: #92400e;
}

.info-value {
    font-weight: 700;
    color: #1f2937;
    text-align: right;
    word-break: break-all;
}

/* ===== よくある比率 ===== */
.common-ratios {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border: 1px solid #c4b5fd;
    border-radius: 12px;
    padding: 2rem;
}

.common-ratios h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #5b21b6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.ratio-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.ratio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ratio-item:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.ratio-item.match {
    border-color: #10b981;
    background: #d1fae5;
}

.ratio-name {
    font-weight: 700;
    color: #374151;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.ratio-desc {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
}

/* ===== アクションボタン ===== */
.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, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 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: #3b82f6;
}

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    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: #3b82f6;
}

.usage-step {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #3b82f6;
    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 {
    animation: fadeIn 0.5s ease-out;
}

/* ===== レスポンシブデザイン ===== */
@media (max-width: 768px) {
    .subtitle {
        font-size: 1rem;
    }
    
    .upload-section,
    .result-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;
    }
    
    .result-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
    
    .ratio-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .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;
    }
    
    .result-icon {
        font-size: 2rem;
    }
    
    .feature-card,
    .usage-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .ratio-list {
        grid-template-columns: 1fr;
    }
}