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

/* CSS変数 - ライトモード */
:root {
    --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-container: #ffffff;
    --bg-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-section: #f8f9fa;
    --bg-input: #fafafa;
    --bg-input-focus: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --text-header: #ffffff;
    --border-color: #e0e0e0;
    --accent-color: #667eea;
    --accent-hover: #5568d3;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    --code-bg: #f6f8fa;
    --code-text: #e74c3c;
    --pre-bg: #2d2d2d;
    --pre-text: #f8f8f2;
}

/* CSS変数 - ダークモード */
[data-theme="dark"] {
    --bg-body: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-container: #1e1e1e;
    --bg-header: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
    --bg-section: #2d2d2d;
    --bg-input: #2a2a2a;
    --bg-input-focus: #333333;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-light: #808080;
    --text-header: #ffffff;
    --border-color: #404040;
    --accent-color: #8b9cf6;
    --accent-hover: #a0aef8;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --code-bg: #3a3a3a;
    --code-text: #ff6b6b;
    --pre-bg: #1a1a1a;
    --pre-text: #f8f8f2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* コンテナ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-container);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: background 0.3s ease;
}

/* ヘッダー */
header {
    background: var(--bg-header);
    color: var(--text-header);
    padding: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    text-align: left;
}

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

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

.header-controls {
    display: flex;
    gap: 10px;
}

.icon-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.icon-button svg {
    color: white;
}

/* ツールバー */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-section);
    border-bottom: 2px solid var(--border-color);
    transition: background 0.3s ease;
}

.toolbar-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-container);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toolbar-button:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.toolbar-button svg {
    width: 16px;
    height: 16px;
}

.last-saved-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* メインコンテンツ */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 500px;
}

/* セクション共通 */
.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.input-section {
    border-right: 2px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: var(--bg-section);
    border-bottom: 2px solid var(--border-color);
    transition: background 0.3s ease;
}

.section-header h2 {
    font-size: 1.3rem;
    color: var(--accent-color);
    font-weight: 600;
}

/* 文字数カウンター */
.stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.stat-item span {
    color: var(--accent-color);
    font-weight: 700;
}

/* Markdownツールバー */
.markdown-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: var(--bg-section);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    transition: background 0.3s ease;
}

.markdown-toolbar::-webkit-scrollbar {
    height: 6px;
}

.markdown-toolbar::-webkit-scrollbar-track {
    background: transparent;
}

.markdown-toolbar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.markdown-toolbar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.md-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 6px 8px;
    background: var(--bg-container);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.md-tool-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.md-tool-btn:active {
    transform: scale(0.95);
}

.md-tool-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.md-tool-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.md-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
}

/* 入力エリア */
#input-text {
    flex: 1;
    width: 100%;
    padding: 25px;
    border: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    line-height: 1.8;
    resize: none;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

#input-text:focus {
    background: var(--bg-input-focus);
}

/* プレビューエリア */
.preview-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: var(--bg-container);
    transition: background 0.3s ease;
}

.placeholder {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    margin-top: 50px;
}

.error {
    color: var(--error-color);
    text-align: center;
    margin-top: 50px;
}

/* コピーボタン */
.copy-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.copy-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.copy-button:active {
    transform: translateY(0);
}

.copy-button svg {
    width: 18px;
    height: 18px;
}

/* 情報セクション */
.info-section {
    padding: 25px 30px;
    background: var(--bg-section);
    border-top: 2px solid var(--border-color);
    transition: background 0.3s ease;
}

.info-section h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: var(--text-secondary);
}

.info-section li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* マークダウンプレビューのスタイル */
.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}

.preview-content h1 {
    font-size: 2em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.preview-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.preview-content h3 {
    font-size: 1.25em;
}

.preview-content p {
    margin-bottom: 16px;
}

.preview-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.preview-content a:hover {
    text-decoration: underline;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 16px;
    padding-left: 2em;
}

.preview-content li {
    margin-bottom: 8px;
}

.preview-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: var(--code-text);
}

