/* サンカク */
details summary.hide {
    list-style: none;
}
details summary.hide ::-webkit-details-marker {
    display: none;
}
details summary{
    cursor: pointer;
}
/* FAQ like message */
*{
    margin:0;
    padding:0;
}
.faq_area {
    /* 上 | 右 | 下 | 左  要調整*/
    margin: 0px 0% 0 0%;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}
.faq_area .author{
    /* 上 | 右 | 下 | 左  要調整*/
    flex-wrap:nowrap;
}
.faq_area img{
    /* 上 | 右 | 下 | 左  要調整*/
    margin: 0;
    width: 30px;    /* 横幅を割合で指定 */
    height: auto;  /* 高さは自動指定 */
}
.faq_area .B,
.faq_area .A {
    min-width:80px;
    padding:10px 2% 10px 2%;
    color: #fff;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.faq_area .A {
    text-align:left;
    margin:5px auto 5px 50px;
    background-clip: content-box;
    background: #494044;
}
.faq_area .A:before {
    content: "";
    border: 10px solid transparent;
    border-right: 20px solid #494044;
    position: absolute;
    left: -20px;
    top: 20px;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
}
.faq_area .B {
    text-align:right;
    margin:5px 10px 5px auto;
    background: #0096e5;
}
.faq_area .B:after {
    content: "";
    border: 10px solid transparent;
    border-left: 20px solid #0096e5;
    position: absolute;
    right: -20px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
}

/* 以下、高橋編集 */
.sortTable{
    height: 20%;
    display : flex;
    justify-content: space-between;
    flex-direction:column;
    align-items: flex-start;
    cursor: pointer;
}
.sortTable_radio{
    height: 13%;
    margin-top: 7%;
    cursor: pointer;

}
.chart_radio{
    cursor: pointer;
}
.wrapper{
    width: 80%;
    margin: 20px 0 10% 10%;
}
.toplevelcomment{
    margin: 10px 0;
}
.filter{
    display: flex;
    width: 100%;
    margin: 0 10px 0 0 ;
}
.filter-name{
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
.filter_label{
    height: 20%;
}
.filter-input{
    width: 50%;
    display: flex;
    flex-direction: column;
}
/* DEBUG: Added margin to each slider to create vertical space for the rulers. */
.filter-input .slider {
    margin-bottom: 40px;
    width: 90%;
}

/* DEBUG: Added margin-top to push the keyword input down below the sliders. */
.keyword{
    margin: 20px 0 10px 0;
}
.table{
    margin: 10px 0;
}
.sort{
    margin: 10px 0;
}
.sorttext{
    width: 45%;
}
.page{
    margin: 10px 0;
}
.pageturn{
    margin: 10px 0;
}
.details{
    width: fit-content;
}
@media (prefers-color-scheme: dark) {
    body {
      background-color: rgb(36, 36, 36);
      color: #e9e9e9;
    }

    .nondisp{
        display: none;
        color: #121212;
    }
}

@media (prefers-color-scheme: light) {
    body {
      background-color: rgb(255, 255, 255);
      color: #000000;
    }

    .nondisp{
        display: none;
    }
}

#chart-container{
    background-color: #fffce5;
}

.popup_text {
    display: none; /* 最初は非表示にする */
    position: absolute; /* 他の要素の上に重ねるために絶対位置を指定 */
    /* その他のスタイルプロパティを適用 */

    padding: 5px;
    background-color: #e4e4e4;
    border-radius: 5px;
    max-width: 400px;

    @media (prefers-color-scheme: light){
        color: #121212;
    }

    @media (prefers-color-scheme: dark) {
        color: #121212;
    }
}

.nondisp{
    display: none;
}

.noUi-handle {
    border: 1px solid #D9D9D9;
    border-radius: 3px;
    background: #FFF;
    cursor: pointer;
    box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #EBEBEB, 0 3px 6px -3px #BBB;
  }

.noUi-handle:before,
.noUi-handle:after {
  content: "";
  display: block;
  position: absolute;
  height: 14px;
  width: 1px;
  background: #ffffff00;
  left: 14px;
  top: 6px;
}

.noUi-base{
    width: 100%;
    height: 100%;
    margin: auto;
}

.noUi-target {
    position: relative;
    display: flex;
    justify-content: center; /* 水平方向に中央揃え */
    align-items: center; /* 垂直方向に中央揃え */
    height: 18px;
    top: 2px;
}

