/* ========================================
   Spark Sheets Insights Styles
   Insightså°‚ç”¨ã®ã‚¹ã‚¿ã‚¤ãƒ«å®šç¾©
   ======================================== */

/* Insights List Page - Full Width */
.insights-list-page {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden;
}

/* Search Container */
.insights-search-container {
    margin: 1rem 0 0.75rem;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    font-size: 1rem;
    border: 1px solid #e6e6e6;
    border-radius: 30px;
    background: #ffffff;
    transition: var(--docs-transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--docs-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #999;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 1.25rem;
    top: 53%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #999;
    transition: var(--docs-transition);
    display: none;
}

.search-clear:hover {
    color: #333;
}

.search-clear svg {
    width: 20px;
    height: 20px;
}

/* Search Results Info */
.search-results-info {
    text-align: center;
    margin: 0.5rem 0 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.results-count {
    font-weight: 500;
    color: #333;
    margin-right: 1rem;
}

.clear-search {
    background: none;
    border: none;
    color: var(--docs-primary);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.875rem;
}

.clear-search:hover {
    color: #000;
}

/* Category Filters */
.insights-categories {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 0.375rem 1rem;
    border: 1px solid #e6e6e6;
    background: #ffffff;
    border-radius: 24px;
    font-size: 0.875rem;
    color: #666;
    cursor: pointer;
    transition: var(--docs-transition);
    font-weight: 500;
}

.category-btn:hover {
    border-color: var(--docs-primary);
    color: var(--docs-primary);
}

.category-btn.active {
    background: var(--docs-primary);
    color: #ffffff;
    border-color: var(--docs-primary);
}

.category-btn-count {
    opacity: 0.7;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Category Section - 重複を削除 */

/* メインコンテナの幅制限 */
.docs-main {
    overflow-x: hidden;
    max-width: 100%;
}

.category-header {
    margin-bottom: 0.75rem;
}

.category-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.category-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    letter-spacing: -0.02em;
}

.category-count {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.category-description {
    color: #666;
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
}

/* Carousel Container */
.insights-carousel {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
    max-width: 100%;
}

/* カルーセルラッパー（矢印の位置基準） */
.carousel-wrapper {
    position: relative;
    width: 100%;
}

/* スクロールヒントラッパー */
.scroll-hints-wrapper {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 40px;
    pointer-events: none;
    z-index: 10;
}

/* スクロールヒント矢印 */
.scroll-hint {
    position: absolute;
    top: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e6e6e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: all;
}

.scroll-hint:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-hint-left {
    left: 10px;
    opacity: 0;
}

.scroll-hint-right {
    right: 10px;
    animation: pulse 2s infinite;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-hint-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #666;
    stroke-width: 2;
}

/* パルスアニメーション */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* 初回スクロールアニメーション用 */
.insights-carousel.auto-scrolling {
    scroll-behavior: smooth;
}

.insights-carousel::-webkit-scrollbar {
    height: 10px;
}

.insights-carousel::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 5px;
    margin: 0 2rem;
}

.insights-carousel::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 5px;
    border: 2px solid #f5f5f5;
}

.insights-carousel::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.insights-carousel-inner {
    display: inline-flex;
    gap: 1rem;
    padding-bottom: 0.5rem;
    flex-wrap: nowrap;
    align-items: stretch;
}

/* Horizontal Card Style */
.insight-card-horizontal {
    flex: 0 0 300px;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    min-height: 180px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.insight-card-horizontal:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #ddd;
}

.new-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #FF6B9D;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.demo-badge {
    background: #FFD700;
    color: #000;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.insight-card-horizontal .insight-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    white-space: normal;
}

.insight-card-horizontal .insight-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.insight-card-horizontal .insight-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.insight-card-horizontal .insight-excerpt {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.insight-card-horizontal .insight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #999;
    margin-top: auto;
    gap: 0.5rem;
}

.insight-card-horizontal .insight-footer > * {
    white-space: nowrap;
}

.insight-card-horizontal .insight-metrics {
    color: #666;
}

/* カテゴリーセクションのスタイリング */
.category-section {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e6e6e6;
    overflow: hidden;
}

.category-section:last-child {
    margin-bottom: 0;
}

/* タブレット対応 */
@media (max-width: 1024px) {
    .insight-card-horizontal {
        flex: 0 0 280px;
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }
    
    .insights-carousel {
        margin: 0;
        padding: 0.25rem;
    }
}

/* モバイル対応 */
@media (max-width: 640px) {
    .insight-card-horizontal {
        flex: 0 0 260px;
        width: 260px;
        min-width: 260px;
        max-width: 260px;
    }
}

/* Insights Grid - note.com style */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* PC: 5 columns */
    gap: 1.5rem;
    margin-bottom: 4rem;
}

