/* ==========================================
   漫画プロンプトメーカー v5.6 ULTRA ENHANCED
   styles-enhanced-v2.css - 超強化UI用スタイル
   ========================================== */

/* ==========================================
   超強化設定コンテナ
   ========================================== */
.ultra-enhanced-settings {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 16px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.settings-header h3 {
    color: white;
    font-size: 24px;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header .help-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
}

/* ==========================================
   タブナビゲーション
   ========================================== */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin: 25px 0 20px 0;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   タブコンテンツ
   ========================================== */
.tab-content {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   設定セクション
   ========================================== */
.settings-section {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.settings-section::-webkit-scrollbar {
    width: 8px;
}

.settings-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.settings-section::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.settings-section::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.section-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

/* ==========================================
   設定グループ
   ========================================== */
.settings-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
}

.settings-group:last-child {
    border-bottom: none;
}

.settings-group h4 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================
   チェックボックスグリッド
   ========================================== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.checkbox-label span {
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

/* ==========================================
   ラジオグリッド
   ========================================== */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-label:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-label input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.radio-label span {
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

/* ==========================================
   キャラクター詳細セクション
   ========================================== */
.character-detail-section .form-group {
    margin-bottom: 20px;
}

.character-detail-section label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.character-detail-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.character-detail-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.character-detail-input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* ==========================================
   キャラクター参照画像プレビュー
   ========================================== */
.char-ref-preview {
    margin-top: 10px;
    min-height: 50px;
}

.char-ref-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.char-ref-preview img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   プレビューエリア
   ========================================== */
.settings-preview {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-preview h4 {
    color: #333;
    font-size: 18px;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-preview-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.prompt-preview-text::-webkit-scrollbar {
    width: 8px;
}

.prompt-preview-text::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.prompt-preview-text::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.prompt-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.prompt-section:last-child {
    border-bottom: none;
}

.prompt-section strong {
    color: #667eea;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.prompt-section em {
    color: #adb5bd;
    font-style: italic;
}

/* ==========================================
   プレビューアクション
   ========================================== */
.preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: white;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* ==========================================
   フォームグループ
   ========================================== */
.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

/* ==========================================
   レスポンシブ対応
   ========================================== */
@media (max-width: 768px) {
    .ultra-enhanced-settings {
        padding: 20px;
    }
    
    .settings-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
    }
    
    .checkbox-grid,
    .radio-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }
}

/* ==========================================
   印刷用スタイル
   ========================================== */
@media print {
    .ultra-enhanced-settings {
        page-break-inside: avoid;
        box-shadow: none;
    }
    
    .settings-tabs,
    .preview-actions {
        display: none;
    }
}

/* ==========================================
   アクセシビリティ
   ========================================== */
.tab-btn:focus,
.checkbox-label:focus-within,
.radio-label:focus-within,
.btn-secondary:focus,
.btn-danger:focus {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* ==========================================
   ローディング状態
   ========================================== */
.settings-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
    font-size: 16px;
}

.settings-loading::before {
    content: '⏳';
    font-size: 24px;
    margin-right: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   エラー表示
   ========================================== */
.settings-error {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.settings-error strong {
    display: block;
    margin-bottom: 5px;
}

/* ==========================================
   超強化設定サマリー
   ========================================== */
.ultra-settings-summary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    color: white;
}

.ultra-settings-summary h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
}

/* ==========================================
   超強化版ボタン
   ========================================== */
.btn-generate-ultra {
    flex: 1;
    min-width: 280px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 20px 35px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-generate-ultra::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-generate-ultra:hover::before {
    left: 100%;
}

.btn-generate-ultra:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(240, 147, 251, 0.6);
}

.btn-generate-ultra:active {
    transform: translateY(-2px);
}

.btn-generate-enhanced {
    flex: 1;
    min-width: 220px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate-enhanced:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-generate-standard {
    flex: 1;
    min-width: 200px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-generate-standard:hover {
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* ==========================================
   超強化版カット生成ボタン
   ========================================== */
.btn-primary-ultra {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.btn-primary-ultra:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.5);
}

.btn-reference-ultra {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-reference-ultra:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 112, 154, 0.5);
}

.btn-link {
    background: none;
    border: none;
    color: white;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 0;
    transition: opacity 0.2s ease;
}

.btn-link:hover {
    opacity: 0.8;
}

/* ==========================================
   モバイル対応
   ========================================== */
@media (max-width: 768px) {
    .ultra-settings-summary {
        padding: 15px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .generation-actions {
        flex-direction: column;
    }
    
    .btn-generate-ultra,
    .btn-generate-enhanced,
    .btn-generate-standard {
        width: 100%;
        min-width: auto;
    }
}
