:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --success-color: #00875A;
    --success-hover: #006644;
    --secondary-color: #6B778C;
    --danger-color: #DE350B;
    --background: #F4F5F7;
    --surface: #FFFFFF;
    --text-primary: #172B4D;
    --text-secondary: #5E6C84;
    --border-color: #DFE1E6;
    --shadow-sm: 0 1px 2px rgba(23, 43, 77, 0.08);
    --shadow-md: 0 4px 8px rgba(23, 43, 77, 0.12);
    --shadow-lg: 0 8px 16px rgba(23, 43, 77, 0.15);
    --radius: 3px;
    --radius-lg: 6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--surface);
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.icon {
    font-size: 32px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.language-selector {
    position: absolute;
    top: 24px;
    right: 20px;
}

#languageSelect {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

#languageSelect:hover {
    border-color: var(--primary-color);
}

.main-content {
    padding: 32px 0;
}

.input-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.file-list {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.2s;
}

.file-list:focus {
    outline: none;
    border-color: var(--primary-color);
}

.file-drop-zone {
    margin-top: 16px;
    padding: 32px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 82, 204, 0.05);
    color: var(--primary-color);
}

.transform-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.transform-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.transform-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

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

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-panel {
    display: none;
}

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

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

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

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary,
.btn-success,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

.btn-success:hover {
    background: var(--success-hover);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.preview-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.preview-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.preview-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.preview-column {
    flex: 1;
}

.preview-column h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-arrow {
    font-size: 24px;
    color: var(--text-secondary);
    padding-top: 30px;
}

.file-preview-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px;
}

.file-preview-list li {
    padding: 8px 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    border-bottom: 1px solid var(--background);
}

.file-preview-list li:last-child {
    border-bottom: none;
}

.file-preview-list li.changed {
    background: rgba(0, 135, 90, 0.1);
    color: var(--success-color);
    font-weight: 500;
}

.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .language-selector {
        position: static;
        margin-top: 16px;
    }
    
    .transform-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .preview-container {
        flex-direction: column;
    }
    
    .preview-arrow {
        transform: rotate(90deg);
        padding: 16px 0;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-success,
    .btn-secondary {
        width: 100%;
    }
}

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

.preview-section {
    animation: fadeIn 0.3s ease;
}

/* スクロールバーのスタイリング */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* フォーカス時のアクセシビリティ */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* プリント時のスタイル */
@media print {
    body {
        background: white;
    }
    
    .header,
    .footer,
    .action-buttons,
    .language-selector {
        display: none;
    }
    
    .preview-section {
        box-shadow: none;
        border: 1px solid #000;
    }
}