/* ========================================
   キャラ差分プロンプトメーカー - style.css
   フェーズ3: 全機能対応 スタイル定義
   ======================================== */

/* --- Glassmorphism コンポーネント --- */
.glass-box {
    background: rgba(4, 47, 46, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(13, 148, 136, 0.3) !important;
}
html:not(.dark) .glass-box {
    background: rgba(240, 253, 250, 0.88) !important;
    border: 1px solid rgba(13, 148, 136, 0.2) !important;
}

/* --- カード型ボタン --- */
.btn-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(4, 47, 46, 0.4);
    color: #99f6e4;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.3;
    text-align: center;
    min-height: 64px;
}
html:not(.dark) .btn-card {
    background: rgba(204, 251, 241, 0.6);
    color: #115e59;
    border-color: rgba(13, 148, 136, 0.15);
}
.btn-card:hover {
    background: rgba(13, 148, 136, 0.3);
    border-color: rgba(13, 148, 136, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}
.btn-card.selected {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    color: #fde68a;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3), 0 4px 12px rgba(251, 191, 36, 0.1);
}
html:not(.dark) .btn-card.selected {
    border-color: #d97706;
    background: rgba(251, 191, 36, 0.15);
    color: #92400e;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25);
}
.btn-card:disabled, .btn-card.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}
.btn-card .card-emoji {
    font-size: 1.5rem;
    line-height: 1;
    display: block;
}
.btn-card .card-label {
    display: block;
    font-size: 0.68rem;
    line-height: 1.3;
}
/* 大きめカード（STEP1用） */
.btn-card-lg { min-height: 80px; padding: 14px 10px; }
.btn-card-lg .card-emoji { font-size: 1.8rem; }
.btn-card-lg .card-label { font-size: 0.75rem; }

