/* WebP変換ツール - 統一スタイル */

:root {
    --container-max: 1200px;
    --radius-lg: 12px;
    --primary-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: var(--primary-grad);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.tool-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

/* 入力セクション */
.input-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

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

.section-header h3 {
    font-size: 1.25rem;
    color: #2d3748;
    margin: 0;
    font-weight: 600;
}

.input-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.supported-formats {
    background: #edf2f7;
    color: #4a5568;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #667eea;
    background: #ebf8ff;
    transform: translateY(-2px);
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #4a5568;
}

.drop-hint {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 1rem;
}

#fileInput {
    display: none;
}

.upload-btn {
    background: var(--primary-grad);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: all;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 設定セクション */
.settings-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.settings-content h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
}

.quality-control {
    margin-bottom: 2rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-weight: 600;
    color: #2d3748;
}

.quality-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quality-input input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
}

.quality-display {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
    min-width: 3rem;
    text-align: center;
}

.quality-unit {
    color: #718096;
    font-size: 0.9rem;
}

.quality-guide {
    font-size: 0.8rem;
    color: #a0aec0;
}

.advanced-settings {
    margin-top: 2rem;
}

.advanced-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    margin-top: 0.2rem;
}

.setting-item span {
    font-weight: 500;
    color: #2d3748;
}

.setting-item small {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* アクションセクション */
.action-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.primary-btn, .convert-btn {
    background: var(--primary-grad);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    font-size: 1rem;
    min-width: 200px;
}

.primary-btn:hover, .convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.primary-btn:disabled, .convert-btn:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clear-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 1rem;
}

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

.preview-btn {
    background: #38a169;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.preview-btn:hover:not(:disabled) {
    background: #2f855a;
    transform: translateY(-2px);
}

.preview-btn:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
}

/* ファイル・出力セクション */
.files-section, .output-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.files-info, .output-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.files-list, .results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item, .result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-preview {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.file-details h4 {
    margin-bottom: 0.25rem;
    color: #2d3748;
    font-size: 1rem;
}

.file-details p {
    color: #718096;
    font-size: 0.9rem;
}

.download-all-btn {
    background: #38a169;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-all-btn:hover {
    background: #2f855a;
    transform: translateY(-2px);
}

.share-btn {
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.download-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* 統計セクション */
.conversion-stats {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 1.5rem;
    color: #667eea;
}

.stat-content {
    text-align: left;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
}

/* 対応状況セクション */
.compatibility-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.compatibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.browser-support {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
}

.support-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.supported .support-header i {
    color: #38a169;
}

.not-supported .support-header i {
    color: #e53e3e;
}

.browser-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.browser-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
}

.browser-item i {
    font-size: 1.2rem;
    color: #667eea;
    width: 1.5rem;
}

.browser-item span {
    font-weight: 500;
    color: #2d3748;
}

.browser-item small {
    color: #718096;
    margin-left: auto;
}

.compatibility-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.note-icon {
    color: #d69e2e;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.note-text {
    color: #744210;
    line-height: 1.5;
}

/* WebP情報セクション */
.webp-info-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.webp-advantages {
    margin-bottom: 2rem;
}

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

.advantage-item {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.advantage-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.advantage-item h5 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.advantage-item p {
    color: #4a5568;
    line-height: 1.5;
}

.format-comparison {
    margin-bottom: 2rem;
}

.comparison-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.webp-row {
    background: #f0fff4;
}

/* 情報セクション */
.info-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    font-size: 1.5rem;
    color: #667eea;
    margin-top: 0.25rem;
}

.feature-item h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: #4a5568;
    line-height: 1.6;
}

.usage-examples {
    margin-bottom: 2rem;
}

.usage-examples h4 {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.usage-examples ul {
    list-style: none;
    padding: 0;
}

.usage-examples li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    color: #4a5568;
}

.usage-examples li:last-child {
    border-bottom: none;
}

.tips-section {
    margin-bottom: 2rem;
}

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

.tip-item {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.tip-item h5 {
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.tip-item p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

.privacy-note {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 1.5rem;
}

.privacy-icon {
    font-size: 1.5rem;
    color: #38a169;
}

.privacy-text strong {
    color: #276749;
    font-size: 1.1rem;
}

.privacy-text p {
    color: #2f855a;
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .input-section,
    .settings-section,
    .files-section,
    .output-section {
        padding: 1.5rem;
    }
    
    .action-section {
        justify-content: stretch;
    }
    
    .primary-btn,
    .convert-btn {
        min-width: auto;
        flex: 1;
    }
    
    .advanced-grid {
        grid-template-columns: 1fr;
    }
    
    .compatibility-grid {
        grid-template-columns: 1fr;
    }
    
    .advantage-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .tool-card {
        padding: 1rem;
    }
    
    .input-section,
    .settings-section,
    .files-section,
    .output-section {
        padding: 1rem;
    }
    
    .drop-zone {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .input-options,
    .files-info,
    .output-options {
        width: 100%;
        justify-content: stretch;
    }
    
    .supported-formats,
    .download-all-btn,
    .share-btn {
        flex: 1;
        text-align: center;
    }
}

/* ドロップゾーンプレビュー */
.drop-zone-preview {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
}

.drop-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.drop-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    pointer-events: none;
}

.preview-success {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #48bb78;
}

.preview-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.drop-preview-overlay .upload-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.drop-preview-overlay .upload-btn:hover {
    background: white;
    color: #667eea;
}