/* public/css/console/copilot/_feed.css */
/* Contains styles for message bubbles, interactive options, and feed layout. */

/* --- UNIVERSAL CHAT BUBBLE STYLES --- */
.chat-bubble-universal {
    padding: 3px 5px; /* 3px between font and outline */
    border-radius: 1rem;
    font-size: 0.7rem;
    line-height: 1.4;
    word-break: break-word;
    display: inline-block;
    max-width: 100%;
}

.chat-bubble-user {
    background-color: var(--color-active-highlight);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble-ai, .chat-bubble-them {
    background-color: #374151;
    color: var(--color-text-primary, #f3f4f6);
    border-bottom-left-radius: 0.25rem;
}

/* Legacy class - override to use solid background for consistency */
.chat-bubble-system {
    background-color: #27272a !important;
    color: #4ade80 !important;
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-style: italic;
    border-left: 3px solid #22c55e;
}

/* Base resets for containers */
.chat-feed {
    position: absolute;
    top: 0;
    left: 48px; /* Offset by sidebar width */
    width: calc(100% - 48px);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px; /* 5px between message bubbles */
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
}

.chat-feed.active {
    opacity: 1;
    pointer-events: auto;
}

.copilot-message-wrapper { 
    display: flex; 
    max-width: 100%; 
    width: 100%;
    margin-bottom: 5px; /* 5px between bubbles */
    padding: 0;
}

.copilot-message { 
    padding: 0.25rem 0.375rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    line-height: 1.4;
    word-break: break-word;
    display: block; /* Force block to allow full width text stretching */
    width: 100%;
    max-width: 100%;
}

.copilot-message-raw {
    display: inline-block;
    max-width: 100%;
}

/* Jukebot Compact Search Results Styling */
.jukebot-search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    font-size: 0.75rem;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
}

.jukebot-search-results * {
    color: #ffffff !important;
}

.jukebot-search-header {
    font-weight: 600;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.jukebot-search-artist-group {
    border-radius: 0.5rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background-color: rgba(50, 50, 50, 0.8) !important;
}

/* Tag match highlight - songs that matched via tag search */
.jukebot-search-results .tag-match-highlight {
    background-color: rgba(74, 222, 128, 0.25) !important;
    border-left: 3px solid #4ade80 !important;
}

.jukebot-search-results .tag-match-highlight .jukebot-play-btn {
    color: #4ade80 !important;
    transform: scale(1.2);
}

.jukebot-search-artist-group.search-row-alt-1 {
    background-color: rgba(80, 80, 80, 0.8) !important;
}

.jukebot-search-artist-group.search-row-alt-2 {
    background-color: rgba(60, 60, 60, 0.8) !important;
}

.jukebot-search-artist-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.jukebot-search-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.jukebot-search-artist-name {
    font-weight: 600;
}

.jukebot-search-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

.jukebot-search-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.jukebot-search-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.jukebot-search-play-icon {
    font-size: 0.6rem;
    color: #4ade80;
    min-width: 12px;
}

.jukebot-search-add-icon {
    font-size: 0.7rem;
    color: #ffffff;
    margin-left: auto;
    padding: 0.15rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.jukebot-search-add-icon:hover {
    color: #60a5fa;
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.jukebot-search-item-title {
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wrapper-user { 
    justify-content: flex-end; 
    align-self: flex-end; 
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
}

.bubble-user { 
    background-color: var(--color-active-highlight);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.wrapper-ai, .wrapper-thinking, .wrapper-system { 
    justify-content: flex-start; 
    align-self: flex-start; 
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
}

.wrapper-system {
    justify-content: center;
}

.bubble-ai, .bubble-thinking { 
    background-color: #374151;
    color: var(--color-text-primary, #f3f4f6);
    border-bottom-left-radius: 0.25rem;
}

.copilot-options-container {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background-color: #374151;
    border-radius: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #4b5563;
}

.copilot-option-btn {
    background-color: #4b5563;
    color: #d1d5db;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
    cursor: pointer;
    text-align: left;
    font-size: 0.7rem;
    transition: background-color 0.2s, color 0.2s, filter 0.2s;
}

.copilot-option-btn.highlighted {
    filter: brightness(1.25);
    color: white;
}

@keyframes thinking-blink { 
    0%, 100% { opacity: 0.2; } 
    50% { opacity: 1; } 
}

.thinking-dot { 
animation: thinking-blink 1.4s infinite both; 
font-size: 1.5rem; 
line-height: 0; 
}

.thinking-dot:nth-child(2) { 
animation-delay: 0.2s; 
}

.thinking-dot:nth-child(3) { 
animation-delay: 0.4s; 
}

/* --- New styles for system notifications in the feed --- */
/* Updated to match jukebot notification style with solid background for readability */
.bubble-system {
    background-color: #27272a !important;
    color: #a7f3d0 !important;
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem !important;
    font-style: italic;
    font-size: 0.65rem !important;
    display: block !important;
    width: 100%;
    max-width: 100%;
    word-break: break-word;
    border-left: 3px solid #22c55e !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    white-space: normal;
}

.system-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.7rem; 
    line-height: 1.4;
    padding: 0;
    background: transparent !important;
    color: #4ade80 !important;
    width: 100%;
    flex-wrap: wrap;
}

/* Specific borders based on content type */
.wrapper-system:has(.type-success) .bubble-system {
    border: 1px solid #4ade80 !important;
}

.wrapper-system:has(.type-success) .system-notification-content {
    color: #4ade80 !important;
}

/* Alert/Error notification (Red border) */
.wrapper-system:has(.type-alert) .bubble-system {
    border: 1px solid #f87171 !important;
}

.wrapper-system:has(.type-alert) .system-notification-content {
    color: #f87171 !important;
}

/* Info notification (Now Green by default) */
.wrapper-system:has(.type-info) .bubble-system {
    border: 1px solid #4ade80 !important;
}

.wrapper-system:has(.type-info) .system-notification-content {
    color: #4ade80 !important;
}

.system-notification-content.type-success { color: #4ade80 !important; }
.system-notification-content.type-alert { color: #f87171 !important; }
.system-notification-content.type-info { color: #4ade80 !important; }
.system-notification-content.type-warning { color: #fbbf24 !important; }

/* Warning notification (Yellow border) */
.wrapper-system:has(.type-warning) .bubble-system {
    border: 1px solid #fbbf24 !important;
}

.wrapper-system:has(.type-warning) .system-notification-content {
    color: #fbbf24 !important;
}

/* --- Artist Name Setup Inside Feed --- */
.artist-name-setup-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #1f2937;
    border-radius: 0.5rem;
    border: 1px solid #374151;
    max-width: 100%;
}

.artist-name-setup-container .name-setup-options {
    display: flex;
    gap: 0.5rem;
}

.artist-name-setup-container .name-setup-option-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
}

.artist-name-setup-container .name-setup-option-btn:hover {
    background-color: #4b5563;
    border-color: var(--color-active-highlight);
}

.artist-name-setup-container .name-setup-option-btn i {
    font-size: 1.25rem;
    color: var(--color-active-highlight);
}

.artist-name-setup-container .vibe-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.artist-name-setup-container .vibe-section label {
    font-size: 0.65rem;
    color: #9ca3af;
}

/* --- NEW: Segmented Toggle Control (replaces checkbox toggle) --- */
.artist-name-setup-container .name-type-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.artist-name-setup-container .name-type-toggle .toggle-label {
    display: none; /* Hide the checkbox */
}

.artist-name-setup-container .toggle-segmented {
    display: flex;
    background-color: #374151;
    border-radius: 0.35rem;
    padding: 2px;
    gap: 2px;
}

.artist-name-setup-container .toggle-segmented .toggle-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.65rem;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.artist-name-setup-container .toggle-segmented .toggle-btn:hover:not(.active) {
    color: #d1d5db;
    background-color: rgba(255, 255, 255, 0.05);
}

.artist-name-setup-container .toggle-segmented .toggle-btn.active {
    background-color: var(--color-active-highlight);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.artist-name-setup-container .suggestions-area {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.artist-name-setup-container .suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: #9ca3af;
}

.artist-name-setup-container .refresh-btn {
    background: none;
    border: none;
    color: var(--color-active-highlight);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.25rem;
    transition: transform 0.2s ease;
}

.artist-name-setup-container .refresh-btn:hover {
    transform: rotate(180deg);
}

.artist-name-setup-container .suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.artist-name-setup-container .suggestion-item {
    padding: 0.3rem 0.6rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.25rem;
    color: #d1d5db;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.artist-name-setup-container .suggestion-item:hover {
    background-color: #4b5563;
    border-color: var(--color-active-highlight);
}

.artist-name-setup-container .suggestion-item.selected {
    background-color: var(--color-active-highlight);
    border-color: #fff;
    color: white;
}

.artist-name-setup-container .manual-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.artist-name-setup-container .manual-section label {
    font-size: 0.65rem;
    color: #9ca3af;
}

.artist-name-setup-container .name-setup-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
    border-top: 1px solid #374151;
}

.artist-name-setup-container .modal-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.artist-name-setup-container .hidden {
    display: none !important;
}

/* Personality options in onboarding */
.personality-options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.personality-option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    background: var(--color-surface-elevated, #2d3748);
    border: 1px solid var(--color-border, #4a5568);
    border-radius: 8px;
    color: var(--color-text-primary, #e2e8f0);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.personality-option-btn:hover {
    background: var(--color-active-highlight, #4a5568);
    border-color: var(--color-accent, #6366f1);
    transform: translateY(-1px);
}

.personality-option-btn.highlighted {
    background: var(--color-active-highlight, #4a5568);
    border-color: var(--color-accent, #6366f1);
}

.personality-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.personality-desc {
    font-size: 0.75rem;
    color: var(--color-text-secondary, #a0aec0);
}

/* --- Artist Name + Font Selector Styles (Smaller) --- */
.artist-name-setup-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background-color: rgba(31, 41, 55, 0.95);
    border-radius: 6px;
    margin: 4px 0;
    max-width: 100%;
}

.artist-name-setup-container .name-font-header {
    text-align: center;
}

.artist-name-setup-container .name-font-header label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-primary, #f3f4f6);
}

.artist-name-setup-container .name-input-section {
    width: 100%;
}

.artist-name-setup-container .name-input-section input {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.75rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 4px;
    color: white;
    text-align: center;
}

.artist-name-setup-container .name-input-section input:focus {
    outline: none;
    border-color: var(--color-active-highlight, #60a5fa);
}

.artist-name-setup-container .font-preview-section {
    width: 100%;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    text-align: center;
}

.artist-name-setup-container .font-preview {
    font-size: 1rem;
    color: var(--color-text-primary, #f3f4f6);
    word-break: break-word;
    line-height: 1.2;
}

.artist-name-setup-container .font-grid-section {
    width: 100%;
}

.artist-name-setup-container .font-grid-label {
    font-size: 0.6rem;
    color: var(--color-text-secondary, #a0aec0);
    margin-bottom: 4px;
    display: block;
}

.artist-name-setup-container .font-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    justify-items: center;
}

/* Numbered square font options - smaller 2x */
.artist-name-setup-container .font-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.artist-name-setup-container .font-option:hover {
    border-color: #60a5fa;
    background-color: #374151;
}

.artist-name-setup-container .font-option.selected {
    border-color: #60a5fa;
    background-color: #3b82f6;
}

.artist-name-setup-container .font-option .font-number {
    font-size: 0.6rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.artist-name-setup-container .font-option .font-sample,
.artist-name-setup-container .font-option .font-label {
    display: none;
}

.artist-name-setup-container .name-setup-actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

.artist-name-setup-container .modal-confirm-btn {
    padding: 6px 16px;
    background-color: var(--color-active-highlight, #60a5fa);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.artist-name-setup-container .modal-confirm-btn:hover:not(:disabled) {
    background-color: #3b82f6;
}

.artist-name-setup-container .modal-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
