/* ===================================
WebP→JPEG/PNG変換ツール専用スタイル
=================================== */

/* ===================================
出力設定セクション
=================================== */
.output-settings {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.setting-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.setting-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.setting-label i {
    color: var(--info);
    font-size: 16px;
}

.setting-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s;
}

.setting-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.25);
}

#customColorInput {
    margin-top: 8px;
    width: 100%;
    height: 36px;
    padding: 4px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
}

.settings-note {
    font-size: 12px;
    color: var(--text-secondary);
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-note i {
    color: #856404;
}

/* ===================================
ファイルリスト（jpeg-webp.cssと同様）
=================================== */
.file-list {
    margin-bottom: 30px;
}

.file-item {
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.file-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gray-300);
    transition: all 0.3s;
}

.file-item.status-waiting::before {
    background: #ffc107;
}

.file-item.status-processing::before {
    background: var(--info);
    animation: pulse 1.5s infinite;
}

.file-item.status-complete::before {
    background: var(--success);
}

.file-item.status-error::before {
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.file-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.1);
}

.file-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.file-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.file-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-meta-item i {
    font-size: 11px;
    width: 14px;
    text-align: center;
}

.file-meta-value {
    font-weight: 500;
    color: var(--text-primary);
}

.file-meta-value span {
    font-weight: 600;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.file-status {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-complete {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

/* ===================================
ステータス情報
=================================== */
.status-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
    color: #856404;
}

.status-ready {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.status-processing {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ===================================
アクションバー（jpeg-webp.cssと同様）
=================================== */
.action-bar {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.action-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.action-stats {
    display: flex;
    gap: 30px;
}

.action-stat {
    text-align: center;
}

.action-stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
    display: block;
}

.action-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 2px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 12px 24px;
    border-radius: 6px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.convert-btn {
    background: var(--success);
    color: white;
}

.convert-btn:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.download-zip-btn {
    background: var(--accent);
    color: var(--primary);
}

.download-zip-btn:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-500);
}

.clear-btn {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 10px 20px;
    font-size: 14px;
}

.clear-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* ===================================
個別ダウンロードボタン
=================================== */
.download-link {
    background: var(--info);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.download-link:hover {
    background: var(--info-hover);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

/* ===================================
プログレスセクション
=================================== */
.progress-section {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-title {
    font-weight: bold;
    color: var(--text-primary);
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--gray-300);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ===================================
処理中オーバーレイ
=================================== */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.processing-modal {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
}

.processing-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--gray-100);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.processing-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.processing-progress {
    width: 100%;
    height: 6px;
    background: var(--gray-300);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.processing-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

/* ===================================
レスポンシブ対応
=================================== */
@media (max-width: 768px) {
    .setting-row {
        flex-direction: column;
    }

    .setting-group {
        width: 100%;
    }

    .file-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .file-info {
        width: 100%;
    }

    .file-thumbnail {
        width: 50px;
        height: 50px;
    }

    .file-meta {
        flex-direction: column;
        gap: 8px;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .action-bar-content {
        flex-direction: column;
        text-align: center;
    }

    .action-stats {
        width: 100%;
        justify-content: space-around;
    }

    .action-buttons {
        width: 100%;
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}