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

/* 基本スタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

/* メインコンテンツ */
.main {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* タブナビゲーション */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f8fafc;
    color: #4a5568;
}

.tab-btn.active {
    color: #667eea;
    background: #f0f4ff;
    border-bottom-color: #667eea;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

/* タブコンテンツ */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

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

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: #667eea;
}

.upload-area p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem !important;
    color: #718096 !important;
}

/* コントロールセクション */
.controls-section {
    display: grid;
    grid-template-columns: 1fr 300px 1fr;
    gap: 30px;
    align-items: start;
}

.original-info,
.resize-controls,
.convert-controls,
.background-controls,
.preview-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.original-info h3,
.resize-controls h3,
.convert-controls h3,
.background-controls h3,
.preview-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* 画像情報 */
.image-info {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

/* プレビューキャンバス */
.preview-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* コントロール */
.control-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.control-group input[type="number"] {
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}

.control-group input[type="number"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-group select {
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-group select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 6px;
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
}

.control-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #cbd5e0;
    border-radius: 3px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#qualityValue {
    font-weight: 600;
    color: #667eea;
}

/* ダウンロードボタン */
.download-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

/* フッター */
.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .controls-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .resize-controls {
        order: 1;
    }
    
    .original-info {
        order: 2;
    }
    
    .preview-section {
        order: 3;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
    }
}

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

.controls-section {
    animation: fadeIn 0.5s ease-out;
}

/* ローディング状態 */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 背景除去機能専用スタイル */
.process-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.process-btn:active {
    transform: translateY(0);
}

.process-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.processing-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
    font-weight: 600;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ヘルプテキスト */
.help-text {
    background: #e6fffa;
    border: 1px solid #38b2ac;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #234e52;
    line-height: 1.5;
}

/* タブボタンのレスポンシブ対応改善 */
@media (max-width: 768px) {
    .tab-navigation {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 100px;
    }
} 