/* Tablet: 4 columns */
@media (max-width: 1024px) and (min-width: 768px) {
    .insights-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .insights-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* カテゴリー別セクションのモバイル対応 */
    .category-title {
        font-size: 1.25rem;
    }
    
    .category-icon {
        font-size: 1.25rem;
    }
    
    .insights-carousel {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .insight-card-horizontal {
        flex: 0 0 280px;
        width: 280px;
    }
}

/* Insight Card - note.com style */
.insight-card {
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--docs-transition);
    position: relative;
    height: 100%;
}

.insight-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.insight-card.featured {
    border-color: #FFD700;
}

.featured-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #FFD700;
    color: #000;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.insight-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.insight-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.insight-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.insight-category {
    padding: 3px 7px;
    color: #fff;
    font-weight: 700;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px #ddd solid;
    border-radius: 5px;
    background-color: #000;
}

.insight-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.insight-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--docs-text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.insight-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: auto;
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.insight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.insight-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-author {
    color: #666;
    font-weight: 500;
}

.insight-metrics {
    color: #999;
    font-size: 0.75rem;
}

.read-more {
    color: var(--docs-primary);
    font-weight: 500;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.insight-card:hover .read-more {
    opacity: 1;
}

/* Coming Soon */
.insights-coming-soon {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--docs-bg);
    border-radius: 12px;
    margin-top: 4rem;
}

.insights-coming-soon p {
    font-size: 1.125rem;
    color: var(--docs-text-muted);
}

/* Insights Article Styles */
.insights-article {
    font-family: var(--docs-font-family);
    line-height: var(--docs-line-height);
    color: var(--docs-text);
}

.insights-article h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.insights-article h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    color: var(--docs-text);
}

.insights-article h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0rem 0 1rem;
    color: var(--docs-text);
}

.insights-lead {
    font-size: 1.125rem;
    line-height: 1.8;
    margin: 2rem 0;
    color: var(--docs-text-muted);
    font-weight: 400;
}

.insights-section {
    margin: 4rem 0;
}

.insights-quote {
    border-left: 3px solid #FFD700;
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--docs-text-muted);
}

.insights-highlight {
    background: #FFF9E5;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.insights-cta {
    background: var(--docs-bg);
    padding: 3rem;
    text-align: center;
    margin: 4rem 0;
    border-radius: 12px;
    border: 1px solid var(--docs-border);
}

.insights-cta .btn{
    font-size: 1rem !important;
    border: 1px solid var(--docs-border);
    background: #000000;
    padding: 1.5rem 3rem;
    border-radius: 12px;
    color:#fff;
    font-weight:700;
    letter-spacing:0.02rem;
}
    


.insights-cta h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.insights-cta p {
    font-size: 1.125rem;
    color: var(--docs-text-muted);
    margin-bottom: 2rem;
}

/* Article Sidebar */
.article-sidebar {
    position: sticky;
    top: 2rem;
    margin-top: 2rem;
}

.article-toc {
    background: var(--docs-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.article-toc-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.article-toc-list {
    list-style: none;
    padding: 0;
}

.article-toc-list li {
    margin-bottom: 0.75rem;
}

.article-toc-list a {
    color: var(--docs-text-muted);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    border-left: 2px solid transparent;
    padding-left: 1rem;
    transition: var(--docs-transition);
}

.article-toc-list a:hover {
    color: var(--docs-primary);
    border-left-color: #FFD700;
}

.article-toc-list a.active {
    color: var(--docs-primary);
    font-weight: 600;
    border-left-color: var(--docs-primary);
}

/* Inline Table of Contents */
.article-toc-inline {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem 1.5rem;
    margin: 2rem 0 3rem;
}

.article-toc-inline .toc-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--docs-text);
}

.article-toc-inline .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.article-toc-inline .toc-list li {
    counter-increment: toc-counter;
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
}

.article-toc-inline .toc-list li::before {
    content: counter(toc-counter) ".";
    position: absolute;
    left: 0;
    color: var(--docs-text-muted);
    font-weight: 500;
}

.article-toc-inline .toc-list a {
    color: var(--docs-text);
    text-decoration: none;
    transition: var(--docs-transition);
    display: inline-block;
}

.article-toc-inline .toc-list a:hover {
    color: var(--docs-primary);
    text-decoration: underline;
}

/* Dark mode adjustments for inline TOC */
body.dark-mode .article-toc-inline {
    background: var(--docs-bg-secondary);
    border-color: var(--docs-border);
}

/* ========== Dark Mode - Insights Page Elements ========== */

/* Search box */
body.dark-mode .search-input {
    background: #2c2c34 !important;
    border-color: #38383d !important;
    color: #ffffff !important;
}

body.dark-mode .search-input::placeholder {
    color: #8e8e93 !important;
}

body.dark-mode .search-icon {
    color: #8e8e93 !important;
}

body.dark-mode .search-clear {
    color: #8e8e93 !important;
}

body.dark-mode .search-clear:hover {
    color: #ffffff !important;
}

body.dark-mode .search-results-info {
    background: #2c2c34 !important;
}

body.dark-mode .results-count {
    color: #ffffff !important;
}

