/* ============================================
   Swipe LP Builder - Premium Dark Mode
   ============================================ */

:root {
    /* Colors - DarkMint Theme */
    --bg-body: #0c0c0e;
    --bg-card: #2a292f;
    --bg-card-hover: #353439;
    --bg-input: #232228;
    --bg-input-focus: #2d2c32;
    --bg-preview: #515056;

    --text-primary: #f0f0f5;
    --text-secondary: #9a999f;
    --text-placeholder: #6a696f;

    --accent-color: #0f89ff;
    --accent-hover: #3da1ff;
    --accent-glow: rgba(15, 137, 255, 0.3);

    --border-light: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-focus: #0f89ff;

    --danger: #ef4444;
    --success: #10b981;

    /* Gradient Accents */
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    --gradient-accent: linear-gradient(135deg, #0f89ff 0%, #3da1ff 100%);
    --gradient-header: linear-gradient(135deg, #2a292f 0%, #353439 100%);

    /* Spacing */
    --space-s: 8px;
    --space-m: 16px;
    --space-l: 24px;
    --space-xl: 40px;

    /* Radius */
    --radius-m: 12px;
    --radius-l: 18px;
    --radius-xl: 24px;

    /* Shadows - Dark Mode */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-floating: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --shadow-input: inset 0 1px 2px rgba(0, 0, 0, 0.2);

    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Icons (SVG) Settings */
.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Layout - 3 Columns (Fixed Width & Centered) */
.app-container {
    width: 1100px;
    margin: 0 auto;
    padding: 34px 40px 40px;
    /* 上部の余白を縮める */
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "header . ."
        "left center right"
        "footer footer footer";
    gap: 12px;
}

/* Page Load Animation */
@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-left {
    animation: slideInFromTop 0.3s ease-out forwards;
    opacity: 0;
}

.panel-center {
    animation: slideInFromTop 0.3s ease-out 0.05s forwards;
    opacity: 0;
}

.panel-right {
    animation: slideInFromTop 0.3s ease-out 0.1s forwards;
    opacity: 0;
}

/* Footer (Credit) */
.app-footer {
    grid-area: footer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 30px;
    padding: 20px 30px;
    background: var(--gradient-header);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

/* フッタースペーサー（左側のバランス用） */
.footer-spacer {
    flex: 1;
    max-width: 360px;
}

/* フッターバナーリンク */
.footer-banner-link {
    display: block;
    flex: 1;
    max-width: 360px;
    transition: transform 0.2s, opacity 0.2s;
}

.footer-banner-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.footer-banner {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--border-medium);
}

/* フッター中央 */
.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.credit-label {
    font-size: 8px;
    font-weight: 500;
    color: #888888;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.credit-link {
    display: block;
    transition: transform 0.2s;
}

.credit-link:hover {
    transform: translateY(-1px);
}

.credit-logo {
    height: 36px;
    width: auto;
    display: block;
}

/* Header (Logo row, centered in left column) */
.app-header {
    grid-area: header;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 0 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo h1 {
    display: flex;
    align-items: baseline;
    margin: 0;
}

.logo-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-sub {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.2;
    padding-top: 3px;
}

.logo-katakana {
    font-size: 10px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 0.1em;
}

.logo-version {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0;
    padding-top: 2px;
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--gradient-accent);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--accent-glow);
    white-space: nowrap;
    margin-top: 40px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Panels */
.panel-left {
    grid-area: left;
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
    overflow-y: auto;
    align-self: start;
}

.panel-right {
    grid-area: right;
    display: flex;
    flex-direction: column;
    align-self: start;
}

.panel-center {
    grid-area: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
}

/* Custom Scrollbar */
.panel-left::-webkit-scrollbar,
.slides-scroll-area::-webkit-scrollbar {
    width: 4px;
}

.panel-left::-webkit-scrollbar-track,
.slides-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.panel-left::-webkit-scrollbar-thumb,
.slides-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Textarea Scrollbar */
.input-group textarea::-webkit-scrollbar {
    width: 6px;
}

.input-group textarea::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.input-group textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.input-group textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Custom Resize Handle for Textarea */
.input-group textarea::-webkit-resizer {
    background:
        linear-gradient(135deg, transparent 60%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0.5) 65%, transparent 65%),
        linear-gradient(135deg, transparent 75%, rgba(255, 255, 255, 0.5) 75%, rgba(255, 255, 255, 0.5) 80%, transparent 80%);
    background-size: 8px 8px;
    background-position: bottom right;
    background-repeat: no-repeat;
}

/* Setting Section */
.setting-section {
    background: var(--bg-card);
    background-image: var(--gradient-card);
    border-radius: var(--radius-l);
    padding: var(--space-m);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: border-color 0.2s ease;
}

.setting-section:hover {
    border-color: var(--border-medium);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: var(--space-s);
    border-bottom: 1px solid var(--border-light);
    cursor: default;
}

.collapsible .section-header {
    cursor: pointer;
    user-select: none;
}

.collapsible .section-header:hover {
    opacity: 0.8;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 1;
}

.section-icon {
    color: #ffffff;
    width: 18px;
    height: 18px;
}

.chevron {
    width: 16px;
    height: 16px;
    color: var(--text-placeholder);
    transition: transform 0.2s ease;
}

.collapsible.collapsed .chevron {
    transform: rotate(-90deg);
}

.section-content {
    padding-top: var(--space-m);
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.collapsible.collapsed .section-content {
    max-height: 0;
    padding-top: 0;
    opacity: 0;
}

/* Swipe Direction Toggle */
.swipe-toggle-container {
    display: flex;
    gap: 14px;
    margin: 12px 0;
}

.swipe-toggle-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.2s ease;
}

.swipe-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
}

.swipe-toggle-btn.active {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Input Fields */
.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-m);
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.input-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.input-group select option:checked,
.input-group select option:hover {
    background: #0f89ff;
    color: #ffffff;
}

.input-group textarea {
    resize: vertical;
    min-height: 60px;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-placeholder);
}