.noUi-horizontal .noUi-handle {
    width: 18px;
    height: 18px;
    right: -9px;
    bottom: -17px;
    top:-1px;
}

.noUi-connect {
    background: rgb(0, 157, 255);
}

.noUi-tooltip {
    z-index: 9999;
  }

/* Fix for Video Description cursor and interaction */
/* Modern Threading UI */
#dialog_discussion {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 80%;
    max-width: 800px;
    height: 80vh;
    max-height: 80vh;
    padding: 0;
    overflow: hidden;
    background: white;
    z-index: 9999;
}

@media (prefers-color-scheme: dark) {
    #dialog_discussion {
        background: #1e1e1e;
        color: #e9e9e9;
    }
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

@media (prefers-color-scheme: dark) {
    .dialog-header {
        background: #2d2d2d;
        border-bottom-color: #3d3d3d;
    }
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

#dialog_discussion_content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.ai-summary-box {
    position: sticky;
    top: -20px; /* Offset for container padding */
    z-index: 100;
    background: #f0f7ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
    font-size: 0.95em;
    line-height: 1.5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
    .ai-summary-box {
        background: #1a2a3a;
        border-left-color: #3498db;
    }
}

.comment-node {
    position: relative;
    margin-bottom: 16px;
}

.comment-main {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-content {
    flex-grow: 1;
}

.author-meta {
    font-size: 0.85em;
    margin-bottom: 4px;
}

.author-name {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}

@media (prefers-color-scheme: dark) {
    .author-name {
        color: #eee;
    }
}

.timestamp {
    color: #888;
}

.comment-text {
    line-height: 1.4;
    word-break: break-word;
}

.replies-container {
    margin-left: 17px;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
    transition: border-color 0.2s;
}

@media (prefers-color-scheme: dark) {
    .replies-container {
        border-left-color: #444;
    }
}

.child-node {
    position: relative;
    margin-top: 12px;
}

/* The Curved Elbow Hook */
.child-node:before {
    content: "";
    position: absolute;
    left: -20px;
    top: -12px; /* Connects with sibling above */
    width: 20px;
    height: 32px; /* Reaches middle of avatar */
    border-left: 2px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    border-bottom-left-radius: 12px;
    background: transparent;
    transition: border-color 0.2s;
}

/* Terminates the container's border-left at the last child's hook */
.replies-container .child-node:last-child:after {
    content: "";
    position: absolute;
    left: -22px;
    top: 20px;
    bottom: -20px;
    width: 4px;
    background: white;
}

@media (prefers-color-scheme: dark) {
    .child-node:before {
        border-left-color: #444;
        border-bottom-color: #444;
    }
    .replies-container .child-node:last-child:after {
        background: #1e1e1e;
    }
}

/* Highlight the entire path when hovering */
.child-node:hover:before {
    border-left-color: #888 !important;
    border-bottom-color: #888 !important;
}

.replies-container:hover {
    border-left-color: #888;
}


/* --- Content Expanders & Sections --- */
.display_elements summary {
    padding: 12px 50px 12px 20px !important;
    background-color: #f9f9f9 !important;
    border-radius: 12px !important;
    font-family: 'Roboto', sans-serif !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    color: #0f0f0f !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    list-style: none !important; /* Hide default arrow */
    position: relative !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    cursor: pointer !important;
}

.display_elements summary::-webkit-details-marker {
    display: none !important;
}

.display_elements summary:after {
    content: '▼' !important;
    position: absolute !important;
    right: 20px !important;
    font-size: 10px !important;
    color: #606060 !important;
    transition: transform 0.2s !important;
}

details[open] summary:after {
    transform: rotate(180deg) !important;
}

.display_elements summary:hover {
    background-color: #f1f1f1 !important;
    border-color: rgba(6, 95, 212, 0.2) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

#video_description, .keyword {
    background: white !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 0 0 12px 12px !important;
    padding: 20px !important;
    margin-top: -5px !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
}

/* Rounded inputs refresh */
input[readonly], input[type="text"], input[type="number"], .subject {
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    padding: 6px 12px !important;
    font-family: 'Roboto', sans-serif !important;
    outline: none !important;
    transition: border-color 0.2s !important;
}

input:focus {
    border-color: #065fd4 !important;
}

#reset_button {
    background-color: #f2f2f2 !important;
    border: 1px solid #ddd !important;
    border-radius: 18px !important;
    padding: 6px 16px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

#reset_button:hover {
    background-color: #e5e5e5 !important;
    border-color: #ccc !important;
}