.preview-content pre {
    background: var(--pre-bg);
    color: var(--pre-text);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.preview-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.preview-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.preview-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

.preview-content table th,
.preview-content table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.preview-content table th {
    background: var(--bg-section);
    font-weight: 600;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.preview-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 24px 0;
}

.preview-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.preview-content em {
    font-style: italic;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

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

.notification.error {
    background: var(--error-color);
}

/* スクロールバーのスタイル - ダークモード対応 */
.preview-content::-webkit-scrollbar,
#input-text::-webkit-scrollbar {
    width: 10px;
}

.preview-content::-webkit-scrollbar-track,
#input-text::-webkit-scrollbar-track {
    background: var(--bg-section);
}

.preview-content::-webkit-scrollbar-thumb,
#input-text::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-section);
}

.preview-content::-webkit-scrollbar-thumb:hover,
#input-text::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* フォーカススタイル - アクセシビリティ */
button:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* ローディングインジケーター */
.loading-indicator {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-indicator.active {
    display: inline-block;
}

/* ツールチップ */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--text-primary);
    color: var(--bg-container);
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ボタンのリップル効果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* グラスモーフィズム効果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.container {
    animation: fadeIn 0.6s ease-out;
}

/* ボタンのホバー効果強化 */
.toolbar-button,
.copy-button,
.icon-button {
    position: relative;
    overflow: hidden;
}

.toolbar-button::before,
.copy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.toolbar-button:hover::before,
.copy-button:hover::before {
    left: 100%;
}

/* モバイル用タブ切り替え */
.mobile-tabs {
    display: none;
    background: var(--bg-section);
    border-bottom: 2px solid var(--border-color);
}

.mobile-tabs button {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.mobile-tabs button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* 保存状態インジケーター */
.save-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.save-status.saved {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
}

.save-status.saving {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.save-status.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
}

/* 空の状態のプレースホルダー改善 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state-description {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
}

/* ドラッグ&ドロップエリア */
.drag-over {
    border: 3px dashed var(--accent-color) !important;
    background: rgba(102, 126, 234, 0.05) !important;
}

/* スクロールインジケーター */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color);
    transition: width 0.3s ease;
    z-index: 9999;
}

/* カードスタイルの改善 */
.card {
    background: var(--bg-container);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* レスポンシブデザイン - タブレット */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }

    .input-section,
    .output-section {
        height: 400px;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* レスポンシブデザイン - モバイル */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
    }

    header {
        padding: 20px;
        border-radius: 0;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

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

    header h1 {
        font-size: 1.75rem;
    }

    header p {
        font-size: 0.95rem;
    }

    /* モバイル用タブ切り替えを表示 */
    .mobile-tabs {
        display: flex;
    }

    /* デフォルトでプレビューを非表示 */
    .input-section,
    .output-section {
        height: calc(100vh - 380px);
        min-height: 400px;
    }

    .output-section {
        display: none;
    }

    .output-section.active {
        display: flex;
    }

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

    .toolbar {
        padding: 12px 15px;
    }

    .toolbar-button {
        font-size: 13px;
        padding: 6px 12px;
    }

    .toolbar-button svg {
        width: 14px;
        height: 14px;
    }

    .section-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stats {
        width: 100%;
        justify-content: space-between;
    }

    .stat-item {
        font-size: 12px;
    }

    #input-text,
    .preview-content {
        padding: 15px;
        font-size: 14px;
    }

    .info-section {
        padding: 20px;
    }

    .info-section h3 {
        font-size: 1.1rem;
    }

    .info-section li {
        font-size: 14px;
    }

    /* ボタンをタッチフレンドリーに */
    .copy-button,
    .toolbar-button,
    .icon-button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* レスポンシブデザイン - 小型モバイル */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .toolbar-section {
        flex-wrap: wrap;
    }

    .last-saved-text {
        width: 100%;
        text-align: center;
        margin-top: 5px;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .stat-item {
        font-size: 11px;
    }

    .notification {
        left: 10px;
        right: 10px;
        top: 10px;
        transform: translateY(-20px);
    }

    .notification.show {
        transform: translateY(0);
    }
}

/* ランドスケープモード対応 */
@media (max-width: 968px) and (orientation: landscape) {
    .input-section,
    .output-section {
        height: calc(100vh - 250px);
    }
}

/* ダークモード時のコントラスト改善 */
@media (prefers-contrast: high) {
    [data-theme="dark"] {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #666666;
    }
}

/* モーション削減設定への対応 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 印刷スタイル */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    header,
    .toolbar,
    .section-header,
    .info-section,
    .input-section,
    .notification {
        display: none !important;
    }

    .main-content {
        display: block;
    }

    .output-section {
        display: block !important;
        height: auto;
    }

    .preview-content {
        padding: 0;
        color: black;
    }
}

