/* EPUB変換ツール - カスタムスタイル */

/* ドロップゾーンのアニメーション */
#dropZone {
    transition: all 0.3s ease;
    cursor: pointer;
}

#dropZone:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#dropZone.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* フォームコントロールの統一スタイル */
.form-radio {
    color: #3b82f6;
}

.form-checkbox {
    color: #3b82f6;
}

/* プレビューエリアのスタイル */
#previewContent {
    font-family: 'Noto Serif JP', serif;
    line-height: 1.8;
    color: #374151;
}

#previewContent h1,
#previewContent h2,
#previewContent h3 {
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

#previewContent h1 {
    font-size: 1.5rem;
    font-weight: bold;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

#previewContent h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

#previewContent h3 {
    font-size: 1.125rem;
    font-weight: 500;
}

#previewContent p {
    margin-bottom: 1rem;
    text-indent: 1rem;
}

#previewContent .chapter-break {
    page-break-before: always;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed #d1d5db;
}

/* ステータスメッセージのアニメーション */
#statusMessage {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ローディングアニメーション */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    #dropZone {
        padding: 2rem 1rem;
    }
    
    .flex-col.sm\\:flex-row {
        flex-direction: column;
    }
}

/* カスタムスクロールバー */
#previewContent::-webkit-scrollbar {
    width: 8px;
}

#previewContent::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#previewContent::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#previewContent::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* フォーカス状態の改善 */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ボタンのホバーエフェクト */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

/* エラーメッセージ用のスタイル */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin: 0.5rem 0;
}

.success-message {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #059669;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin: 0.5rem 0;
}

/* プログレスバー */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
}

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

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #374151;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* アコーディオン効果 */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.expanded {
    max-height: 500px;
}

/* EPUB固有のスタイル */
.epub-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* 縦書きスタイル */
.vertical-writing {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    direction: rtl;
}

.vertical-writing .chapter-title {
    text-align: center;
    writing-mode: horizontal-tb;
    direction: ltr;
    margin: 0 0 2rem 0;
}

.vertical-writing .chapter-content {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    direction: rtl;
}

.vertical-writing p {
    text-indent: 1em;
    margin: 0 1em 0 0;
}

/* 縦書き用の句読点調整 */
.vertical-writing .rotated-punct {
    text-orientation: upright;
}

/* 横書き用のスタイル（デフォルト） */
.horizontal-writing {
    writing-mode: horizontal-tb;
    direction: ltr;
}

.horizontal-writing .chapter-title {
    text-align: center;
    margin: 2rem 0 1.5rem 0;
}

.horizontal-writing p {
    text-indent: 1em;
    margin: 0 0 1rem 0;
}

.epub-chapter {
    margin-bottom: 3rem;
}

.epub-chapter-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    text-align: center;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.epub-paragraph {
    margin-bottom: 1rem;
    text-indent: 1rem;
    line-height: 1.8;
}

.blank-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-style: italic;
}