/* メインスタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f7f8fa;
    min-height: 100vh;
    color: #1f2937;
    overflow: hidden;
}

/* 2ペインレイアウト */
.two-pane-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* 左ペイン - メインコンテンツ */
.main-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    min-width: 0;
    gap: 10px;
}

/* ページタブ（横並び） */
.page-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 15px;
    background: #ffffff;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

.page-tabs .btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 20px;
    width: auto;
}

.page-tabs .btn:hover {
    transform: translateY(-2px);
}

/* 右ペイン - サイドメニュー */
.side-pane {
    width: 280px;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-header {
    padding: 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.side-header h2 {
    font-size: 1.05rem;
    color: #0f172a;
}

.side-section {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.side-section h3 {
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ページリスト（未使用） */
.page-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* エフェクトリスト */
.effect-list {
    overflow-y: auto;
    padding-right: 3px;
}

.effect-list::-webkit-scrollbar {
    width: 4px;
}

.effect-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.effect-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* ボタンスタイル */
.btn {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px) translateX(2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

.btn:active {
    transform: translateY(0) translateX(1px) scale(0.98);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
    border-color: #7dd3fc;
}

.btn.active {
    background: #e0f2fe;
    border-color: #7dd3fc;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.btn.effect-btn {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    padding: 6px 8px;
    font-size: 0.65rem;
    text-align: center;
}

.btn.effect-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px) scale(1.02);
}

.btn.effect-btn.active {
    background: #e0f2fe;
    color: #0f172a;
}

.btn.effect-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

/* iframeコンテナ */
.iframe-container {
    position: relative;
    width: 100%;
    flex: 1;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.iframe-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ステータスバー */
.status {
    margin-top: 15px;
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.status span {
    color: #0284c7;
    font-weight: bold;
}

/* エフェクトグループ */
.effect-group-header {
    width: 100%;
    padding: 6px 10px;
    margin-top: 6px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.effect-group-header[data-group="basic"] {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.effect-group-header[data-group="3d"] {
    color: #5b21b6;
    border-color: #ddd6fe;
    background: #f5f3ff;
}

.effect-group-header[data-group="rotate"] {
    color: #be185d;
    border-color: #fbcfe8;
    background: #fdf2f8;
}

.effect-group-header[data-group="physics"] {
    color: #c2410c;
    border-color: #fed7aa;
    background: #fff7ed;
}

.effect-group-header[data-group="mask"] {
    color: #047857;
    border-color: #bbf7d0;
    background: #ecfdf5;
}

.effect-group-header[data-group="filter"] {
    color: #0e7490;
    border-color: #a5f3fc;
    background: #ecfeff;
}

.effect-group-header[data-group="special"] {
    color: #be123c;
    border-color: #fecdd3;
    background: #fff1f2;
}

.effect-group-header[data-group="collapse"] {
    color: #374151;
    border-color: #e5e7eb;
    background: #f9fafb;
}

.effect-group-header[data-group="iforcom"] {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}

.effect-group-header[data-group="sprite"] {
    color: #7c3aed;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.effect-group-header:hover {
    opacity: 0.9;
}

.effect-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 5px 0;
}

/* グループ別ホバーアクセント */
.effect-group[data-group="basic"] .btn.effect-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
    transform: translateY(-1px) scale(1.03);
}

.effect-group[data-group="3d"] .btn.effect-btn:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
    color: #5b21b6;
    transform: translateY(-1px) scale(1.03) rotateX(4deg);
}

.effect-group[data-group="rotate"] .btn.effect-btn:hover {
    border-color: #f9a8d4;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
    color: #be185d;
    transform: translateY(-1px) scale(1.03) rotate(1.5deg);
}

.effect-group[data-group="physics"] .btn.effect-btn:hover {
    border-color: #fdba74;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
    color: #c2410c;
    transform: translateY(-1px) scale(1.02);
    animation: btn-bounce 0.35s ease;
}

.effect-group[data-group="mask"] .btn.effect-btn:hover {
    border-color: #6ee7b7;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    color: #047857;
    transform: translateY(-1px) scale(1.02);
    filter: saturate(1.1);
}

.effect-group[data-group="filter"] .btn.effect-btn:hover {
    border-color: #67e8f9;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
    color: #0e7490;
    transform: translateY(-1px) scale(1.02);
    filter: brightness(1.02);
}

.effect-group[data-group="special"] .btn.effect-btn:hover {
    border-color: #fda4af;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
    color: #be123c;
    transform: translateY(-1px) scale(1.03);
    animation: btn-pulse 0.35s ease;
}

.effect-group[data-group="collapse"] .btn.effect-btn:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
    color: #374151;
    transform: translateY(-1px) scale(1.01) skewX(-1deg);
}

.effect-group[data-group="iforcom"] .btn.effect-btn:hover {
    border-color: #fcd34d;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    color: #b45309;
    transform: translateY(-1px) scale(1.03);
    animation: btn-glow 0.4s ease;
}

.effect-group[data-group="sprite"] .btn.effect-btn:hover {
    border-color: #a78bfa;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    color: #7c3aed;
    transform: translateY(-1px) scale(1.03);
}

@keyframes btn-bounce {
    0% { transform: translateY(-1px) scale(1.02); }
    50% { transform: translateY(1px) scale(0.99); }
    100% { transform: translateY(-1px) scale(1.02); }
}

@keyframes btn-pulse {
    0% { transform: translateY(-1px) scale(1.02); }
    50% { transform: translateY(-1px) scale(1.05); }
    100% { transform: translateY(-1px) scale(1.02); }
}

@keyframes btn-glow {
    0% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35); }
    100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
}

/* 3Dエフェクト用 */
.flip-container {
    perspective: 1500px;
}
