body { 
    background: #FFF; 
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

#header {
    background-color: #FFF;
}

.section-view {
    
}

.header-title {
    font-family: 'DM Serif Display';
    color: #000;
    white-space: normal;
    padding-top: 10px;
    width:100%;
    text-transform:uppercase
}

#links {
    font-family: sans-serif;
    padding: 5px 0px;
    border-bottom: solid 1px #CCC;
    margin-bottom: 15px;
}

#links a {
    font-size: 14px;
    display: inline-block;
    margin: 5px 8px;
    color: #333;
    padding-bottom: 0px;
}

#links a:hover {
    color: #36F;
    text-decoration: none;
}

#links a.active,
.link-active {
    color: #282 !important
}

#topic-list {
    background-color: rgba(255,255,255,0.5);
    border-bottom: solid 1px rgba(255,255,255,0.5);
}

.topic-list-head {
    font-family: 'DM Serif Display';
    font-size: 24px;
    border-bottom: solid 1px rgba(255,255,255,0.25);
    padding:10px 0px;
}

.topic-list-item {
    margin: 2px 0px;
    padding: 3px 6px;
    cursor: pointer;
    border-radius: 3px;
    background-color:blanchedalmond;
}

.topic-list-item:hover {
    background-color:darkorange;
    color: white;    
}

.topic-list-detail {
    cursor: pointer;
    padding: 10px;
    border-bottom: solid 1px #DDD;
}

.topic-list-detail:hover {
    background-color: rgba(10, 30, 220, 0.1);
}


#cluster-box {
    width: 100%;
    background-color: rgba(255,255,255,0.9);
    margin-top:15px;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 10px;
}

#chart {
    width: 100%;
    height: 520px;
    background-color: rgba(255,255,255,0.9);
    margin-top:5px;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 10px;
}

#legend {
    width: 100%;
    background-color: rgba(255,255,255,0.9);
    margin-top: 5px;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 8px 15px;
}

.legend-name {
    font-family: Raleway;
    font-size: 18px;
    border-bottom: solid 1px #DDD;
    padding-bottom: 5px;
}

.legend-dict {
    font-family: sans-serif;
    font-weight: 100;
    font-size: 14px;
}

.btn-xs {
    display: inline-block;
    vertical-align: middle;
    color: #AAA;
}

.material-icons.md-btn { font-size: 16px; font-weight: bold; }

.btn-cluster {
    background-color: #E3E3E3;
    color: white;
}

A.topic-sel {
    text-decoration: none;
}

A.topic-sel:hover {
    font-weight: bold;
}

.tip-box {
    max-width: 160px;
    font-size: 10px;
    color: #666;
}

#abstract {
    font-family:Raleway; 
    font-size:18px; 
    line-height:160%; 
    text-align: justify;
}

.text {
    font-family:Raleway; 
    font-size:18px; 
    line-height:160%; 
    text-align: justify;
    color:#000;
}

#authors{
    font-family:Raleway; 
    font-size: 12px;
    color: #999;
    font-weight: 300;
    margin-top: 30px;
    width: 100%;
    text-align: center;
}

#authors h2{
    font-size: 20px;
    font-weight: 300;
}

#authors a{
    text-decoration: none;
    color: darkorange;
}

#data {
    font-family:Raleway;
    color: #666;
    margin-top: 20px;
}

#data a {
    margin-right: 5;
    font-family: sans-serif;
    color: dodgerblue;
}

#data p {
    margin:0px;
    font-size: 16px;
    color: #000;
    text-align: justify;
}

#data .data-link {
    margin-bottom: 25px;
    margin-top: 5px;
    font-size: 14px;
}

/* Topic Control Buttons */
.topic-controls {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.legend-name:hover .topic-controls {
    opacity: 1;
}

.topic-control-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px !important;
    border-radius: 4px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280 !important;
    transition: all 0.3s ease;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
}

.topic-control-btn:hover {
    color: #374151 !important;
    background-color: rgba(107, 114, 128, 0.1) !important;
    transform: scale(1.1);
}

.topic-control-btn:focus {
    outline: 2px solid #007acc;
    outline-offset: 2px;
}

.topic-control-btn .material-icons {
    font-size: 14px !important;
    line-height: 1;
}

