/**
 * フロントエンド CSS
 * assets/css/frontend.css
 */

/* ============================================
   基本レイアウト
   ============================================ */
.psc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "游ゴシック", YuGothic, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

.psc-container * {
    box-sizing: border-box;
}

/* ============================================
   プログレスバー
   ============================================ */
.psc-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    padding: 0 20px;
}

.psc-progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #e0e0e0;
    z-index: -1;
}

.psc-progress-step {
    text-align: center;
    position: relative;
    flex: 1;
    cursor: pointer;
}

.psc-progress-step .step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #999;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.psc-progress-step.active .step-number {
    background: #2196F3;
    color: white;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.psc-progress-step.completed .step-number {
    background: #4CAF50;
    color: white;
}

.psc-progress-step.completed .step-number::after {
    content: '✓';
    position: absolute;
    font-size: 20px;
}

.psc-progress-step .step-label {
    display: block;
    font-size: 14px;
    color: #666;
    transition: color 0.3s ease;
}

.psc-progress-step.active .step-label,
.psc-progress-step.completed .step-label {
    color: #333;
    font-weight: 600;
}

/* ============================================
   フォーム要素
   ============================================ */
.psc-form-group {
    margin-bottom: 25px;
}

.psc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.psc-input,
.psc-select,
.psc-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.psc-input:focus,
.psc-select:focus,
.psc-textarea:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.psc-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.6;
}