/* フォーカスインジケーターの強化 */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* セレクション色のカスタマイズ */
::selection {
    background-color: var(--accent-color);
    color: white;
}

::-moz-selection {
    background-color: var(--accent-color);
    color: white;
}

/* スムーズスクロール */
html {
    scroll-behavior: smooth;
}

/* テキストエリアのリサイズハンドル非表示 */
#input-text {
    resize: none;
}

/* より洗練されたシャドウ効果 */
.container {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .container {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ボタンのアクティブ状態の改善 */
.toolbar-button:active,
.copy-button:active,
.icon-button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* セクションヘッダーの微妙なグラデーション */
.section-header {
    background: linear-gradient(to bottom, var(--bg-section), var(--bg-container));
}

/* ツールバーにサブタイトなボーダー追加 */
.toolbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* プレビューコンテンツに余白を追加してより読みやすく */
.preview-content > *:first-child {
    margin-top: 0;
}

.preview-content > *:last-child {
    margin-bottom: 0;
}

/* テーマ切り替えアイコンのスムーズなトランジション */
.sun-icon,
.moon-icon {
    transition: all 0.3s ease;
}

/* 統計情報のアニメーション */
.stat-item span {
    transition: all 0.3s ease;
}

.stat-item:hover span {
    transform: scale(1.1);
    display: inline-block;
}

/* 情報セクションのリスト項目にホバー効果 */
.info-section li {
    transition: all 0.2s ease;
}

.info-section li:hover {
    padding-left: 30px;
    color: var(--text-primary);
}

/* コピーボタンの成功アニメーション準備 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.copy-button.success {
    animation: pulse 0.3s ease;
}

/* モバイルタブのアクティブ状態の強調 */
.mobile-tabs button.active {
    background: linear-gradient(to bottom, transparent, rgba(102, 126, 234, 0.1));
}

/* インプットエリアのフォーカス時の境界線 */
#input-text:focus {
    box-shadow: inset 0 0 0 2px var(--accent-color);
    transition: box-shadow 0.3s ease;
}

/* ダークモードでの読みやすさ向上 */
[data-theme="dark"] .preview-content {
    color: #e0e0e0;
    line-height: 1.8;
}

/* 通知のスライドインアニメーション改善 */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.show {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ローディング状態のアニメーション */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(
        90deg,
        var(--bg-section) 0%,
        var(--bg-input) 50%,
        var(--bg-section) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* より洗練された境界線 */
.section-header,
.toolbar,
.input-section {
    border-color: var(--border-color);
    border-style: solid;
}

/* トランジションのグローバル設定 */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ヘッダーのテキストシャドウで立体感 */
header h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* プレビューのコードブロックのスクロールバー */
.preview-content pre::-webkit-scrollbar {
    height: 8px;
}

.preview-content pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.preview-content pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.preview-content pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
