/* 全体のスタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #e1e4e8;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

header p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* メインコンテンツ */
.converter {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 992px) {
    .converter {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .input-section, .output-section {
        flex: 1;
        min-width: 45%;
    }
    
    .controls {
        flex-basis: 100%;
        order: 3;
        display: flex;
        justify-content: center;
        margin: 20px 0;
    }
}

.input-section, .output-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

textarea {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

#output-text {
    background-color: #f8f9fa;
}

/* TinyMCEエディターのスタイル調整 */
.tox-tinymce {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

.tox .tox-edit-area__iframe {
    background-color: white !important;
}

.tox .tox-toolbar {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #e1e4e8 !important;
}

.tox .tox-menubar {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #e1e4e8 !important;
}

/* 入力セクション内のTinyMCEコンテナ */
.input-section .tox-tinymce {
    margin-top: 10px;
}

/* モード切り替えボタン */
.editor-mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.mode-btn {
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    background-color: #d5dbdb;
}

.mode-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

.mode-btn.active:hover {
    background-color: #2980b9;
}

/* コードエディター */
.code-editor {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background-color: #2c3e50;
    color: #ecf0f1;
    border: 1px solid #34495e;
}

.code-editor:focus {
    outline: none;
    border-color: #3498db;
}

/* コントロール */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#copy-btn {
    background-color: #2ecc71 !important;
    color: white !important;
}

#copy-btn:hover {
    background-color: #27ae60 !important;
    color: white !important;
}

#copy-btn:active,
#copy-btn:focus {
    background-color: #2ecc71 !important;
    color: white !important;
}

.output-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

/* ローディングスピナー */
.spinner {
    display: none;
    text-align: center;
}

.spinner > div {
    width: 12px;
    height: 12px;
    background-color: #3498db;
    border-radius: 100%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.spinner .bounce1 {
    animation-delay: -0.32s;
}

.spinner .bounce2 {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1.0);
    }
}

/* フッター */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e1e4e8;
    color: #7f8c8d;
} 