/* --- Premium Buttons Design System --- */
.modern-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 18px; /* Pill shape */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.05, 0, 0, 1);
    text-transform: none;
    letter-spacing: 0.1px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    outline: none;
}

.primary-btn {
    background-color: #065fd4; /* YouTube Premium Blue */
    color: white;
}

.primary-btn:hover {
    background-color: #054fb1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.primary-btn:active {
    background-color: #043f8e;
    transform: translateY(0);
}

.secondary-btn {
    background-color: #f2f2f2;
    color: #0f0f0f;
    border: 1px solid rgba(0,0,0,0.1);
}

.secondary-btn:hover {
    background-color: #e5e5e5;
    border-color: rgba(0,0,0,0.2);
}

.see-thread-btn {
    background: none;
    border: none;
    color: #065fd4;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    display: inline-block;
    text-decoration: none;
}

.see-thread-btn:hover {
    background-color: rgba(6, 95, 212, 0.1);
    color: #0e4cad;
}

/* --- Hero Section --- */
.hero-section {
    padding: 30px 0 40px 0;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.hero-title {
    font-family: 'Roboto', sans-serif !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #0f0f0f !important;
    margin-bottom: 12px !important;
    letter-spacing: -0.5px !important;
    border: none !important;
    padding: 0 !important;
}

.hero-title .badge {
    font-size: 14px !important;
    background: #FF0000 !important; /* YouTube Red */
    color: white !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    vertical-align: middle !important;
    margin-left: 10px !important;
}

.hero-subtitle {
    font-family: 'Roboto', sans-serif !important;
    font-size: 17px !important;
    line-height: 1.6 !important;
    color: #606060 !important;
    max-width: 800px !important;
    margin-bottom: 24px !important;
}

.feature-pills {
    display: flex !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

.pill {
    background: #f2f2f2 !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #0f0f0f !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    transition: transform 0.2s !important;
}

.pill:hover {
    transform: translateY(-2px) !important;
    background: #e8e8e8 !important;
}

.input-container {
    margin-bottom: 20px !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 14px !important;
    color: #606060 !important;
}

/* ==========================================================
   Conflict / troll detection UI
   ========================================================== */

.conflict-role-badge {
    display: inline-block;
    color: #ffffff;
    font-size: 0.75em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

.conflict-risk-panel {
    position: sticky;
    top: -20px;
    z-index: 99;
    background: #fdecea;
    border-left: 4px solid #d9534f;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.conflict-risk-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.conflict-risk-tag {
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.6px;
}

.conflict-risk-sub {
    color: #555;
    font-size: 0.9em;
}

/* Flame-war panel has a dark red background — invert text colors so
   the subtitle / chips / pattern arrows stay readable. */
.conflict-risk-panel.risk-flame_war .conflict-risk-sub {
    color: rgba(255,255,255,0.92);
}
.conflict-risk-panel.risk-flame_war .conflict-chip {
    background: rgba(255,255,255,0.92);
    border-color: rgba(0,0,0,0.15);
    color: #1a1a1a;
}
.conflict-risk-panel.risk-flame_war .conflict-pattern-arrow {
    color: rgba(255,255,255,0.8);
}
.conflict-risk-panel.risk-flame_war .conflict-risk-bar {
    background: rgba(255,255,255,0.25);
}

.conflict-risk-bar {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.conflict-risk-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.conflict-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.conflict-chip {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 0.85em;
    color: #333;
}

.conflict-chip b {
    margin-right: 4px;
    font-weight: 600;
}

.conflict-pattern {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.conflict-pattern-step {
    display: inline-block;
    color: #fff;
    font-size: 0.72em;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.2px;
}

.conflict-pattern-arrow {
    color: #888;
    font-weight: 700;
    margin: 0 2px;
}

@media (prefers-color-scheme: dark) {
    .conflict-chip {
        background: rgba(255,255,255,0.08);
        border-color: rgba(255,255,255,0.15);
        color: #eee;
    }
    .conflict-risk-sub { color: #bbb; }

    /* Keep flame_war overrides in dark mode too. */
    .conflict-risk-panel.risk-flame_war .conflict-chip {
        background: rgba(255,255,255,0.92);
        color: #1a1a1a;
    }
    .conflict-risk-panel.risk-flame_war .conflict-risk-sub {
        color: rgba(255,255,255,0.92);
    }
}
