/* 小説生成中・完成画面のスタイル */

/* === 生成中画面 === */
.generation-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generation-bg {
    opacity: 1 !important;
    animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.generation-content {
    text-align: center;
    color: white;
    z-index: 2;
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
}

.generation-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 255, 255, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { 
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 255, 255, 0.3);
    }
    to { 
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 255, 255, 0.5);
    }
}

/* プログレスバー */
.progress-container {
    margin: 2rem 0;
}

.progress-bar-wrapper {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    background: linear-gradient(90deg, #ff6b6b, #ee5a24, #ffad5a);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.progress-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-top: 1rem;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* メッセージフロー */
.message-flow-content {
    margin: 3rem 0;
    min-height: 300px;
    position: relative;
    width: 100%;
    max-width: 600px;
    overflow: hidden;
}

/* メッセージバブル（旧UIスタイルを復活） */
.message-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-size: 14px;
    max-width: 200px;
    word-wrap: break-word;
    opacity: 0;
    animation: bubbleAppear 0.5s ease-forward forwards;
    backdrop-filter: blur(5px);
    z-index: 2;
}

@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* SVGスタイル */
.message-flow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.message-flow-svg path {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    opacity: 0.8;
}

/* 旧UIスタイルの線の描画アニメーション */
.message-flow-svg path.message-flow-path {
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.8;
    }
}

/* 詳細表示（非表示） */
.generation-details {
    display: none;
}

.process-details {
    display: none;
}

/* キャンセルボタン */
.cancel-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.cancel-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* === 完成画面 === */
.completion-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.completion-bg {
    opacity: 0.3 !important;
}

.completion-content {
    text-align: center;
    color: white;
    z-index: 2;
    max-width: 700px;
    width: 90%;
    margin: 0 auto;
}

.completion-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ffd700, #ffad5a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.8)); }
}

/* プロンプト→タイトル変化演出 */
.transformation-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.prompt-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.arrow {
    font-size: 1.5rem;
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

.title-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* 小説情報 */
.novel-info {
    margin: 2rem 0;
}

.stats {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 50px;
    display: inline-block;
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
}

.primary-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.3);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* 公開設定パネル */
.publish-panel {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.publish-options {
    margin-bottom: 1.5rem;
}

.publish-option {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    cursor: pointer;
    font-size: 1rem;
}

.publish-option input[type="checkbox"] {
    margin-right: 0.8rem;
    transform: scale(1.2);
}

.publish-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.publish-btn, .cancel-publish-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.publish-btn {
    background: linear-gradient(135deg, #00d4ff, #5b73db);
    color: white;
}

.publish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

.cancel-publish-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cancel-publish-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

/* ホームボタン */
.home-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-top: 2rem;
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-2px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .generation-title, .completion-title {
        font-size: 2rem;
    }
    
    .transformation-animation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn, .secondary-btn {
        min-width: 250px;
    }
    
    .cancel-btn {
        top: 1rem;
        right: 1rem;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* アニメーション定義 */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ダークテーマでの可読性向上 */
@media (prefers-color-scheme: dark) {
    .generation-screen, .completion-screen {
        background: #000;
    }
}