.input-group input:hover,
.input-group select:hover,
.input-group textarea:hover {
    border-color: var(--border-medium);
    background-color: var(--bg-input-focus);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    background-color: var(--bg-input-focus);
    border: 1.5px solid var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Spacer Utility */
.spacer-top {
    margin-top: 12px;
}

.spacer-top-small {
    margin-top: 6px;
}

/* Sub-section Styles */
.sub-section {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-m);
    border: 1px solid var(--border-light);
}

.sub-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.sub-section-hint {
    font-size: 10px;
    color: var(--text-placeholder);
    margin-bottom: 10px;
}

/* Input Hint */
.input-hint {
    display: block;
    font-size: 10px;
    color: var(--text-placeholder);
    margin-top: 6px;
}

/* Advanced Options Toggle */
.advanced-options-toggle {
    margin-top: var(--space-m);
}

.advanced-options-toggle .toggle-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 4px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.advanced-options-toggle .toggle-header:hover {
    opacity: 0.7;
}

.advanced-options-toggle .chevron-small {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.advanced-options-toggle.collapsed .chevron-small {
    transform: rotate(0deg);
    /* Down arrow ∨ when collapsed */
}

.advanced-options-toggle:not(.collapsed) .chevron-small {
    transform: rotate(180deg);
    /* Up arrow ∧ when expanded */
}

.advanced-options-toggle .toggle-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.advanced-options-toggle.collapsed .toggle-content {
    max-height: 0;
    opacity: 0;
}

/* Hint Text */
.upload-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-m);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-input);
}

.upload-zone:hover {
    border-color: var(--accent-color);
    background: rgba(15, 137, 255, 0.1);
    /* アクセントカラー10%透過 */
}

.upload-zone.dragover {
    border-color: var(--accent-color);
    background: rgba(15, 137, 255, 0.15);
    /* アクセントカラー15%透過 */
    box-shadow: var(--shadow-glow);
}

.upload-icon-large {
    color: var(--accent-color);
    opacity: 0.9;
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 6px;
}

/* Slides Section - Fixed Height with Internal Scroll */
.slides-section {
    display: flex;
    flex-direction: column;
    height: 832px;
    /* CTA Buttonセクションと下部を揃える */
    padding-bottom: var(--space-s);
    overflow: hidden;
}

.slides-section .section-header {
    flex-shrink: 0;
}

.slides-section .upload-zone {
    flex-shrink: 0;
    margin-top: var(--space-m);
    padding: 12px;
}

.slide-count {
    font-size: 11px;
    color: var(--text-placeholder);
    font-weight: 500;
}

.slides-scroll-area {
    flex: 1;
    overflow-y: auto;
    margin-top: var(--space-m);
    min-height: 0;
}

/* Image List */
.image-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.image-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-input);
    border-radius: 8px;
    gap: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.image-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.image-item-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--bg-body);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.image-item-info {
    flex: 1;
    overflow: hidden;
}

.image-item-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-item-meta {
    font-size: 10px;
    color: var(--text-secondary);
}

.image-item-drag {
    cursor: grab;
    color: var(--text-placeholder);
    padding: 4px;
}