.psc-ai-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .psc-ai-selector {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ファイルアップロード
   ============================================ */
.psc-file-upload-area {
    margin-top: 10px;
}

.psc-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.psc-dropzone:hover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.psc-dropzone.dragging {
    border-color: #2196F3;
    background: #e3f2fd;
    transform: scale(1.02);
}

.psc-dropzone .upload-icon {
    color: #999;
    margin-bottom: 10px;
}

.psc-dropzone p {
    margin: 10px 0;
    color: #666;
}

.psc-dropzone .file-types {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.psc-file-list {
    margin-top: 20px;
}

.psc-file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.psc-file-item.uploading {
    background: #fff3cd;
    border-color: #ffc107;
}

.psc-file-item.completed {
    background: #d4edda;
    border-color: #28a745;
}

.psc-file-item.error {
    background: #f8d7da;
    border-color: #dc3545;
}

.psc-file-item .dashicons {
    margin-right: 10px;
    font-size: 20px;
}

.psc-file-item .file-name {
    flex: 1;
    margin-right: 10px;
}

.psc-file-item .delete-file-btn {
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.psc-spinner-small {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* ============================================
   特許入力
   ============================================ */
.psc-patent-input {
    display: flex;
    gap: 10px;
}

.psc-patent-input .psc-input {
    flex: 1;
}

.psc-reference-patents-list,
.psc-patent-pdf-list {
    margin-top: 15px;
}

.patent-item,
.patent-pdf-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.patent-item .patent-number {
    flex: 1;
    font-weight: 500;
}

.remove-patent-btn,
.remove-pdf-btn {
    padding: 4px 8px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.remove-patent-btn:hover,
.remove-pdf-btn:hover {
    background: #5a6268;
}

/* ============================================
   ボタン
   ============================================ */
.psc-btn-primary,
.psc-btn-secondary,
.psc-btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.psc-btn-primary {
    background: #2196F3;
    color: white;
}

.psc-btn-primary:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.psc-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.psc-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.psc-btn-secondary:hover {
    background: #e0e0e0;
}

.psc-btn-success {
    background: #4CAF50;
    color: white;
}

.psc-btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.psc-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* ============================================
   検索結果
   ============================================ */
.psc-search-status,
.psc-generation-status {
    text-align: center;
    padding: 40px 20px;
}

.psc-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2196F3;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.psc-spinner-large {
    width: 80px;
    height: 80px;
    border-width: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.psc-search-results {
    margin-top: 20px;
}

.psc-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.psc-results-header h3 {
    margin: 0;
    font-size: 20px;
}

.psc-results-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   テーブル
   ============================================ */
.psc-patents-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.psc-patents-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.psc-patents-table th,
.psc-patents-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.psc-patents-table th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.psc-patents-table tr:hover {
    background: #f8f9fa;
}

.psc-patents-table .patent-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.view-patent-detail {
    padding: 6px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.view-patent-detail:hover {
    background: #1976D2;
}

.psc-selected-count {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
    font-weight: 600;
}

/* ============================================
   タブ
   ============================================ */
.psc-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.psc-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    color: #666;
    transition: all 0.3s ease;
}

.psc-tab:hover {
    color: #333;
    background: #f8f9fa;
}

.psc-tab.active {
    color: #2196F3;
    background: white;
}

.psc-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2196F3;
}

.psc-tab-content {
    background: white;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.psc-tab-pane {
    display: none;
}

.psc-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   ドキュメントビューア
   ============================================ */
.psc-document-viewer {
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    line-height: 1.8;
}

.psc-document-viewer h3 {
    color: #2196F3;
    margin: 20px 0 10px;
    font-size: 18px;
}

.psc-document-viewer h4 {
    color: #333;
    margin: 15px 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.psc-document-viewer p {
    margin: 10px 0;
}

/* 特許テキスト表示 */
.patent-text {
    font-family: "Yu Mincho", "游明朝", "HG明朝E", serif;
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.patent-heading {
    font-weight: bold;
    color: #1a5276;
    display: block;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-size: 15px;
}

/* ============================================
   プログレスバー（生成時）
   ============================================ */
.psc-progress-detail {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #4CAF50);
    transition: width 0.5s ease;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: #666;
}

/* ============================================
   ダウンロードアクション
   ============================================ */
.psc-download-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    justify-content: center;
}

.psc-download-actions button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.psc-download-actions svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   修正インターフェース
   ============================================ */
.psc-revision-interface {
    margin-top: 20px;
}

.psc-current-version {
    margin-bottom: 30px;
}

.psc-current-version h3 {
    margin-bottom: 15px;
    color: #333;
}

.psc-modification-input {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.psc-modification-input h3 {
    margin-bottom: 15px;
    color: #333;
}

.psc-modification-options {
    margin: 15px 0;
}

.psc-modification-options label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}

.psc-modification-options input[type="checkbox"] {
    margin-right: 8px;
}

/* ============================================
   修正履歴
   ============================================ */
.psc-revision-history {
    margin-top: 30px;
}

.psc-history-list {
    margin-top: 15px;
}

.revision-item {
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.revision-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.revision-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.revision-number {
    font-weight: 600;
    color: #2196F3;
}

.revision-date {
    color: #666;
    font-size: 14px;
}

.revision-request {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.load-revision-btn {
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.load-revision-btn:hover {
    background: #1976D2;
}

/* ============================================
   モーダル
   ============================================ */
.psc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.psc-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.psc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.psc-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.psc-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.psc-modal-close:hover {
    color: #333;
}

.psc-modal-body {
    padding: 20px;
    max-height: calc(80vh - 70px);
    overflow-y: auto;
}

.patent-meta {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.patent-meta p {
    margin: 5px 0;
}

.patent-abstract,
.patent-claims {
    margin-top: 20px;
}

.patent-abstract h5,
.patent-claims h5 {
    margin-bottom: 10px;
    color: #2196F3;
}

/* ============================================
   ローディングオーバーレイ
   ============================================ */
.psc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================
   通知（インライン表示版）
   ============================================ */
.psc-inline-notification {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: notificationFadeIn 0.3s ease;
}

@keyframes notificationFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.psc-inline-notification .notification-icon {
    font-size: 24px;
    font-weight: bold;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.psc-inline-notification .notification-content {
    flex: 1;
}

.psc-inline-notification .notification-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.psc-inline-notification .notification-message {
    font-size: 14px;
    line-height: 1.5;
}

.psc-inline-notification .notification-details {
    font-size: 13px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
    color: #666;
}

.psc-inline-notification .close-notification {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    margin-left: auto;
}

.psc-inline-notification .close-notification:hover {
    color: #333;
}

/* 成功 */
.psc-inline-notification.success {
    background: #d4edda;
    border-color: #28a745;
}

.psc-inline-notification.success .notification-icon {
    background: #28a745;
    color: white;
}

.psc-inline-notification.success .notification-title {
    color: #155724;
}

.psc-inline-notification.success .notification-message {
    color: #155724;
}

/* エラー */
.psc-inline-notification.error {
    background: #f8d7da;
    border-color: #dc3545;
}

.psc-inline-notification.error .notification-icon {
    background: #dc3545;
    color: white;
}

.psc-inline-notification.error .notification-title {
    color: #721c24;
}

.psc-inline-notification.error .notification-message {
    color: #721c24;
}

.psc-inline-notification.error .notification-details {
    color: #721c24;
    background: rgba(220, 53, 69, 0.1);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    border-top: none;
}

/* 警告 */
.psc-inline-notification.warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.psc-inline-notification.warning .notification-icon {
    background: #ffc107;
    color: #856404;
}

.psc-inline-notification.warning .notification-title {
    color: #856404;
}

.psc-inline-notification.warning .notification-message {
    color: #856404;
}

/* 情報 */
.psc-inline-notification.info {
    background: #cce5ff;
    border-color: #2196F3;
}

.psc-inline-notification.info .notification-icon {
    background: #2196F3;
    color: white;
}

.psc-inline-notification.info .notification-title {
    color: #004085;
}

.psc-inline-notification.info .notification-message {
    color: #004085;
}

/* 古い通知スタイル（非推奨） */
.psc-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: notificationSlideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.psc-notification.success {
    background: #4CAF50;
}

.psc-notification.error {
    background: #f44336;
}

.psc-notification.warning {
    background: #ff9800;
}

.psc-notification.info {
    background: #2196F3;
}

.close-notification {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: auto;
}

/* ============================================
   レスポンシブデザイン
   ============================================ */
@media (max-width: 768px) {
    .psc-container {
        padding: 10px;
    }
    
    .psc-progress-bar {
        flex-direction: column;
        align-items: center;
    }
    
    .psc-progress-bar::before {
        display: none;
    }
    
    .psc-progress-step {
        margin-bottom: 20px;
    }
    
    .psc-form-actions {
        flex-direction: column;
    }
    
    .psc-tabs {
        flex-wrap: wrap;
    }
    
    .psc-tab {
        flex: 1 0 50%;
    }
    
    .psc-patents-table {
        font-size: 14px;
    }
    
    .psc-patents-table th,
    .psc-patents-table td {
        padding: 8px;
    }
    
    .psc-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .psc-download-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .psc-patent-input {
        flex-direction: column;
    }
    
    .psc-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .psc-results-actions {
        margin-top: 10px;
        width: 100%;
    }
    
    .psc-results-actions button {
        flex: 1;
        font-size: 14px;
    }
}

/* ============================================
   印刷用スタイル
   ============================================ */
@media print {
    .psc-progress-bar,
    .psc-form-actions,
    .psc-download-actions,
    .psc-tabs,
    .psc-modal,
    .psc-loading-overlay,
    .psc-notification {
        display: none !important;
    }
    
    .psc-document-viewer {
        max-height: none;
        border: none;
    }
    
    .psc-tab-pane {
        display: block !important;
        page-break-after: always;
    }
}

/* ============================================
   特許詳細表示
   ============================================ */
.patent-detail {
    padding: 10px;
}

.patent-detail-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

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

.patent-detail-section h4 {
    margin: 0 0 15px 0;
    color: #2196F3;
    font-size: 16px;
    font-weight: 600;
    padding-left: 10px;
    border-left: 4px solid #2196F3;
}

.patent-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.patent-detail-table th,
.patent-detail-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.patent-detail-table th {
    width: 120px;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.patent-detail-table td {
    color: #555;
    word-break: break-word;
}

.patent-detail-text {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    line-height: 1.7;
    font-size: 14px;
    color: #444;
    max-height: 400px;
    overflow-y: auto;
}

.patent-detail-text.patent-claims {
    font-family: "游明朝", YuMincho, "Hiragino Mincho ProN", "MS P明朝", serif;
    white-space: pre-wrap;
}

.patent-detail-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
}

.patent-detail-warning p {
    margin: 0;
    color: #856404;
}

.psc-loading {
    text-align: center;
    padding: 40px;
}

.psc-loading p {
    margin-top: 15px;
    color: #666;
}

.psc-error {
    padding: 20px;
    background: #f8d7da;
    border-radius: 6px;
    text-align: center;
}

.psc-error p {
    margin: 0;
    color: #721c24;
}

/* 詳細ボタン */
.view-patent-detail {
    padding: 6px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.view-patent-detail:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

/* キャッシュクリア＆再検索ボタン */
.psc-btn-warning {
    padding: 8px 16px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.psc-btn-warning:hover {
    background: #f57c00;
    transform: translateY(-1px);
}

.psc-btn-warning .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 検索結果なしのメッセージスタイル */
.psc-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.psc-no-results p {
    margin: 10px 0;
}

.psc-no-results ul {
    text-align: left;
    display: inline-block;
    margin-top: 15px;
}

.psc-no-results li {
    margin: 5px 0;
}

/* 検索アクションボタングループ */
.psc-results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 比重設定 */
.psc-weight-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.psc-weight-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.psc-weight-item label {
    min-width: 150px;
    font-weight: 500;
    color: #333;
}

.psc-range {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.psc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    transition: background 0.2s;
}

.psc-range::-webkit-slider-thumb:hover {
    background: #45a049;
}

.psc-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    border: none;
}

.psc-weight-item span {
    min-width: 50px;
    font-weight: bold;
    color: #4CAF50;
}

.psc-weight-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* データなしメッセージ */
.no-content {
    color: #999;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* ============================================
   AIに追加指示・修正機能（ステップ4）
   ============================================ */
.psc-revision-interface {
    display: grid;
    gap: 30px;
}

.psc-current-version {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.psc-current-version h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.psc-modification-input {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #dee2e6;
}

.psc-modification-input h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.psc-modification-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.psc-modification-input .psc-textarea {
    background: white;
    min-height: 160px;
    font-size: 14px;
    line-height: 1.7;
}

.psc-modification-input .psc-textarea::placeholder {
    color: #999;
}

.psc-modification-options {
    display: flex;
    gap: 25px;
    margin: 15px 0 20px 0;
    flex-wrap: wrap;
}

.psc-modification-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.psc-modification-options label:hover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.psc-modification-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2196F3;
    cursor: pointer;
}

.psc-modification-input .psc-btn-primary {
    width: 100%;
    justify-content: center;
    padding: 15px 24px;
    font-size: 16px;
}

.psc-modification-input .psc-btn-primary:disabled {
    background: #ccc;
    cursor: wait;
}

/* Track Changes コントロール */
.track-changes-controls {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

/* 修正履歴の凡例 */
.track-changes-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.track-changes-legend .legend-title {
    font-weight: 600;
    color: #333;
}

.track-changes-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-changes-legend .legend-insert {
    color: #0000FF;
    text-decoration: underline;
    background-color: #e3f2fd;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.track-changes-legend .legend-delete {
    color: #FF0000;
    text-decoration: line-through;
    background-color: #ffebee;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
}

/* 修正履歴トグルボタン */
.track-changes-toggle {
    display: flex;
    gap: 10px;
}

.track-changes-toggle button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.track-changes-toggle button.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.track-changes-toggle button:hover:not(.active) {
    background: #f0f0f0;
    border-color: #bbb;
}

/* 修正履歴付きボタン */
.psc-btn-tracked {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.psc-btn-tracked:hover {
    background: linear-gradient(135deg, #7b1fa2, #6a1b9a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

.psc-btn-tracked:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Track Changes 表示スタイル
   ============================================ */
.track-changes {
    line-height: 1.8;
}

/* 挿入テキスト（青色、下線） */
.track-changes ins.track-insert,
ins.track-insert {
    color: #0000FF;
    text-decoration: underline;
    background-color: #e3f2fd;
    padding: 1px 2px;
    border-radius: 2px;
}

/* 削除テキスト（赤色、取り消し線） */
.track-changes del.track-delete,
del.track-delete {
    color: #FF0000;
    text-decoration: line-through;
    background-color: #ffebee;
    padding: 1px 2px;
    border-radius: 2px;
}

/* 修正履歴非表示モード - 複数のセレクター対応 */
.hide-track-changes ins.track-insert,
.track-changes.hide-track-changes ins.track-insert,
.patent-text.hide-track-changes ins.track-insert,
.patent-section.hide-track-changes ins.track-insert {
    color: inherit !important;
    text-decoration: none !important;
    background-color: transparent !important;
    padding: 0 !important;
}

.hide-track-changes del.track-delete,
.track-changes.hide-track-changes del.track-delete,
.patent-text.hide-track-changes del.track-delete,
.patent-section.hide-track-changes del.track-delete {
    display: none !important;
}

/* 修正履歴 */
.psc-revision-history {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.psc-revision-history h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.psc-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.psc-history-list .no-history {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.psc-history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #2196F3;
}

.psc-history-item .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.psc-history-item .history-version {
    font-weight: 700;
    color: #2196F3;
    font-size: 15px;
}

.psc-history-item .history-time {
    font-size: 13px;
    color: #6c757d;
}

.psc-history-item .history-instruction {
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.psc-history-item .history-result {
    padding: 10px;
    background: #d4edda;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
}

.psc-history-item .history-label {
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 5px;
}

.psc-history-item .history-instruction .history-label {
    color: #0056b3;
}

.psc-history-item .history-result .history-label {
    color: #155724;
}

.psc-history-item .history-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.psc-history-item .history-result .history-text {
    color: #155724;
}

/* ステップ4のダウンロードボタン */
#psc-step-4 .psc-btn-success {
    padding: 15px 30px;
    font-size: 16px;
}

#psc-step-4 .psc-form-actions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .psc-modification-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .psc-modification-options label {
        width: 100%;
    }
    
    .psc-history-item .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
