/* Blog Text Extractor Plugin Styles - Version 1.3.0 - スタイリッシュUI */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#blog-extractor-container {
    max-width: 1000px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
}

/* メインフォームコンテナ */
.blog-extractor-form {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
}

.blog-extractor-form:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* フォームグループ */
.form-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: stretch;
}

/* フォーマットオプション */
.format-options {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    transition: all 0.3s ease;
    user-select: none;
}

.checkbox-label:hover {
    background: var(--bg-tertiary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* URLインプット */
#blog-url-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
}

#blog-url-input:hover {
    border-color: var(--primary-light);
    background: var(--bg-primary);
}

#blog-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

#blog-url-input::placeholder {
    color: var(--text-light);
}

/* 抽出ボタン */
#blog-extract-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

#blog-extract-btn::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;
}

#blog-extract-btn:hover::before {
    left: 100%;
}

#blog-extract-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.5);
}

#blog-extract-btn:active:not(:disabled) {
    transform: translateY(0);
}

#blog-extract-btn:disabled {
    background: linear-gradient(135deg, var(--text-light) 0%, var(--border-color) 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* エラーメッセージ */
.error-message {
    color: var(--danger-color);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid var(--danger-color);
    font-size: 14px;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease;
}

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

.error-message strong {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

/* ローディング */
.loader {
    text-align: center;
    padding: 32px;
    color: var(--primary-color);
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

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

.spinner {
    border: 3px solid rgba(99, 102, 241, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 12px;
    vertical-align: middle;
}

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

/* 結果コンテナ */
.result-container {
    margin-top: 40px;
    animation: fadeInUp 0.5s ease;
}

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

/* タブナビゲーション */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 14px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    background: transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    border: none;
    color: var(--text-secondary);
    position: relative;
}

.tab:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.tab.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* タブコンテンツ */
.tab-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.result-section {
    margin-bottom: 32px;
}

.result-section h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-section h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

.result-section p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.result-section a {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.result-section a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

/* セクション表示 */
.section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

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

.section:hover {
    transform: translateX(4px);
}

.section-heading {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 16px 20px;
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.section-heading:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    transform: translateX(4px);
}

.section-content {
    margin-left: 24px;
    white-space: pre-wrap;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 15px;
}

/* 見出し一覧 */
#result-headings-tab {
    margin: 0;
    padding-left: 24px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    list-style: none;
}

#result-headings-tab li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    white-space: pre;
    font-size: 14px;
    line-height: 1.8;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#result-headings-tab li:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.heading-level-1 {
    font-weight: 700;
    color: var(--text-primary) !important;
    font-size: 16px !important;
}

.heading-level-2 {
    font-weight: 600;
    color: var(--text-primary) !important;
    font-size: 15px !important;
}

.heading-level-3 {
    color: var(--text-secondary) !important;
    font-size: 14px !important;
}

.heading-level-4 {
    color: var(--text-light) !important;
    font-size: 13px !important;
}

.heading-level-5 {
    color: var(--text-light) !important;
    font-size: 12px !important;
}

.heading-level-6 {
    color: var(--text-light) !important;
    font-size: 12px !important;
}

.heading-tag {
    color: var(--primary-color);
    font-weight: 700;
    margin-right: 8px;
    font-size: 11px;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.heading-text {
    color: inherit;
}

.no-headings {
    color: var(--text-light) !important;
    font-style: italic;
}

/* プレーンテキスト */
#result-content-tab {
    white-space: pre-wrap;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 16px;
}

#result-content-tab::-webkit-scrollbar {
    width: 8px;
}

#result-content-tab::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

#result-content-tab::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

#result-content-tab::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.empty-message {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #blog-extractor-container {
        margin: 16px;
    }
    
    .blog-extractor-form {
        padding: 24px;
        border-radius: 12px;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    #blog-extract-btn {
        width: 100%;
    }
    
    .tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .tab {
        text-align: center;
    }
    
    .section-content {
        margin-left: 12px;
    }
    
    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tab-content {
        padding: 20px;
    }
}

/* アクセシビリティ */
.tab:focus-visible,
#blog-extract-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

/* 印刷スタイル */
@media print {
    .tabs,
    .form-group,
    .format-options,
    .loader {
        display: none !important;
    }
    
    .tab-content {
        border: none;
        box-shadow: none;
        display: block !important;
    }
    
    .section-heading {
        background: none;
        border-left: 3px solid #000;
    }
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --bg-tertiary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --border-color: #374151;
        --border-light: #4b5563;
    }

    #blog-url-input {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .section-heading:hover {
        color: white;
    }
}