.image-item-delete {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-placeholder);
    padding: 4px;
    transition: color 0.2s;
}

.image-item-delete:hover {
    color: var(--danger);
}

/* CTA Preview Thumb */
.cta-preview-thumb {
    max-height: 50px;
    border-radius: 6px;
    margin-top: 10px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

/* Phone Frame (iPhone Style) */
.phone-frame {
    width: 300px;
    height: 620px;
    background: #000000;
    border-radius: 44px;
    padding: 12px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
}

.phone-notch {
    width: 100px;
    height: 26px;
    background: #000;
    border-radius: 0 0 14px 14px;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--bg-preview);
    border-radius: 34px;
    overflow: hidden;
    position: relative;
}

.phone-home-indicator {
    width: 120px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    backdrop-filter: blur(10px);
}

/* Swiper inside Preview */
.previewSwiper {
    width: 100%;
    height: 100%;
}

.previewSwiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
}

.previewSwiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Slide in Preview */
.previewSwiper .video-slide-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.previewSwiper .slide-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.previewSwiper .play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 5;
}

.previewSwiper .play-button {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* Thumbnail Container with Video Indicator */
.thumb-container {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.thumb-container .image-item-thumb {
    width: 100%;
    height: 100%;
}

.video-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    font-size: 6px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Media Type Badge */
.media-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 600;
}

.media-type-badge.video-audio {
    color: #ffffff;
}

.media-type-badge.video-muted {
    color: var(--text-secondary);
}

.media-type-badge svg {
    vertical-align: middle;
}

.empty-message {
    color: var(--text-placeholder);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* CTA Preview in Phone */
.cta-preview {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    z-index: 10;
    pointer-events: none;
}

.cta-preview-button {
    width: 100%;
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    background: #0f89ff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* CTA Animation Classes for Preview */
.cta-preview-button.anim-bounce {
    animation: ctaBounce 2s ease-in-out infinite;
}

.cta-preview-button.anim-jelly {
    animation: ctaJelly 2s ease-in-out infinite;
}

.cta-preview-button.anim-shine::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: ctaShine 2.5s ease-in-out infinite;
}

/* Footer Links Preview in Phone */
.footer-links-preview {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    padding: 6px 12px;
    background: transparent;
    text-align: center;
    font-size: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    z-index: 50;
}

.footer-links-preview a {
    color: #999999;
    text-decoration: none;
}

.footer-links-preview .footer-separator {
    color: #cccccc;
    margin: 0 6px;
}

/* PR Label Preview in Phone */
.pr-label-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 3px;
    z-index: 15;
}

.pr-label-preview.pr-left {
    right: auto;
    left: 8px;
}

/* Swiper Pagination - Match production LP style */
.swiper-pagination-bullet {
    width: 4px !important;
    height: 4px !important;
    background: #ddd;
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: #aaa;
    opacity: 1;
}

/* Preview pagination position - 1px lower */
.previewSwiper .swiper-pagination {
    margin-bottom: -3px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: auto;
    top: 894px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-floating);
    border: 1px solid var(--border-medium);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--accent-color);
    /* 水色に変更 */
}

.toast.error {
    border-color: var(--danger);
}

/* ============================================
   CTA Customization Styles
   ============================================ */

/* Color Picker Container */
.color-picker-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.color-picker-group input[type="color"] {
    width: 56px;
    height: 42px;
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-m);
    background: var(--bg-input);
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-picker-group input[type="color"]:hover {
    border-color: var(--border-medium);
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border-radius: 6px;
    border: none;
}

.color-picker-group input[type="text"] {
    flex: 1;
}

/* CTA Preview Button in Editor */
.cta-text-preview {
    width: calc(100% - 16px);
    /* 左右に8pxずつ余裕を持たせてアニメーション時の見切れを防止 */
    margin-left: 8px;
    padding: 14px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* CTA Animation Preview Classes */
.cta-text-preview.anim-bounce {
    animation: ctaBounce 2s ease-in-out infinite;
}

.cta-text-preview.anim-jelly {
    animation: ctaJelly 2s ease-in-out infinite;
}

.cta-text-preview.anim-shine::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: ctaShine 2.5s ease-in-out infinite;
}

@keyframes ctaBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes ctaJelly {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.05, 0.95);
    }

    50% {
        transform: scale(0.95, 1.05);
    }

    75% {
        transform: scale(1.02, 0.98);
    }
}

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

    50%,
    100% {
        left: 100%;
    }
}

/* Animation Select Styling */
.animation-select-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.animation-option {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--text-secondary);
}

.animation-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
}

