/* ストーリー生成ツールページ（フィグマ 5853-182824 準拠） */

.story-generator-tool-page {
    display: flex;
    justify-content: center;
    background: var(--color-soft-white);
    min-height: 100%;
    padding: 30px 0 0 0;
    border-radius: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.sgtp-shell {
    width: 1200px;
}

.sgtp-content-inner {
    width: 100%;
    padding: 60px 0 80px;
    display: flex;
    justify-content: center;
}

.sgtp-stack {
    width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 90px;
}

/* ヒーローセクション */
.sgtp-hero {
    width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.sgtp-title-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 90px;
}

.sgtp-title-holder {
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sgtp-title {
    margin: 0;
    font-family: var(--font-base);
    font-weight: 800;
    font-size: 22px;
    background: var(--color-grad-pink-purple);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sgtp-panel {
    width: 100%;
    border-radius: 14px;
    background: var(--color-soft-white);
    padding: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 8px var(--color-pink-purple-mid);

    position: relative;
    z-index: 1;
}

.sgtp-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow:
        0 0 16px var(--color-pink-purple-mid),
        8px 0 14px -12px var(--color-pink-purple-mid),
        -8px 0 14px -12px var(--color-pink-purple-mid);
    opacity: 0.24;
    animation: sgtpGlowPulse 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    will-change: opacity;
}

@keyframes sgtpGlowPulse {
    0%, 100% {
        opacity: 0.22;
    }
    50% {
        opacity: 0.48;
    }
}

.sgtp-panel:focus-within {
    box-shadow: 0 0 10px var(--color-pink-purple-mid);
}

.sgtp-panel:focus-within::before {
    animation: none;
    opacity: 0.38;
}

@media (prefers-reduced-motion: reduce) {
    .sgtp-panel::before {
        animation: none;
        opacity: 0.34;
    }
}


.sgtp-textarea {
    --mb: 4px;
    height: calc(140px - var(--mb));
    margin-bottom: var(--mb);
    resize: none;
    border: none;
    width: 100%;
    padding: 4px 6px;
    font-family: var(--font-base);
    font-size: 12px;
    line-height: 1.8;
    color: var(--color-soft-black);
    background: var(--color-soft-white);
    outline: none;
}

.sgtp-textarea::placeholder {
    color: var(--color-gray-500);
    white-space: pre-line;
}

.sgtp-prompt-history {
    display: flex;
    justify-content: flex-start;
    padding: 0 0 6px 4px;
}

.sgtp-prompt-history-btn {
    padding: 2px;
    border-radius: 6px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.sgtp-prompt-history-btn:hover,
.sgtp-prompt-history-btn.active {
    background: var(--color-gray-100);
}

.sgtp-prompt-history-menu {
    position: absolute;
    top: 0;
    left: calc(100% + 6px);
    width: 650px;
    max-height: 236px;
    background: var(--color-soft-white);
	border-radius: 8px;
	box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 20;
    cursor: default;
}

.sgtp-prompt-history-menu.hidden {
    display: none;
}

.sgtp-prompt-history-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
}

.sgtp-prompt-history-title {
    font-family: var(--font-base);
    font-weight: 600;
    font-size: 9px;
    line-height: 1.1;
    text-align: left;
    color: var(--color-gray-600);
    margin: 0;
    padding: 6px 6px 4px 6px;
}

.sgtp-prompt-history-list {
    max-height: 220px;
    padding: 2px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: auto;
}

.sgtp-prompt-history-item {
    padding: 4px 6px;
    margin: 0;
    border-radius: 4px;
    font-family: var(--font-base);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    color: var(--color-soft-black);
    background: transparent;
    cursor: pointer;
}

.sgtp-prompt-history-item:hover {
    background: var(--color-gray-100);
}

.sgtp-settings {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-top: 1px solid var(--color-gray-100);
    padding-top: 10px;
}

.sgtp-options {
    display: flex;
    gap: 12px;
}

.sgtp-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sgtp-option:hover {
    background: var(--color-gray-100);
}

.sgtp-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.sgtp-option-label {
    font-family: var(--font-base);
    font-weight: 500;
    font-size: 12px;
    color: var(--color-soft-black);
    line-height: 1.1;
}

.sgtp-card-folder-icon {
    width: 16px;
    height: 16px;
    display: flex;
}

.sgtp-generate {
    display: flex;
    align-items: center;
}

.sgtp-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 20px 6px 18px;
    height: 36px;
    border-radius: 25px;
    border: none;
    background: var(--color-grad-pink-purple);
    color: var(--color-soft-white);
    font-family: var(--font-base);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sgtp-generate-btn:hover {
    background: var(--color-grad-pink-purple-hover);
}

@keyframes sgtp-wand-magic {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(1.15); }
    50% { transform: rotate(8deg) scale(1.2); }
    75% { transform: rotate(-5deg) scale(1.1); }
    100% { transform: rotate(0deg) scale(1); }
}

.sgtp-generate-btn:hover .sgtp-generate-icon-wrap {
    animation: sgtp-wand-magic 0.8s ease-in-out infinite;
}

.sgtp-generate-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    transform-origin: 40% 60%;
}

.sgtp-generate-label {
    line-height: 1.5;
}

/* タブバー（sgtp-options） */
.sgtp-options {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sgtp-option {
    background: transparent;
    border-radius: 4px;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sgtp-option:hover {
    background: var(--color-gray-100);
}

.sgtp-option.active {
    background: var(--color-gray-100);
}


/* mp-badge */
.mp-badge {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 2px 4px 2px 5px;
	/* background: var(--color-soft-white);
	border: 1px solid var(--color-pink-purple-mid); */
    border-radius: 4px;
    border: 1px solid transparent;
    background: linear-gradient(var(--color-soft-white), var(--color-soft-white)) padding-box, var(--color-soft-white) border-box;
    background-clip: padding-box, border-box;
}

.mp-badge svg {
	width: 12px;
	height: 12px;
}

.mp-badge span {
	font-family: var(--font-base);
	font-weight: 500;
	font-size: 11px;
	line-height: 1.1;
	background: var(--color-grad-pink-purple);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
    background-clip: text;
}

.line-generate-mp-badge {
    background: linear-gradient(var(--color-soft-white), var(--color-soft-white)) padding-box, var(--color-grad-pink-purple) border-box;
}

/* ストーリー生成ローディングフィルター（画面全体を覆う） */
.sgtp-loading-filter {
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.4);
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding-left: var(--sidebar-width);
}

/* サイドバーが閉じている時はpaddingを狭く */
.sgtp-loading-filter.sidebar-collapsed {
    padding-left: var(--sidebar-width-collapsed);
}

.sgtp-loading-filter-icon {
    width: 330px;
}

.sgtp-loading-filter-text {
    margin-top: -18px;
    margin-bottom: 44px;
    text-align: center;
    color: var(--color-soft-white);
    font-family: var(--font-base);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.6;
}