body.dark-mode .clear-search {
    color: #ffffff !important;
}

body.dark-mode .clear-search:hover {
    color: #8e8e93 !important;
}

/* Category filters */
body.dark-mode .category-btn {
    background: #2c2c34 !important;
    border-color: #38383d !important;
    color: #8e8e93 !important;
}

body.dark-mode .category-btn:hover {
    border-color: #ffffff !important;
    color: #ffffff !important;
}

body.dark-mode .category-btn.active {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* Category section */
body.dark-mode .category-section {
    border-color: #38383d !important;
}

body.dark-mode .category-title {
    color: #ffffff !important;
}

body.dark-mode .category-count {
    background: #38383d !important;
    color: #8e8e93 !important;
}

body.dark-mode .category-description {
    color: #8e8e93 !important;
}

/* Insight cards - horizontal */
body.dark-mode .insight-card-horizontal {
    background: #2c2c34 !important;
    border-color: #38383d !important;
}

body.dark-mode .insight-card-horizontal:hover {
    border-color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .insight-card-horizontal .insight-title {
    color: #ffffff !important;
}

body.dark-mode .insight-card-horizontal .insight-excerpt {
    color: #8e8e93 !important;
}

body.dark-mode .insight-card-horizontal .insight-metrics {
    color: #8e8e93 !important;
}

/* Insight cards - grid */
body.dark-mode .insight-card {
    background: #2c2c34 !important;
    border-color: #38383d !important;
}

body.dark-mode .insight-card:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .insight-category {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

body.dark-mode .insight-title {
    color: #ffffff !important;
}

body.dark-mode .insight-subtitle {
    color: #8e8e93 !important;
}

body.dark-mode .insight-excerpt {
    color: #8e8e93 !important;
}

body.dark-mode .insight-footer {
    border-color: #38383d !important;
}

body.dark-mode .insight-author {
    color: #8e8e93 !important;
}

body.dark-mode .insight-metrics {
    color: #8e8e93 !important;
}

body.dark-mode .read-more {
    color: #ffffff !important;
}

/* Carousel */
body.dark-mode .insights-carousel::-webkit-scrollbar-track {
    background: #1a1a1e !important;
}

body.dark-mode .insights-carousel::-webkit-scrollbar-thumb {
    background: #38383d !important;
    border-color: #1a1a1e !important;
}

body.dark-mode .insights-carousel::-webkit-scrollbar-thumb:hover {
    background: #4a4a4f !important;
}

/* Scroll hints */
body.dark-mode .scroll-hint {
    background: rgba(44, 44, 52, 0.95) !important;
    border-color: #38383d !important;
}

body.dark-mode .scroll-hint-icon {
    stroke: #8e8e93 !important;
}

/* Coming Soon */
body.dark-mode .insights-coming-soon {
    background: #2c2c34 !important;
}

body.dark-mode .insights-coming-soon p {
    color: #8e8e93 !important;
}

/* Article styles */
body.dark-mode .insights-article h1,
body.dark-mode .insights-article h2,
body.dark-mode .insights-article h3 {
    color: #ffffff !important;
}

body.dark-mode .insights-lead {
    color: #8e8e93 !important;
}

body.dark-mode .insights-quote {
    border-color: #FFD700 !important;
    color: #8e8e93 !important;
}

body.dark-mode .insights-highlight {
    background: rgba(255, 215, 0, 0.1) !important;
}

body.dark-mode .insights-cta {
    background: #2c2c34 !important;
    border-color: #38383d !important;
}

body.dark-mode .insights-cta .btn {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

body.dark-mode .insights-cta h3 {
    color: #ffffff !important;
}

body.dark-mode .insights-cta p {
    color: #8e8e93 !important;
}

/* Article sidebar */
body.dark-mode .article-toc {
    background: #2c2c34 !important;
}

body.dark-mode .article-toc-title {
    color: #ffffff !important;
}

body.dark-mode .article-toc-list a {
    color: #8e8e93 !important;
}

body.dark-mode .article-toc-list a:hover,
body.dark-mode .article-toc-list a.active {
    color: #ffffff !important;
    border-color: #FFD700 !important;
}

/* Share buttons */
body.dark-mode .share-btn {
    background: #2c2c34 !important;
    border-color: #38383d !important;
    color: #8e8e93 !important;
}

body.dark-mode .share-btn:hover {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: .75rem;
}

.share-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--docs-border);
    background: var(--docs-bg-secondary);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--docs-text-muted);
    font-size: 0.875rem;
    transition: var(--docs-transition);
}

.share-btn:hover {
    background: var(--docs-primary);
    color: #ffffff;
    border-color: var(--docs-primary);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .insights-highlight {
        background: rgba(255, 215, 0, 0.1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .insight-title {
        font-size: 1.5rem;
    }
    
    .insights-article h1 {
        font-size: 2rem;
    }
    
    .insights-article h2 {
        font-size: 1.5rem;
    }
    
    .article-sidebar {
        display: none;
    }
}