.animation-option.active {
    background: var(--bg-card-hover);
    border-color: var(--accent-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Head Script Add Button */
.add-script-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-script-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(15, 137, 255, 0.05);
}

/* Head Script Item with Delete */
.head-script-item {
    position: relative;
}

.head-script-item .delete-script-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    color: var(--text-placeholder);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.head-script-item:hover .delete-script-btn {
    opacity: 1;
}

.head-script-item .delete-script-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Responsive - For smaller screens fallback */
@media (max-width: 1120px) {
    .app-container {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 240px 1fr 240px;
        gap: 20px;
        padding: 20px;
    }

    .phone-frame {
        width: 260px;
        height: 540px;
    }
}

@media (max-width: 900px) {
    .app-container {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .app-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .panel-center {
        order: -1;
        margin-bottom: 30px;
    }

    .panel-left,
    .panel-right {
        max-height: none;
        height: auto;
    }
}

/* ============================================
   DOCUMENTATION SECTION
   ============================================ */

.documentation-content {
    max-width: 720px;
    margin: -16px auto 0;
    padding: 0 20px 40px;
}

/* Documentation Indicator (like scroll indicator) */
.doc-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.1em;
    animation: docBounce 2s infinite;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-bottom: 50px;
}

.doc-indicator:hover {
    color: var(--text-primary);
}

.doc-indicator:hover svg {
    stroke: var(--text-primary);
}

.doc-indicator svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    transition: transform 0.3s ease;
}

.documentation-content.collapsed .doc-indicator svg {
    transform: rotate(0deg);
}

.documentation-content:not(.collapsed) .doc-indicator svg {
    transform: rotate(0deg);
}

@keyframes docBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(8px);
    }

    60% {
        transform: translateY(4px);
    }
}

/* Documentation Sections Container */
.doc-sections {
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 5000px;
    overflow: hidden;
}

.documentation-content.collapsed .doc-sections {
    max-height: 0;
    opacity: 0;
}

/* Section Cards */
.documentation-content .section-card {
    background: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 28px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.documentation-content .section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.documentation-content .section-icon {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
}

.documentation-content .section-title {
    font-size: 14px;
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 0.02em;
}

/* LINE Section */
.documentation-content .line-section {
    background: transparent;
    border: none;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.documentation-content .line-section .section-header {
    border-bottom: none;
    justify-content: center !important;
    width: 100%;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.documentation-content .line-section .section-icon {
    stroke: #06c755;
}

.documentation-content .line-section .section-title {
    color: #b0b0b0;
    font-size: 18px;
    flex: none;
}

.line-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.qr-link {
    flex-shrink: 0;
}

.qr-code {
    width: 160px;
    height: 160px;
    border-radius: 12px;
}

.line-description {
    max-width: 480px;
    text-align: left;
}

.line-description p {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.7;
}

.line-description strong {
    color: #06c755;
}

.line-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #06c755;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.line-btn:hover {
    background: #05b34c;
    transform: translateY(-2px);
}

/* Requirements */
.requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-m);
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.check-icon {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
    stroke-width: 2.5;
    fill: none;
}

.hint-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Steps */
.step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.step-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.step-content ul {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 20px;
    margin-top: 8px;
}

.step-content li {
    margin-bottom: 4px;
}

/* File List */
.file-list {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 20px;
    margin: 12px 0;
}

.file-list li {
    margin-bottom: 6px;
}

.file-list code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* FAQ */
.faq-item {
    margin-bottom: 20px;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-q {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.faq-a {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 16px;
    border-left: 2px solid var(--border-medium);
}

/* Collapsible */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-header .section-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    flex: 1;
}

.chevron {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.collapsed .chevron {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding-top: 20px;
}

.collapsed .collapsible-content {
    max-height: 0;
    padding-top: 0;
}

/* Disclaimer List */
.disclaimer-intro {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.disclaimer-list {
    list-style: none;
    padding: 0;
}

.disclaimer-list li {
    margin-bottom: 20px;
    padding-left: 0;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.disclaimer-list p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 400;
    margin-top: 6px;
}

/* Prohibited List */
.prohibited-list {
    list-style: none;
    padding: 0;
}

.prohibited-list li {
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.prohibited-list p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 4px;
}

.legal-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Document Footer */
.doc-footer {
    text-align: center;
    padding: 0 20px 20px;
    margin-top: 50px;
    font-size: 12px;
    font-weight: 300;
    color: var(--text-secondary);
}

/* Responsive for Documentation */
@media (max-width: 600px) {
    .requirements {
        grid-template-columns: 1fr;
    }
}