/* Topic visibility states */
.topic-hidden {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.topic-visible {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Enhanced legend styling for topic controls */
.legend-name {
    position: relative;
}

/* Mobile responsiveness for touch targets */
@media (max-width: 768px) {
    .topic-control-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        padding: 6px !important;
    }

    .topic-control-btn .material-icons {
        font-size: 16px !important;
    }

    .topic-controls {
        opacity: 1; /* Always show on mobile */
    }
}

/* Accordion Styles */
.accordion-container {
    margin: 20px auto;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: visible;
    background: white;
    transition: border-radius 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accordion container when expanded - remove bottom border radius */
.accordion-container.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Accordion Header - Container */
.accordion-header {
    background: #f8f9fa;
    color: #2c3e50;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Main title section - This is clickable */
.accordion-title {
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

/* Sticky Controls Panel */
.sticky-controls-panel {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sticky-topic-controls {
    background: white;
    border-bottom: solid 1px #CCC;
    padding-bottom: 15px;
}

.accordion-title:hover {
    background: #fff;
    border-radius: 8px 8px 0 0;
    color: #1a1a1a;
}

/* Apply hover effect to entire header when title is hovered */
.accordion-header:hover {
    border-color: darkorange;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(255, 140, 0, 0.15);
}

.accordion-title:focus {
    outline: 3px solid rgba(255, 140, 0, 0.6);
    outline-offset: 2px;
}

.accordion-header.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.accordion-title-text {
    font-family: 'DM Serif Display', serif;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.accordion-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selection-counter {
    background: rgba(108, 117, 125, 0.1);
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.plot-button {
    background: white;
    color: #2c3e50;
    border: 2px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.plot-button:enabled:hover {
    background: #fff;
    border-color: darkorange;
    color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 140, 0, 0.2);
}

.plot-button:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
    cursor: not-allowed;
}

.plot-button:focus {
    outline: 2px solid rgba(255, 140, 0, 0.6);
    outline-offset: 2px;
}

.chevron-icon {
    font-size: 0; /* Hide the text character */
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(108, 117, 125, 0.1);
    cursor: pointer;
    position: relative;
}

.chevron-icon:hover {
    background: rgba(108, 117, 125, 0.2);
    transform: scale(1.05);
}

.chevron-icon::before {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #6c757d;
    border-bottom: 2px solid #6c757d;
    transform: rotate(45deg);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.chevron-icon.rotated::before {
    transform: rotate(225deg);
}

.accordion-content {
    background: white;
    overflow: hidden;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
}

.accordion-content.expanded {
    max-height: 2000px;
    opacity: 1;
    padding-bottom: 20px;
}

/* Topic View Controls */
.topic-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.view-controls {
    display: flex;
    gap: 8px;
}

.view-controls .btn {
    font-size: 12px;
    padding: 4px 12px;
}

.clear-actions {
    display: flex;
    gap: 8px;
}

.clear-actions .btn {
    font-size: 12px;
    padding: 4px 12px;
}

/* Selected Topics Chips */
.selected-topics-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 400px;
    overflow-x: auto;
    padding: 4px 0;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    gap: 4px;
    border: 1px solid #2563eb;
}

.topic-chip-close {
    background: none;
    border: none;
    color: #1e40af;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 200ms ease;
}

.topic-chip-close:hover {
    background: rgba(30, 64, 175, 0.2);
    color: #1e3a8a;
}

/* Checkbox Styling for Topics */
.topic-checkbox-item {
    display: flex;
    align-items: center;
    margin: 2px 0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms ease;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.topic-checkbox-item:hover {
    background: #e0f2fe;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.topic-checkbox-item.selected {
    background: #dbeafe;
    border-color: #2563eb;
    color: #1e40af;
}

.topic-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.topic-checkbox:checked {
    background: #2563eb;
    border-color: #2563eb;
}

.topic-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.topic-checkbox:focus {
    outline: 2px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

.topic-label {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

/* Topic detail checkbox styling */
.topic-detail-checkbox-item {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 12px;
    border-bottom: solid 1px #e2e8f0;
    transition: all 200ms ease;
}

.topic-detail-checkbox-item:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.topic-detail-checkbox-item.selected {
    background-color: rgba(37, 99, 235, 0.1);
}

.topic-detail-content {
    flex: 1;
    margin-left: 10px;
}

.topic-title {
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 4px;
}

.topic-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.topic-terms .badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .accordion-header {
        padding: 12px 16px;
    }

    .accordion-title-text {
        font-size: 18px;
    }

    .accordion-controls {
        gap: 8px;
    }

    .plot-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .selection-counter {
        padding: 3px 8px;
        font-size: 12px;
    }

    .topic-view-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .selection-actions {
        justify-content: center;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .accordion-controls {
        flex-wrap: wrap;
        gap: 6px;
    }

    .plot-button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Search highlighting */
mark {
    background: transparent;
    color: inherit;
    font-weight: bold;
    padding: 0;
}
