/* ============================================================================
   ANALYSIS CONTENT - Genres & Themes
   ============================================================================ */

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.analysis-content.editable {
    cursor: default !important;
    background: rgba(0, 0, 0, 0.3);
}

.analysis-content {
    pointer-events: auto !important;
}

/* Empty state */
.analysis-empty,
.single-result-empty {
    color: #858585;
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}

/* Analysis lines */
.analysis-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(45, 45, 48, 0.5);
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    min-height: 36px;
    animation: analysisLineAppear 0.3s ease-out backwards;
}

.analysis-line:hover {
    background: rgba(55, 55, 61, 0.7);
    transform: translateX(4px);
}

/* Staggered animation */
.analysis-content .analysis-line:nth-child(1) { animation-delay: 0.05s; }
.analysis-content .analysis-line:nth-child(2) { animation-delay: 0.1s; }
.analysis-content .analysis-line:nth-child(3) { animation-delay: 0.15s; }
.analysis-content .analysis-line:nth-child(4) { animation-delay: 0.2s; }
.analysis-content .analysis-line:nth-child(5) { animation-delay: 0.25s; }

@keyframes analysisLineAppear {
    0% {
        opacity: 0;
        transform: translateX(-15px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Top-1 highlighting */
.analysis-content .analysis-line:first-child {
    border-left-width: 4px;
    background: rgba(78, 201, 176, 0.05);
}

.genre-analysis .analysis-line:first-child {
    background: rgba(244, 135, 113, 0.08);
}

.theme-analysis .analysis-line:first-child {
    background: rgba(206, 145, 120, 0.08);
}

.analysis-content .analysis-line:first-child:hover {
    background: rgba(78, 201, 176, 0.12);
    transform: translateX(6px);
}

.genre-analysis .analysis-line:first-child:hover {
    background: rgba(244, 135, 113, 0.15);
}

.theme-analysis .analysis-line:first-child:hover {
    background: rgba(206, 145, 120, 0.15);
}

/* Links */
.analysis-link {
    color: #569cd6 !important;
    text-decoration: none !important;
    font-weight: 600;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer !important;
    flex: 1;
    padding: 4px 0;
    pointer-events: auto !important;
}

.analysis-link::after {
    content: '↗';
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.analysis-link:hover {
    color: #7db3e8 !important;
    text-decoration: none !important;
}

.analysis-link:hover::after {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Genre link */
.genre-link {
    color: #f48771;
}

.genre-link:hover {
    color: #ff9a85;
    background: rgba(244, 135, 113, 0.15);
    text-shadow: 0 0 8px rgba(244, 135, 113, 0.4);
}

/* Theme link */
.theme-link {
    color: #ce9178;
}

.theme-link:hover {
    color: #dda88c;
    background: rgba(206, 145, 120, 0.15);
    text-shadow: 0 0 8px rgba(206, 145, 120, 0.4);
}

/* Visited links */
.analysis-link:visited {
    color: #8b7db3 !important;
}

.genre-link:visited {
    color: #d4756b !important;
}

.theme-link:visited {
    color: #b8826d !important;
}

/* Text without link */
.single-result-text {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #cccccc;
}

/* Name in link */
.genre-name,
.theme-name {
    display: inline-block;
}

/* Name without link */
.analysis-name {
    color: #cccccc;
    font-weight: 500;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    flex: 1;
}

/* Percentages */
.analysis-percentage {
    color: #4ec9b0;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    min-width: 65px;
    text-align: right;
    background: rgba(78, 201, 176, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(78, 201, 176, 0.3);
}

/* ============================================================================
   SINGLE RESULT - Genre & Theme (Collapsed State)
   ============================================================================ */

.single-result {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    animation: singleResultAppear 0.4s ease-out;
}

@keyframes singleResultAppear {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Track name line */
.single-result-line {
    font-size: 0.8rem;
    color: #9cdcfe;
    font-family: 'Consolas', 'Courier New', monospace;
    line-height: 1.3;
}

.single-result-track {
    color: #cccccc;
}

/* Analysis result line (genre/theme name + percentage) */
.single-result-analysis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
}

/* Name or link */
.single-result-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e6edf3;
    font-family: 'Consolas', 'Courier New', monospace;
    flex: 1;
}

.single-result-link {
    color: #569cd6;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Consolas', 'Courier New', monospace;
    transition: all 0.2s ease;
    cursor: pointer;
    pointer-events: auto;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.single-result-link::after {
    content: '↗';
    font-size: 0.7rem;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.single-result-link:hover {
    color: #7db3e8;
}

.single-result-link:hover::after {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Genre link styling */
.genre-link {
    color: #f48771;
}

.genre-link:hover {
    color: #ff9a85;
}

/* Theme link styling */
.theme-link {
    color: #ce9178;
}

.theme-link:hover {
    color: #dda88c;
}

/* Percentage badge */
.single-result-percentage {
    font-size: 0.75rem;
    color: #4ec9b0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    background: rgba(78, 201, 176, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(78, 201, 176, 0.3);
    white-space: nowrap;
}

/* Empty state */
.single-result-empty {
    color: #858585;
    font-style: italic;
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
}

/* ============================================================================
   EDITABLE ANALYSIS - Input controls for Genre & Theme editing
   ============================================================================ */

.editable-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(45, 45, 48, 0.6);
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    min-height: 36px;
}

.editable-line:hover {
    background: rgba(55, 55, 61, 0.8);
}

.editable-line:first-child {
    border-left-width: 4px;
    background: rgba(78, 201, 176, 0.08);
}

.genre-analysis .editable-line:first-child {
    background: rgba(244, 135, 113, 0.1);
}

.theme-analysis .editable-line:first-child {
    background: rgba(206, 145, 120, 0.1);
}

/* Controls section with input and arrows */
.editable-controls-section {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(78, 201, 176, 0.15);
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid rgba(78, 201, 176, 0.3);
}

.genre-analysis .editable-controls-section {
    background: rgba(244, 135, 113, 0.15);
    border-color: rgba(244, 135, 113, 0.3);
}

.theme-analysis .editable-controls-section {
    background: rgba(206, 145, 120, 0.15);
    border-color: rgba(206, 145, 120, 0.3);
}

/* Arrow buttons */
.percentage-arrow-btn {
    width: 20px;
    height: 20px;
    background: rgba(78, 201, 176, 0.2);
    border: 1px solid rgba(78, 201, 176, 0.4);
    border-radius: 3px;
    color: #4ec9b0;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.percentage-arrow-btn:hover {
    background: rgba(78, 201, 176, 0.4);
    border-color: #4ec9b0;
    transform: scale(1.1);
}

.percentage-arrow-btn:active {
    transform: scale(0.95);
}

.genre-analysis .percentage-arrow-btn {
    background: rgba(244, 135, 113, 0.2);
    border-color: rgba(244, 135, 113, 0.4);
    color: #f48771;
}

.genre-analysis .percentage-arrow-btn:hover {
    background: rgba(244, 135, 113, 0.4);
    border-color: #f48771;
}

.theme-analysis .percentage-arrow-btn {
    background: rgba(206, 145, 120, 0.2);
    border-color: rgba(206, 145, 120, 0.4);
    color: #ce9178;
}

.theme-analysis .percentage-arrow-btn:hover {
    background: rgba(206, 145, 120, 0.4);
    border-color: #ce9178;
}

/* Percentage input field */
.analysis-percentage-input {
    width: 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(78, 201, 176, 0.3);
    border-radius: 3px;
    padding: 2px 4px;
    color: #4ec9b0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: right;
    outline: none;
    transition: all 0.2s ease;
}

.analysis-percentage-input:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: #4ec9b0;
    box-shadow: 0 0 0 2px rgba(78, 201, 176, 0.2);
}

.analysis-percentage-input:hover {
    border-color: rgba(78, 201, 176, 0.5);
}

.genre-analysis .analysis-percentage-input {
    border-color: rgba(244, 135, 113, 0.3);
    color: #f48771;
}

.genre-analysis .analysis-percentage-input:focus {
    border-color: #f48771;
    box-shadow: 0 0 0 2px rgba(244, 135, 113, 0.2);
}

.genre-analysis .analysis-percentage-input:hover {
    border-color: rgba(244, 135, 113, 0.5);
}

.theme-analysis .analysis-percentage-input {
    border-color: rgba(206, 145, 120, 0.3);
    color: #ce9178;
}

.theme-analysis .analysis-percentage-input:focus {
    border-color: #ce9178;
    box-shadow: 0 0 0 2px rgba(206, 145, 120, 0.2);
}

.theme-analysis .analysis-percentage-input:hover {
    border-color: rgba(206, 145, 120, 0.5);
}

/* Remove spinner arrows from number input */
.analysis-percentage-input::-webkit-inner-spin-button,
.analysis-percentage-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.analysis-percentage-input[type=number] {
    -moz-appearance: textfield;
}

/* Percentage symbol */
.percentage-symbol {
    color: #4ec9b0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: -2px;
}

.genre-analysis .percentage-symbol {
    color: #f48771;
}

.theme-analysis .percentage-symbol {
    color: #ce9178;
}

/* ============================================================================ */
/* BADGE STYLES - Collapsed view with top-4 items                              */
/* ============================================================================ */

/* Badge container */
.badge-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
}

/* Individual badge item */
.badge-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 2.5px 0;
    background: transparent;
    border-radius: 0;
    border-left: none;
    transition: opacity 0.2s ease;
    min-height: auto;
}

.badge-item:hover {
    background: transparent;
    transform: none;
    opacity: 0.8;
}

/* Top-1 highlighting - removed */
.badge-container .badge-item:first-child {
    border-left-width: 0;
    background: transparent;
}

.genre-badge-container .badge-item:first-child {
    background: transparent;
}

.theme-badge-container .badge-item:first-child {
    background: transparent;
}

/* Badge content */
.badge-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

/* Badge name/link */
.badge-link,
.badge-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: #cccccc;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
    white-space: normal;
}

.badge-link:hover {
    color: #7db3e8;
    text-decoration: underline;
}

.genre-badge-item .badge-link,
.genre-badge-item .badge-name {
    color: #eaecf0;
}

.theme-badge-item .badge-link,
.theme-badge-item .badge-name {
    color: #eaecf0;
}

/* Badge percentage */
.badge-percentage {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #c8ccd1;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    white-space: nowrap;
    min-width: auto;
    text-align: right;
    flex-shrink: 0;
}

/* Badge controls (for editable analysis) */
.badge-controls {
    display: none; /* Hide controls in collapsed view */
}

/* Badge arrow buttons */
.badge-arrow-btn {
    width: 16px;
    height: 16px;
    background: rgba(78, 201, 176, 0.2);
    border: 1px solid rgba(78, 201, 176, 0.4);
    border-radius: 2px;
    color: #4ec9b0;
    font-size: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.badge-arrow-btn:hover {
    background: rgba(78, 201, 176, 0.4);
    border-color: #4ec9b0;
    transform: scale(1.1);
}

.badge-arrow-btn:active {
    transform: scale(0.95);
}

.genre-badge-item .badge-arrow-btn {
    background: rgba(244, 135, 113, 0.2);
    border-color: rgba(244, 135, 113, 0.4);
    color: #f48771;
}

.genre-badge-item .badge-arrow-btn:hover {
    background: rgba(244, 135, 113, 0.4);
    border-color: #f48771;
}

.theme-badge-item .badge-arrow-btn {
    background: rgba(206, 145, 120, 0.2);
    border-color: rgba(206, 145, 120, 0.4);
    color: #ce9178;
}

.theme-badge-item .badge-arrow-btn:hover {
    background: rgba(206, 145, 120, 0.4);
    border-color: #ce9178;
}

/* Badge percentage input */
.badge-percentage-input {
    width: 35px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(78, 201, 176, 0.3);
    border-radius: 2px;
    padding: 1px 3px;
    color: #4ec9b0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: right;
    outline: none;
    transition: all 0.2s ease;
    height: 18px;
}

.badge-percentage-input:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: #4ec9b0;
    box-shadow: 0 0 0 2px rgba(78, 201, 176, 0.2);
}

.badge-percentage-input:hover {
    border-color: rgba(78, 201, 176, 0.5);
}

.genre-badge-item .badge-percentage-input {
    border-color: rgba(244, 135, 113, 0.3);
    color: #f48771;
}

.genre-badge-item .badge-percentage-input:focus {
    border-color: #f48771;
    box-shadow: 0 0 0 2px rgba(244, 135, 113, 0.2);
}

.genre-badge-item .badge-percentage-input:hover {
    border-color: rgba(244, 135, 113, 0.5);
}

.theme-badge-item .badge-percentage-input {
    border-color: rgba(206, 145, 120, 0.3);
    color: #ce9178;
}

.theme-badge-item .badge-percentage-input:focus {
    border-color: #ce9178;
    box-shadow: 0 0 0 2px rgba(206, 145, 120, 0.2);
}

.theme-badge-item .badge-percentage-input:hover {
    border-color: rgba(206, 145, 120, 0.5);
}

/* Remove spinner arrows from number input */
.badge-percentage-input::-webkit-inner-spin-button,
.badge-percentage-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.badge-percentage-input[type=number] {
    -moz-appearance: textfield;
}

/* ============================================================================
   CLICKABLE ANALYSIS LINKS - Matching artist link style
   ============================================================================ */

/* ============================================================================
   CLICKABLE ANALYSIS LINKS - Matching artist link style
   ============================================================================ */

.collapsed-analysis-link {
    color: #569cd6;
    text-decoration: none;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.6rem;
    transition: color 0.2s ease;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.collapsed-analysis-link:hover {
    color: #7db3e8;
    text-decoration: underline;
}

.genre-analysis .collapsed-analysis-link {
    color: #f48771;
}

.genre-analysis .collapsed-analysis-link:hover {
    color: #ff9a85;
}

.theme-analysis .collapsed-analysis-link {
    color: #ce9178;
}

.theme-analysis .collapsed-analysis-link:hover {
    color: #dda88c;
}

/* ============================================================================
   CLICKABLE ANALYSIS LINES - For genre/theme cards with links
   ============================================================================ */

/* ============================================================================
   CLICKABLE ANALYSIS LINES - For genre/theme cards with links
   ============================================================================ */

.collapsed-analysis-line[data-has-link="true"] {
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.6rem;
    padding: 0 2px;
    height: 20%;
    flex-shrink: 0;
    flex-grow: 0;
}

.collapsed-analysis-line[data-has-link="true"]:hover {
    background-color: rgba(86, 156, 214, 0.08);
}

.collapsed-analysis-line[data-has-link="true"]:active {
    background-color: rgba(86, 156, 214, 0.12);
    transform: translateY(1px);
}

.genre-analysis .collapsed-analysis-line[data-has-link="true"]:hover {
    background-color: rgba(244, 135, 113, 0.08);
}

.theme-analysis .collapsed-analysis-line[data-has-link="true"]:hover {
    background-color: rgba(206, 145, 120, 0.08);

/* ============================================================================
   EDITABLE PERCENTAGES IN COLLAPSED VIEW
   ============================================================================ */

/* Editable percentage styling */
.collapsed-analysis-percentage.editable {
    cursor: ns-resize;
    padding: 2px 4px;
    border-radius: 2px;
    background: rgba(78, 201, 176, 0.1);
    border: 1px solid rgba(78, 201, 176, 0.2);
    transition: all 0.2s ease;
    user-select: none;
}

.collapsed-analysis-percentage.editable:hover {
    background: rgba(78, 201, 176, 0.2);
    border-color: rgba(78, 201, 176, 0.4);
    color: #4ec9b0;
}

.collapsed-analysis-percentage.editable.dragging {
    background: rgba(78, 201, 176, 0.3);
    border-color: #4ec9b0;
    color: #4ec9b0;
    box-shadow: 0 0 0 2px rgba(78, 201, 176, 0.3);
}

/* Input for editing percentage in collapsed view */
.collapsed-percentage-input {
    width: 45px;
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(78, 201, 176, 0.5);
    border-radius: 2px;
    padding: 2px 4px;
    color: #4ec9b0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-align: right;
    outline: none;
    box-shadow: 0 0 0 2px rgba(78, 201, 176, 0.3);
}

.collapsed-percentage-input::-webkit-inner-spin-button,
.collapsed-percentage-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.collapsed-percentage-input[type=number] {
    -moz-appearance: textfield;
}
}