/* --- キャラクタースロットボタン --- */
.slot-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 6px;
    border-radius: 12px;
    border: 2px solid rgba(13, 148, 136, 0.25);
    background: rgba(4, 47, 46, 0.4);
    color: #99f6e4;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 72px;
    text-align: center;
}
html:not(.dark) .slot-btn {
    background: rgba(204, 251, 241, 0.5);
    color: #115e59;
    border-color: rgba(13, 148, 136, 0.2);
}
.slot-btn:hover { border-color: rgba(13, 148, 136, 0.6); }
.slot-btn.active {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
}
html:not(.dark) .slot-btn.active {
    border-color: #d97706;
    color: #92400e;
    background: rgba(251, 191, 36, 0.1);
}
.slot-btn.empty {
    border-style: dashed;
    opacity: 0.65;
}
.slot-name {
    font-weight: 700;
    font-size: 0.7rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.slot-feature-preview {
    font-size: 0.58rem;
    opacity: 0.65;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.slot-actions {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    width: 100%;
}
.slot-actions button {
    flex: 1;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
}
.btn-slot-save { background: rgba(13,148,136,0.4); color: #a7f3d0; }
.btn-slot-save:hover { background: rgba(13,148,136,0.7); }
.btn-slot-load { background: rgba(251,191,36,0.25); color: #fde68a; }
.btn-slot-load:hover { background: rgba(251,191,36,0.5); }
.btn-slot-clear { background: rgba(239,68,68,0.2); color: #fca5a5; }
.btn-slot-clear:hover { background: rgba(239,68,68,0.4); }

/* --- トグルスイッチ --- */
.toggle-track {
    position: relative;
    width: 48px;
    height: 26px;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.25);
    border: 2px solid rgba(13, 148, 136, 0.3);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.toggle-track.on {
    background: rgba(251, 191, 36, 0.35);
    border-color: #fbbf24;
}
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6ee7b7;
    transition: transform 0.2s ease, background 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle-track.on .toggle-thumb {
    transform: translateX(22px);
    background: #fbbf24;
}

/* --- フォームインプット --- */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(13, 148, 136, 0.3);
    background: rgba(4, 47, 46, 0.5);
    color: #e2fff9;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
html:not(.dark) .form-input {
    background: rgba(255, 255, 255, 0.75);
    color: #134e4a;
    border-color: rgba(13, 148, 136, 0.25);
}
.form-input:focus {
    border-color: rgba(13, 148, 136, 0.7);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.form-input::placeholder { color: rgba(153, 246, 228, 0.4); }
html:not(.dark) .form-input::placeholder { color: rgba(20, 184, 166, 0.5); }

/* --- ねこまるフローティング --- */
.nekomaru-float {
    animation: nekofloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
@keyframes nekofloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

/* --- Toastノーティフィケーション --- */
.toast-item {
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 0.85rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    animation: toastIn 0.3s ease forwards;
    max-width: 420px;
    text-align: center;
}
.toast-success { background: linear-gradient(135deg, #0d9488, #059669); color: white; }
.toast-error   { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; }
.toast-info    { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: white; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0)   scale(1);   }
}

/* --- 生成履歴アイテム --- */
.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(13, 148, 136, 0.2);
    background: rgba(4, 47, 46, 0.35);
    cursor: pointer;
    transition: all 0.15s ease;
}
html:not(.dark) .history-item {
    background: rgba(204, 251, 241, 0.4);
    border-color: rgba(13, 148, 136, 0.2);
}
.history-item:hover {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.08);
}
.history-label {
    flex: 1;
    font-size: 0.72rem;
    color: #a7f3d0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html:not(.dark) .history-label { color: #115e59; }
.history-date {
    font-size: 0.62rem;
    color: rgba(153, 246, 228, 0.55);
    white-space: nowrap;
    flex-shrink: 0;
}
.history-restore {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(13,148,136,0.3);
    color: #a7f3d0;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.history-restore:hover { background: rgba(13,148,136,0.6); }
.history-delete {
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.history-delete:hover { background: rgba(239,68,68,0.35); }

/* --- カスタムスクロールバー --- */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(13, 148, 136, 0.4);
    border-radius: 999px;
}

/* --- プレビューボックス --- */
#preview-box { transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
#preview-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    opacity: 0.6;
    white-space: nowrap;
}

/* --- 出力テキストエリア --- */
#prompt-output {
    min-height: 240px;
    resize: vertical;
    font-size: 0.77rem;
    line-height: 1.75;
    font-family: 'Courier New', 'Noto Sans JP', monospace;
}

/* --- STEPバッジ --- */
.step-badge {
    position: absolute;
    top: -16px;
    left: -16px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
    z-index: 10;
}

/* --- セクション見出し --- */
.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-left: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(13, 148, 136, 0.2);
    margin-bottom: 14px;
}

/* --- バッチモード警告ゾーン --- */
#batch-zone {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.07);
    margin-bottom: 14px;
}
#batch-info {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 0.78rem;
    color: #6ee7b7;
}
html:not(.dark) #batch-info { color: #065f46; background: rgba(167,243,208,0.3); }

/* --- アラート案内 --- */
.alert-notice {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fde68a;
    font-size: 0.8rem;
}
html:not(.dark) .alert-notice {
    background: rgba(254, 243, 199, 0.7);
    border-color: rgba(217, 119, 6, 0.25);
    color: #92400e;
}

/* --- アコーディオン details > summary --- */
details.advanced-accordion > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fbbf24;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.2);
    transition: background 0.15s;
    user-select: none;
}
html:not(.dark) details.advanced-accordion > summary { color: #b45309; background: rgba(254,243,199,0.5); }
details.advanced-accordion > summary:hover { background: rgba(251, 191, 36, 0.12); }
details.advanced-accordion > summary::-webkit-details-marker { display: none; }
.accordion-arrow {
    transition: transform 0.25s ease;
    font-style: normal;
}
details.advanced-accordion[open] .accordion-arrow { transform: rotate(90deg); }

/* --- データ管理モーダル --- */
#data-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 50;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
#data-modal.open { display: flex; }

/* --- テーマトグルボタン --- */
#theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s;
}
#theme-toggle:hover { transform: scale(1.1); }

/* --- スロットリネーム編集インライン --- */
.slot-rename-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(251,191,36,0.5);
    color: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    outline: none;
    padding: 0;
}
