/* リセットとベース */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: #f7f8f9;
    color: #172b4d;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ヘッダー */
.header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #0052cc 0%, #2684ff 100%);
    color: white;
    margin: 0 -20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* 言語セレクター */
.language-selector {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: white;
    color: #0052cc;
    font-weight: 600;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    padding: 40px 0;
}

/* タブ */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: white;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #5e6c84;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    background: #f4f5f7;
}

.tab-btn.active {
    color: #0052cc;
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #0052cc;
}

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

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

/* 入力セクション */
.input-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.format-selector {
    margin-bottom: 25px;
}

.format-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #172b4d;
}

.format-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dfe1e6;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.format-select:focus {
    outline: none;
    border-color: #2684ff;
}

/* 入力グループ */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #172b4d;
}

.input-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #dfe1e6;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

.input-textarea:focus {
    outline: none;
    border-color: #2684ff;
}

/* オプショングループ */
.options-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ボタン */
.primary-btn {
    background: #0052cc;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: #0747a6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.3);
}

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

.secondary-btn {
    background: white;
    color: #42526e;
    border: 2px solid #dfe1e6;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f4f5f7;
    border-color: #c1c7d0;
}

/* 結果セクション */
.result-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-section.hidden {
    display: none;
}

.result-section h3 {
    margin-bottom: 20px;
    color: #172b4d;
    font-size: 1.3rem;
}

/* ツールバー */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* コードブロック */
.code-block {
    background: #f4f5f7;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #dfe1e6;
}

/* メッセージ */
.success-message {
    color: #00875a;
    padding: 16px;
    background: #e3fcef;
    border: 1px solid #abf5d1;
    border-radius: 4px;
    font-weight: 500;
}

.error-message {
    color: #de350b;
    padding: 16px;
    background: #ffebe6;
    border: 1px solid #ff8f73;
    border-radius: 4px;
}

.error-list {
    margin-top: 10px;
    margin-left: 20px;
}

.error-list li {
    margin-bottom: 5px;
    font-size: 14px;
}

/* フッター */
.footer {
    text-align: center;
    padding: 30px 0;
    color: #6b778c;
    font-size: 14px;
    border-top: 1px solid #dfe1e6;
    margin-top: auto;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-section,
    .result-section {
        padding: 20px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #dfe1e6;
    }
    
    .tab-btn:last-child {
        border-bottom: none;
    }
    
    .tab-btn.active::after {
        height: 100%;
        width: 3px;
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
    }
    
    .options-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .secondary-btn {
        width: 100%;
    }
}

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

.result-section:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

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

.code-block::-webkit-scrollbar-track {
    background: #e3e8ef;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb {
    background: #c1c7d0;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: #a5adba;
}