/* カスタムオブジェクトコピーツール - スタイルシート */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* プログレスバー */
.progress-bar {
    display: flex;
    justify-content: space-between;
    padding: 30px 40px;
    background: #f1f5f9;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 60px;
    right: 60px;
    height: 3px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-label {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* ステップコンテンツ */
.step-content {
    padding: 40px;
}

.step-content h2 {
    font-size: 1.75rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.info-box {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.info-box p {
    color: #1e40af;
    line-height: 1.6;
}

.warning-box {
    background: #fffbeb;
    border: 2px solid var(--warning-color);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.warning-box h3 {
    color: #b45309;
    margin-bottom: 10px;
}

.warning-box p {
    color: #92400e;
    margin-bottom: 15px;
}

/* フォーム要素 */
.form-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex: 1;
}

.form-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.form-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.arrow-icon {
    display: flex;
    align-items: center;
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.required {
    color: var(--danger-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Monaco', 'Courier New', monospace;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[readonly] {
    background: #e2e8f0;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ラジオボタングループ */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: var(--primary-color);
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    margin-top: 3px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: var(--primary-color);
}

.radio-label {
    flex: 1;
}

.radio-label strong {
    display: block;
    margin-bottom: 5px;
}

.radio-label small {
    color: var(--text-secondary);
}

/* コピーサマリー */
.copy-summary {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.copy-summary h3 {
    color: #065f46;
    margin-bottom: 15px;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.summary-item .count {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.summary-item .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* タブ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

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

.tab-content th,
.tab-content td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tab-content th {
    background: #e2e8f0;
    font-weight: 600;
}

.tab-content tr:hover {
    background: #e2e8f0;
}

/* 実行プログレス */
.execution-progress {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.progress-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.progress-item:last-child {
    border-bottom: none;
}

.progress-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.progress-text {
    font-size: 0.95rem;
}

.progress-item.running .progress-icon::after {
    content: '🔄';
}

.progress-item.completed .progress-icon::after {
    content: '✅';
}

.progress-item.error .progress-icon::after {
    content: '❌';
}

.progress-item.skipped .progress-icon::after {
    content: '⏭️';
}

/* ボタングループ */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
    font-size: 1.1rem;
    padding: 14px 40px;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0891b2;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ステータスボックス */
.status-box {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.status-box.success {
    background: #f0fdf4;
    border-color: var(--success-color);
}

.status-box.error {
    background: #fef2f2;
    border-color: var(--danger-color);
}

.status-box.warning {
    background: #fffbeb;
    border-color: var(--warning-color);
}

.status-box h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* スピナー */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ログ出力 */
.log-container {
    margin-top: 30px;
}

.log-container h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.log-output {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
}

.log-output .log-success {
    color: #86efac;
}

.log-output .log-error {
    color: #fca5a5;
}

.log-output .log-warning {
    color: #fcd34d;
}

.log-output .log-info {
    color: #7dd3fc;
}

.log-output .log-step {
    color: #c4b5fd;
    font-weight: bold;
    display: block;
    margin: 15px 0 10px 0;
    border-bottom: 1px solid #334155;
    padding-bottom: 5px;
}

/* 結果サマリー */
.result-summary {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.result-summary h3 {
    margin-bottom: 15px;
}

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

.result-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.result-item.success {
    border-color: var(--success-color);
}

.result-item.error {
    border-color: var(--danger-color);
}

.result-item .count {
    font-size: 1.5rem;
    font-weight: bold;
}

.result-item.success .count {
    color: var(--success-color);
}

.result-item.error .count {
    color: var(--danger-color);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }

    .progress-bar {
        padding: 20px;
    }

    .progress-bar::before {
        left: 30px;
        right: 30px;
    }

    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-content {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .arrow-icon {
        transform: rotate(90deg);
        justify-content: center;
        padding: 10px 0;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        min-width: 80px;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* バッジ */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-new {
    background: #dbeafe;
    color: #1e40af;
}

.badge-update {
    background: #fef3c7;
    color: #92400e;
}

.badge-delete {
    background: #fee2e2;
    color: #991b1b;
}

.badge-skip {
    background: #e2e8f0;
    color: #475569;
}

/* モード選択カード */
.mode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mode-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-card:hover {
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
    transform: translateY(-2px);
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.mode-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.mode-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.mode-card ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.mode-card ul li {
    padding: 5px 0;
    color: #555;
}

.mode-card .btn {
    margin-top: 15px;
}

/* アップロードエリア */
.upload-area {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.upload-area.drag-over {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.upload-area p {
    margin: 10px 0;
    color: #666;
}

.file-info {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.file-info h3 {
    margin-top: 0;
    color: #1976D2;
}

.file-info p {
    margin: 5px 0;
    color: #555;
}

/* APIデバッグ情報 */
.debug-container {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.debug-container h3 {
    color: #92400e;
    margin-bottom: 10px;
}

.debug-description {
    color: #78350f;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.debug-output {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.5;
}

.debug-entry {
    margin-bottom: 20px;
    padding: 15px;
    background: #334155;
    border-radius: 6px;
    border-left: 4px solid #10b981;
}

.debug-entry.debug-error {
    border-left-color: #ef4444;
}

.debug-entry.debug-success {
    border-left-color: #10b981;
}

.debug-header {
    color: #fbbf24;
    margin-bottom: 10px;
}

.debug-url {
    margin-bottom: 10px;
}

.debug-url code {
    background: #1e293b;
    padding: 4px 8px;
    border-radius: 4px;
    color: #7dd3fc;
    word-break: break-all;
}

.debug-response {
    margin-bottom: 10px;
}

.debug-response pre {
    background: #1e293b;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #86efac;
    font-size: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.debug-error-msg {
    color: #fca5a5;
    background: #450a0a;
    padding: 8px;
    border-radius: 4px;
}
