/* バナー生成プラグイン スタイル - 管理画面版準拠 */
.sbg-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
}

.sbg-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 30px;
}

.sbg-header h2 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.sbg-header p {
    opacity: 0.9;
    font-size: 1.1rem;
    margin: 0;
}

.sbg-main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.sbg-left-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sbg-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e2e8f0;
}

.sbg-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.sbg-preview-section .description {
    margin-bottom: 15px;
    color: #718096;
}

.sbg-preview-container {
    width: 600px;
    height: 400px;
    background: #2d3748;
    border-radius: 10px;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.sbg-banner-element {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    background: rgba(74, 85, 104, 0.9);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: move;
    user-select: none;
    transition: all 0.3s ease;
}

.sbg-banner-element:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.sbg-banner-element.sbg-cta {
    background: #ed8936;
    border-radius: 20px;
    border: none;
}

.sbg-banner-element.sbg-image {
    background: #4299e1;
}

/* 初期位置設定 - 管理画面版と同じ */
#sbg-main-copy { left: 150px; top: 100px; width: 300px; height: 50px; }
#sbg-sub-copy { left: 150px; top: 170px; width: 300px; height: 40px; }
#sbg-date { left: 150px; top: 240px; width: 200px; height: 35px; }
#sbg-cta { left: 225px; top: 300px; width: 150px; height: 40px; }
#sbg-logo { left: 240px; top: 40px; width: 120px; height: 30px; }
#sbg-image { left: 450px; top: 50px; width: 100px; height: 100px; }

/* レイアウト選択セクション */
.sbg-layout-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e2e8f0;
}

.sbg-layout-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.sbg-layout-option {
    cursor: pointer;
    border: 3px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s ease;
    background: white;
}

.sbg-layout-option:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.sbg-layout-option.selected {
    border-color: #4299e1;
    background: #ebf8ff;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.sbg-layout-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* レイアウト詳細と完成イメージを横並びに */
.sbg-layout-preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sbg-layout-detail {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.sbg-layout-detail h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.sbg-layout-detail-image {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e2e8f0;
}

.sbg-layout-detail-image img {
    width: 100%;
    height: auto;
    max-width: 300px;
}

.sbg-banner-example {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.sbg-banner-example h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.sbg-banner-example-image {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e2e8f0;
}

.sbg-banner-example-image img {
    width: 100%;
    height: auto;
    max-width: 400px;
}

/* カラー設定とテイスト設定の2カラムレイアウト */
.sbg-color-style-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e2e8f0;
}

.sbg-color-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.sbg-color-section {
    border-radius: 10px;
    padding: 0;
}

.sbg-style-section {
    border-radius: 10px;
    padding: 0;
}

/* カラーモード選択 */
.sbg-color-mode-selection {
    margin-bottom: 20px;
}

.sbg-color-mode-option {
    margin-bottom: 10px;
}

.sbg-color-mode-option label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
}

.sbg-color-mode-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* カラープリセット（シンプル版） */
.sbg-color-preset-section {
    margin-bottom: 20px;
}

.sbg-color-presets {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.sbg-color-preset-simple {
    width: 60px;
    height: 50px;
    cursor: pointer;
    border: 3px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sbg-color-preset-simple:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
}

.sbg-color-preset-simple.selected {
    border-color: #4299e1;
    border-width: 4px;
}

/* カスタムカラー */
.sbg-custom-color-section {
    margin-bottom: 20px;
}

.sbg-color-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.sbg-color-group label {
    font-weight: 600;
    color: #4a5568;
    min-width: 100px;
}

.sbg-color-group input[type="color"] {
    width: 80px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* テイスト設定のスタイル */
.sbg-style-checkboxes {
    margin-top: 15px;
}

.sbg-style-checkboxes .sbg-checkbox-group {
    margin-bottom: 10px;
}

/* 画像説明のチェックボックス */
.sbg-image-checkboxes {
    margin-top: 15px;
}

.sbg-image-checkboxes .sbg-checkbox-group {
    margin-bottom: 10px;
}

/* タブ機能のスタイル */
.sbg-tab-container {
    margin-top: 20px;
}

.sbg-tab-buttons {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.sbg-tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: #f8fafc;
    color: #4a5568;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border-right: 1px solid #e2e8f0;
}

.sbg-tab-button:last-child {
    border-right: none;
}

.sbg-tab-button:hover {
    background: #e2e8f0;
}

.sbg-tab-button.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.sbg-tab-content {
    display: none;
}

.sbg-tab-content.active {
    display: block;
}

.sbg-tab-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.sbg-template-input-section h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.sbg-right-panel {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e2e8f0;
}

.sbg-right-panel h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.sbg-form-group {
    margin-bottom: 25px;
}

.sbg-form-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1rem;
}

/* ラベルの文字の開始位置のズレ修正 */
.sbg-checkbox-group label {
    display: flex;
    align-items: flex-start;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.4;
}

.sbg-checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    transform: scale(1.2);
    flex-shrink: 0;
}

.sbg-form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.sbg-form-group input[type="text"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.sbg-form-group textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.sbg-form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.sbg-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* テキスト選択を正常化 */
.sbg-form-group input[type="text"],
.sbg-form-group textarea,
.sbg-example-text {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* プロンプト出力エリアのみ特別扱い */
#prompt-output {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.sbg-example-text {
    color: #718096;
    font-size: 14px;
    margin: 5px 0;
    font-style: italic;
}

.sbg-aspect-selector {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.sbg-aspect-button {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.sbg-aspect-button:hover {
    border-color: #4299e1;
    background: #ebf8ff;
}

.sbg-aspect-button.selected {
    border-color: #4299e1;
    background: #4299e1;
    color: white;
}

.sbg-action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.sbg-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sbg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.sbg-btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.sbg-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.sbg-btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.sbg-prompt-section textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 15px;
}

.sbg-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.sbg-message.success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.sbg-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

/* レスポンシブ */
@media (max-width: 1200px) {
    .sbg-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sbg-color-style-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .sbg-preview-container {
        width: 100%;
        max-width: 500px;
        height: 300px;
    }
    
    .sbg-header h2 {
        font-size: 2rem;
    }
    
    .sbg-layout-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sbg-tab-buttons {
        flex-direction: column;
    }
    
    .sbg-tab-button {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .sbg-tab-button:last-child {
        border-bottom: none;
    }
    
    #sbg-main-copy {
        width: 80%;
        left: 10%;
    }
    
    #sbg-sub-copy {
        width: 75%;
        left: 12.5%;
    }
    
    #sbg-date {
        width: 60%;
        left: 20%;
    }
    
    #sbg-cta {
        width: 40%;
        left: 30%;
    }
    
    #sbg-logo {
        width: 50%;
        left: 25%;
    }
    
    #sbg-image {
        width: 30%;
        left: 35%;
    }
    
    .sbg-aspect-selector {
        flex-direction: column;
        gap: 8px;
    }
    
    .sbg-action-buttons {
        justify-content: center;
        flex-direction: column;
    }
    
    .sbg-color-presets {
        justify-content: center;
    }
}

/* エラー用ボタンスタイルを追加 */
.sbg-btn-error {
    background: linear-gradient(135deg, #e53e3e 0%, #fc8181 100%);
    color: white;
}

/* ボタンのトランジション効果を改善 */
.sbg-btn {
    transition: all 0.3s ease, background 0.5s ease;
}

