/* Global Styles */
:root {
    --primary-color: #1DB954;
    --primary-hover: #1ed760;
    --secondary-color: #191414;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-light: #e0e0e0;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Dark mode colors */
[data-theme="dark"] {
    --primary-color: #1DB954;
    --secondary-color: #191414;
    --text-color: #e0e0e0;
    --light-bg: #1a1a1a;
    --border-color: #333333;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    
    --bg-primary: #2d2d2d;
    --bg-secondary: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-light: #333333;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Minimal mode colors */
[data-theme="minimal"] {
    --primary-color: #111111;
    --primary-hover: #000000;
    --secondary-color: #111111;
    --text-color: #111111;
    --light-bg: #ffffff;
    --border-color: rgba(17, 17, 17, 0.18);
    --shadow: none;
    --transition: all 0.2s ease;

    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --text-primary: #111111;
    --text-secondary: rgba(17, 17, 17, 0.70);
    --text-tertiary: rgba(17, 17, 17, 0.55);
    --border-light: rgba(17, 17, 17, 0.18);
    --shadow-light: none;

    --accent-color: #111111;
    --accent-hover: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-width: 800px;
    overflow-x: auto;
    overflow-y: hidden;
}

[data-theme="minimal"] body {
    font-family: 'Courier Prime', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: 0.01em;
}

.btn,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    font-family: 'Courier Prime', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
}

/* Header */
header {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    min-height: 50px;
    max-height: 50px;
    position: relative;
    z-index: 100;
}

[data-theme="minimal"] header {
    box-shadow: none;
}

header h1 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

/* Tree controls in layout section */
.layout-controls .mode-btn {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin-left: 0.25rem;
}

.layout-controls .mode-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
}

.layout-controls .mode-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.layout-controls .mode-btn.active:hover {
    background-color: var(--primary-hover);
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Unified Header Button Styles */
.btn {
    padding: 0.4rem 0.8rem;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    backdrop-filter: blur(10px);
    font-family: 'Courier Prime', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

[data-theme="minimal"] .btn {
    backdrop-filter: none;
    border-width: 1px;
    border-color: var(--border-color);
    border-radius: 10px;
    box-shadow: none;
    transform: none;
}

[data-theme="minimal"] .btn:hover {
    transform: none;
    box-shadow: none;
}

/* Spotify Button - Green Theme */
.btn-spotify {
    background: rgba(29, 185, 84, 0.9);
    color: white;
    border-color: rgba(29, 185, 84, 0.3);
}

.btn-spotify:hover {
    background: rgba(29, 185, 84, 1);
    border-color: rgba(29, 185, 84, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

/* YouTube Button - Red Theme */
.btn-youtube {
    background: rgba(255, 0, 0, 0.9);
    color: white;
    border-color: rgba(255, 0, 0, 0.3);
}

.btn-youtube:hover {
    background: rgba(255, 0, 0, 1);
    border-color: rgba(255, 0, 0, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* Text Playlist Button - Purple Theme */
.btn-text-playlist {
    background: rgba(138, 43, 226, 0.9);
    color: white;
    border-color: rgba(138, 43, 226, 0.3);
}

.btn-text-playlist:hover {
    background: rgba(138, 43, 226, 1);
    border-color: rgba(138, 43, 226, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

/* Logout Button - Warning Theme */
.btn-warning {
    background: rgba(243, 156, 18, 0.9);
    color: white;
    border-color: rgba(243, 156, 18, 0.3);
    margin-left: 10px;
}

.btn-warning:hover {
    background: rgba(243, 156, 18, 1);
    border-color: rgba(243, 156, 18, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

/* Primary Button - Theme Aware */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="minimal"] .btn-primary {
    background: #111111;
    border-color: #111111;
}

[data-theme="minimal"] .btn-primary:hover {
    background: #000000;
    border-color: #000000;
}

[data-theme="minimal"] .btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

[data-theme="minimal"] .btn-secondary:hover {
    background: rgba(17, 17, 17, 0.04);
}

[data-theme="minimal"] .btn-spotify,
[data-theme="minimal"] .btn-youtube,
[data-theme="minimal"] .btn-warning,
[data-theme="minimal"] .btn-text-playlist {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: none;
}

[data-theme="minimal"] .btn-spotify:hover,
[data-theme="minimal"] .btn-youtube:hover,
[data-theme="minimal"] .btn-warning:hover,
[data-theme="minimal"] .btn-text-playlist:hover {
    background: rgba(17, 17, 17, 0.04);
    border-color: rgba(17, 17, 17, 0.28);
}

[data-theme="minimal"] .btn-icon {
    color: var(--text-primary);
}

[data-theme="minimal"] #theme-toggle,
[data-theme="minimal"] .btn-settings {
    background: transparent;
    border: 1px solid var(--border-color);
    box-shadow: none;
    backdrop-filter: none;
}

[data-theme="minimal"] #theme-toggle:hover,
[data-theme="minimal"] .btn-settings:hover {
    background: rgba(17, 17, 17, 0.04);
    border-color: rgba(17, 17, 17, 0.28);
    box-shadow: none;
}

[data-theme="minimal"] #share-tree {
    background: #111111 !important;
    color: #ffffff !important;
    border-color: #111111 !important;
    box-shadow: none !important;
}

[data-theme="minimal"] #share-tree:hover {
    background: #000000 !important;
    border-color: #000000 !important;
    box-shadow: none !important;
    transform: none !important;
}

[data-theme="minimal"] .tree-tag,
[data-theme="minimal"] .preview-tag {
    background: rgba(17, 17, 17, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="minimal"] :focus {
    outline: none;
}

[data-theme="minimal"] :focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.18);
}

[data-theme="minimal"] .community-search:focus,
[data-theme="minimal"] .form-group input:focus,
[data-theme="minimal"] .form-group textarea:focus,
[data-theme="minimal"] .link-copy-group input:focus {
    border-color: rgba(17, 17, 17, 0.45);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.14);
}

[data-theme="minimal"] .source-artist-section h4 {
    color: var(--text-primary);
}

[data-theme="minimal"] .source-artist-section hr {
    border-top-color: rgba(17, 17, 17, 0.28);
}

[data-theme="minimal"] .recommendations-slider::-webkit-scrollbar-thumb {
    background: rgba(17, 17, 17, 0.35);
}

[data-theme="minimal"] .recommendations-slider::-webkit-scrollbar-track {
    background: rgba(17, 17, 17, 0.06);
}

[data-theme="minimal"] .genre-tag:hover {
    background-color: rgba(17, 17, 17, 0.04);
    transform: none;
    box-shadow: none;
}

[data-theme="minimal"] .panel-resize-handle:hover {
    background: rgba(17, 17, 17, 0.12);
}

[data-theme="minimal"] .explore-btn:hover {
    background-color: rgba(17, 17, 17, 0.04);
    color: var(--text-primary);
}

[data-theme="minimal"] .close-modal:hover,
[data-theme="minimal"] #text-playlist-modal .close-modal:hover {
    background: rgba(17, 17, 17, 0.04);
    color: var(--text-primary);
    transform: none;
}

[data-theme="minimal"] .track-number {
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

/* Light mode primary button adjustments */
[data-theme="light"] .btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="light"] .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.2);
}

/* Dark mode primary button */
[data-theme="dark"] .btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

/* Specific Share Tree Button Fix for Light Mode */
#share-tree {
    background: #1DB954 !important;
    color: white !important;
    border: 2px solid #1DB954 !important;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#share-tree:hover {
    background: #1ed760 !important;
    border-color: #1ed760 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3) !important;
}

/* Ensure Share Tree button is visible in both themes */
[data-theme="light"] #share-tree {
    background: #1DB954 !important;
    color: white !important;
    border-color: #1DB954 !important;
}

[data-theme="light"] #share-tree:hover {
    background: #1ed760 !important;
    border-color: #1ed760 !important;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.2) !important;
}

[data-theme="dark"] #share-tree {
    background: #1DB954 !important;
    color: white !important;
    border-color: #1DB954 !important;
}

[data-theme="dark"] #share-tree:hover {
    background: #1ed760 !important;
    border-color: #1ed760 !important;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4) !important;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
}

/* Theme Toggle - Light Mode Default */
#theme-toggle {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
}

#theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark mode theme toggle hover */
[data-theme="dark"] #theme-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #theme-toggle {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}



[data-theme="dark"] #theme-toggle i::before {
    content: "\f185"; /* fa-sun */
}

/* Settings Button - Light Mode Default */
.btn-settings {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
}

.btn-settings:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .btn-settings {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .btn-settings:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Light mode styles are now handled by the default CSS variables */

/* Tree Card Styles */
.tree-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tree-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.tree-card-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.tree-card-preview {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
}

.mini-tree-snapshot {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-tree-snapshot svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mini-tree-placeholder {
    font-size: 1.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.tree-card-info {
    flex: 1;
    min-width: 0;
}

.tree-card-header {
    margin-bottom: 0.5rem;
}

.tree-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.tree-card-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tree-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tree-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

.tree-tag {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.tree-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.75rem 0 0.5rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tree-stats {
    display: flex;
    gap: 1rem;
}

.tree-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tree-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.tree-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-tree-action {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tree-action:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Dark mode tree card adjustments */
[data-theme="dark"] .tree-card {
    background: var(--bg-secondary);
    border-color: #444;
}

[data-theme="dark"] .tree-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tree-card-preview {
    background: var(--bg-primary);
    border-color: #444;
}



/* Ensure auth buttons maintain their brand colors in light mode */
[data-theme="light"] .btn-spotify {
    background: rgba(29, 185, 84, 0.95);
    border-color: rgba(29, 185, 84, 0.4);
}

[data-theme="light"] .btn-youtube {
    background: rgba(255, 0, 0, 0.95);
    border-color: rgba(255, 0, 0, 0.4);
}

[data-theme="light"] .btn-warning {
    background: rgba(243, 156, 18, 0.95);
    border-color: rgba(243, 156, 18, 0.4);
}

/* Hide redundant user profile elements since usernames are now in button text */
#user-profile,
#youtube-user-profile {
    display: none !important;
}

/* Community Panel Styles */
.community-panel {
    position: fixed;
    top: 60px;
    right: 0;
    width: 400px;
    height: calc(100vh - 60px);
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 50;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    /* Ensure panel stays properly aligned to right edge */
}

.community-panel:not(.hidden) {
    transform: translateX(0);
}

.community-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    /* Ensure toggle button doesn't interfere with main content */
    z-index: 51;
}

.community-toggle .panel-toggle {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.community-toggle .panel-toggle:hover {
    background: var(--primary-hover);
    transform: translateX(-2px);
}

.community-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

.community-header {
    margin-bottom: 1rem;
}

.community-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.community-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.community-search {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

[data-theme="minimal"] .community-search,
[data-theme="minimal"] input,
[data-theme="minimal"] textarea,
[data-theme="minimal"] select {
    background: #ffffff;
}

.community-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.community-feed {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.loading-feed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
    gap: 1rem;
}

.tree-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tree-card-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.tree-card-preview {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-card-info {
    flex: 1;
    min-width: 0;
}

.mini-tree-snapshot {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    overflow: hidden;
}

.mini-tree-snapshot svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mini-tree-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.tree-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.1);
    transform: translateY(-2px);
}

.tree-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.tree-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.3;
}

.tree-card-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tree-card-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tree-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

.tree-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.tree-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tree-stats {
    display: flex;
    gap: 1rem;
}

.tree-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-tree-action {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-tree-action:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.community-pagination {
    padding: 1rem 0 0 0;
    text-align: center;
}

/* Share Modal Styles */
.share-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.share-preview {
    margin-top: 1rem;
}

.share-preview h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.tree-preview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.tree-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tree-preview-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.preview-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.preview-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.preview-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.success-content {
    text-align: center;
}

.share-link-container {
    margin: 1.5rem 0;
}

.share-link-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.link-copy-group {
    display: flex;
    gap: 0.5rem;
}

.link-copy-group input {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.share-actions {
    margin-top: 1rem;
}

/* Ensure tooltip doesn't get cut off */
.btn-settings::before {
    position: absolute;
    right: 0;
    white-space: nowrap;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    /* Mobile Header Adjustments */
    header {
        padding: 0.5rem 0.25rem;
        min-height: 50px;
        max-height: 50px;
        flex-wrap: nowrap;
        gap: 0.25rem;
        overflow: visible;
    }
    
    .logo-text {
        font-size: 1rem;
        margin: 0 0 0 5px;
        flex-shrink: 1;
    }
    
    .auth-status {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.1rem;
        align-items: center;
        justify-content: flex-end;
        overflow: visible;
        flex-shrink: 0;
        min-width: auto;
    }
    
    /* Make buttons smaller on mobile */
    .btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
        min-height: 32px;
        white-space: nowrap;
    }
    
    .btn-spotify, .btn-youtube {
        padding: 0.3rem 0.4rem;
    }
    
    .btn-spotify i, .btn-youtube i {
        margin-right: 0.25rem;
    }
    
    /* Hide button text on very small screens, show only icons */
    @media screen and (max-width: 480px) {
        .btn-spotify .btn-text,
        .btn-youtube .btn-text {
            display: none;
        }
        
        .btn-spotify i,
        .btn-youtube i {
            margin-right: 0;
        }
    }
    
    /* Square buttons sized for mobile */
    #theme-toggle,
    .btn-settings {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        flex-shrink: 0;
        padding: 0.25rem;
    }
    
    /* User profile names - prevent overflow */
    #user-name, #youtube-user-name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    

    
    /* Mobile Settings Modal */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 2% auto;
        max-height: 96vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .settings-section {
        margin-bottom: 1.5rem;
    }
    
    .settings-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Form elements in settings */
    .model-selection,
    .prompt-editor,
    .api-mode-selection {
        margin-bottom: 1rem;
    }
    
    .model-selection label,
    .prompt-editor label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }
    
    #modal-model-selector,
    #modal-system-prompt {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    #modal-system-prompt {
        min-height: 100px;
        resize: vertical;
    }
    
    /* Radio options in settings */
    .radio-option {
        display: block;
        margin-bottom: 0.75rem;
        font-size: 0.9rem;
        padding: 0.5rem;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        cursor: pointer;
    }
    
    .radio-option input[type="radio"] {
        margin-right: 0.5rem;
    }
    
    /* API key input */
    .api-key-input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .api-key-input input {
        width: calc(100% - 50px);
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    /* Buttons in modal */
    .modal-body .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        justify-content: center;
    }
    
    /* Mobile Collapsible Visualization Settings */

    
    /* Mobile Tree Controls - Static horizontal at top */
    .tree-controls {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100%;
        height: 44px;
        flex-direction: row;
        margin: 0.5rem;
        transform: none !important;
        z-index: 30;
    }
    
    /* Ensure settings section appears below header on mobile */
    .settings-section {
        position: relative;
        z-index: 25;
        margin-top: 0.5rem;
        clear: both;
    }
    
    /* Mobile main layout adjustments */
    main {
        display: flex;
        flex-direction: column;
    }
    
    .config-panel {
        order: 2;
    }
    
    .tree-controls.horizontal {
        height: 44px;
        width: 100%;
        flex-direction: row;
    }
    
    .mode-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    /* Hide drag handle on mobile since controls are static */
    .drag-handle {
        display: none;
    }
    
    .tree-controls.horizontal .drag-handle {
        display: none;
    }
}

/* Specific compact font styles for headers */
#visualization-settings-header {
    font-size: 0.65rem !important;
    font-weight: 600;
    margin-bottom: 0.1rem;
    padding: 0.2rem;
}

.recommendation-header-bottom h3 {
    font-size: 0.75rem !important;
    font-weight: 600;
    margin: 0;
}

/* Events Section - Vertical Layout Only */
.events-scroller {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
}

.event-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.event-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-item .event-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-item .event-image img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.event-details {
    flex: 1;
    min-width: 0;
}

.event-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.event-venue {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.event-location {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.event-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.event-stat {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.event-stat i {
    font-size: 0.6rem;
}

.loading-events,
.no-events-found,
.events-error {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.events-error {
    color: #dc3545;
}

/* Dark mode support for events */
[data-theme="dark"] .event-item {
    background: var(--bg-primary);
    border-color: var(--border-light);
}

[data-theme="dark"] .event-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

/* Dark Mode Text Color Fixes */
[data-theme="dark"] {
    color: var(--text-primary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary);
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
    color: var(--text-primary);
}

[data-theme="dark"] label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .config-panel h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .setting-group label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .artist-info p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .history-empty {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .modal-content {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-icon {
    color: var(--text-primary);
}

/* Tree visualization text fixes */
[data-theme="dark"] .node text {
    fill: var(--text-primary) !important;
}

[data-theme="dark"] .tree-container text {
    fill: var(--text-primary) !important;
}

/* Recommendation panel text fixes */
[data-theme="dark"] .recommendation-panel {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .artist-info h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .history-artist-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .history-artist-reason {
    color: var(--text-secondary) !important;
}

/* Genre tracker text fixes */
[data-theme="dark"] .genre-tag {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.hidden {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#user-profile {
    display: flex;
    align-items: center;
}

#user-avatar {
    display: none;
}

#user-name {
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: row;
    padding: 0.5rem;
    gap: 0.5rem;
    min-width: 700px;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.config-panel {
    background-color: var(--bg-primary);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-light);
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    overflow-x: visible;
    transition: all 0.3s ease;
    width: 300px !important;
    max-width: none !important;
    min-height: 0;
    height: 100%;
    align-self: stretch;
    flex-shrink: 0;
    flex-grow: 0;
}

 .config-panel > .search-section,
 .config-panel > .settings-section,
 .config-panel > .genre-tracker-section {
     flex: 0 0 auto;
 }

 .config-panel > .artist-info-section {
     flex: 0 1 52%;
     min-height: 0;
 }

 .config-panel > .artist-events-section {
     flex: 1 1 48%;
     min-height: 0;
     display: flex;
     flex-direction: column;
     min-height: 180px;
 }

[data-theme="minimal"] .config-panel {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

/* Hide scrollbars for webkit browsers */
.config-panel::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbars for Firefox */
.config-panel {
    scrollbar-width: none;
}

.config-panel.collapsed {
    width: 40px !important;
    min-width: 40px !important;
    padding: 0.5rem 0.25rem;
    resize: none;
    overflow-y: hidden;
    overflow-x: visible;
}

.config-panel.collapsed > *:not(.panel-toggle) {
    display: none;
}

.panel-toggle {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 2000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.panel-toggle:hover {
    background: #1aa34a;
    transform: scale(1.1);
}

[data-theme="minimal"] .panel-toggle {
    background: #111111;
    color: #ffffff;
    box-shadow: none;
}

[data-theme="minimal"] .panel-toggle:hover {
    background: #000000;
    transform: translateY(-50%);
}

.config-panel > .panel-toggle {
    top: 62%;
    right: -18px;
    transform: translateY(-50%);
}

.config-panel.collapsed .panel-toggle {
    top: 50%;
    right: -18px;
    transform: translateY(-50%);
}

[data-theme="minimal"] .config-panel > .panel-toggle,
[data-theme="minimal"] .config-panel.collapsed .panel-toggle {
    background: transparent;
    color: #000000;
    box-shadow: none;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    font-size: 1.45rem;
}

@keyframes config-panel-toggle-peek {
    0% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
    100% { transform: translateY(-50%) translateX(0); }
}

.config-panel > .panel-toggle:hover {
    animation: config-panel-toggle-peek 0.65s ease-in-out infinite;
    transform: translateY(-50%);
}

[data-theme="minimal"] .config-panel > .panel-toggle:hover {
    background: transparent;
    color: #000000;
}


/* Bottom recommendation panel toggle positioning */
.recommendation-panel-bottom .panel-toggle {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-left: 0.5rem;
}

/* Community panel toggle positioning */
.community-panel .panel-toggle {
    position: absolute;
    top: 50%;
    left: -12px;
    transform: translateY(-50%);
}

.config-panel h3 {
    margin-bottom: 0.15rem;
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 600;
}

.model-selection, .prompt-editor, .search-section, .settings-section, .genre-tracker-section {
    margin-bottom: 0.5rem;
}

select, textarea, input {
    width: 100%;
    padding: 0.25rem;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.7rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

select:focus, textarea:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-section h3 {
    color: #495057 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.75rem !important;
    text-align: center;
}

.config-panel .search-section {
    padding: 0.65rem;
    margin-bottom: 0.5rem;
}

.config-panel .search-section h3 {
    font-size: 0.85rem !important;
    margin-bottom: 0.4rem !important;
}

.search-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.config-panel .search-container {
    gap: 0.35rem;
}

.artist-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.artist-search-wrapper input {
    width: 100%;
    box-sizing: border-box;
}

.search-container #search-button {
    width: 100%;
}

[data-theme="minimal"] .search-container #search-button {
    width: 100% !important;
    padding: 0.5rem 1rem !important;
    border-radius: 10px !important;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    z-index: 60;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

[data-theme="minimal"] .autocomplete-dropdown {
    box-shadow: none;
    border-radius: 10px;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(17, 17, 17, 0.04);
}

.autocomplete-item .artist-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(17, 17, 17, 0.08);
    flex: 0 0 auto;
    overflow: hidden;
}

.autocomplete-item .artist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.autocomplete-item .artist-name {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.autocomplete-item .artist-meta {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.search-container input {
    flex: 1;
    padding: 0.75rem !important;
    font-size: 1rem !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    transition: all 0.3s ease !important;
}

.config-panel .search-container input {
    padding: 0.55rem !important;
    font-size: 0.9rem !important;
}

.search-container input:focus {
    border-color: white !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.search-container input::placeholder {
    color: #666 !important;
    font-weight: 400;
}

#search-button {
    padding: 0.75rem 1.5rem !important;
    background: white !important;
    color: var(--primary-color) !important;
    border: 2px solid white !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.config-panel #search-button {
    padding: 0.55rem 1rem !important;
    font-size: 0.8rem !important;
}

#search-button:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Dark mode search section styling */
[data-theme="dark"] .search-section {
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a) !important;
    border: 1px solid #444;
}

[data-theme="dark"] .search-section h3 {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .search-container input {
    background: rgba(45, 45, 45, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .search-container input:focus {
    background: #2d2d2d !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.3) !important;
}

[data-theme="dark"] .search-container input::placeholder {
    color: #999 !important;
}

[data-theme="dark"] #search-button {
    background: #2d2d2d !important;
    color: var(--primary-color) !important;
    border: 2px solid #2d2d2d !important;
}

[data-theme="dark"] #search-button:hover {
    background: #3d3d3d !important;
    border-color: var(--primary-color) !important;
}

.history-container {
    margin-top: 0.5rem;
}

.config-panel .history-container {
    margin-top: 0.35rem;
}

.artist-history-dropdown {
    width: 100%;
    margin: 0;
}

/* Settings Panel Styles */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.setting-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
}

.slider {
    flex: 1;
    min-width: 100px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 10px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Collapsible Settings Styles */
.settings-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    margin-bottom: 0.25rem;
    user-select: none;
    position: relative;
    z-index: 50;
    transition: background-color 0.3s ease;
    font-size: 0.75rem;
}

.settings-header:hover {
    background-color: var(--border-color);
}

.collapse-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
}

.settings-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.settings-container {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
    position: relative;
    z-index: 40;
}

.settings-container.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.setting-group span {
    font-size: 0.6rem;
    color: var(--text-color);
    min-width: 45px;
    text-align: right;
}

.setting-group select {
    flex: 1;
    min-width: 100px;
}

/* Genre Tracker Styles */
.genre-container {
    min-height: 60px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
}

.no-genres {
    color: #666;
    font-style: italic;
    font-size: 0.75rem;
    text-align: center;
    margin: 0;
}

.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.genre-tag {
    background-color: var(--primary-color);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.genre-tag:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 255, 127, 0.3);
}

.genre-tag:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 255, 127, 0.2);
}

.genre-tag.new {
    animation: genreAppear 0.5s ease-in-out;
}

@keyframes genreAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Genre exploration notification animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Genre notification styling */
.genre-notification {
    font-family: var(--font-family);
}

.genre-notification .notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.genre-notification i {
    font-size: 1rem;
    opacity: 0.9;
}

/* Visualization */
.visualization-container {
    flex: 1;
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-light);
    min-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* Tree Actions */
.tree-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.action-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tree-actions .action-group #create-playlist {
    margin-left: auto;
}

.layout-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.25rem 0;
}

.layout-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-right: 0.25rem;
}

.btn-layout {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
    color: var(--text-color);
    margin: 0 2px;
    flex-shrink: 0;
}

.btn-layout:hover {
    background-color: var(--light-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-layout.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
}

/* Dark mode secondary button styling */
[data-theme="dark"] .btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

#tree-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    height: auto;
}

#tree-container svg {
    display: block;
}

/* Tree Visualization Styles */
.node circle {
    fill: white;
    stroke: var(--primary-color);
    stroke-width: 2px;
}

.node.selected circle {
    fill: var(--primary-color);
}

.node text {
    font-size: 12px;
    font-family: inherit;
}

.link {
    fill: none;
    stroke: #ccc;
    stroke-width: 1.5px;
}

/* Tree Controls */
.tree-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 3px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 5;
}

.tree-controls hr {
    margin: 5px 0;
    border: none;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.mode-btn, .zoom-btn {
    width: 22px;
    height: 22px;
    border-radius: 2px;
    border: 1px solid var(--border-color);
    background-color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.65rem;
}

.mode-btn:hover, .zoom-btn:hover {
    background-color: var(--light-bg);
}

.mode-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Add Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');


/* Horizontal Recommendation Panel at Bottom */
.recommendation-panel-bottom {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    height: 300px;
    min-height: 200px;
    max-height: 80vh;
    background-color: var(--bg-primary);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    padding: 0;
    transform: none;
    transition: none;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

/* Panel Resize Handle */
.panel-resize-handle {
    height: 8px;
    background: var(--border-color);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.panel-resize-handle:hover {
    background: var(--accent-color);
}

.resize-grip {
    width: 60px;
    height: 3px;
    background: var(--text-secondary);
    border-radius: 2px;
    opacity: 0.6;
}

.panel-resize-handle:hover .resize-grip {
    opacity: 1;
    background: white;
}

/* Panel Content */
.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.5rem;
}

.recommendation-panel-bottom.hidden {
    display: none;
}

.recommendation-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.recommendation-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendation-title h3 {
    margin: 0;
    font-size: 0.6rem;
    color: var(--text-primary);
    font-weight: 500;
}

#recommendation-count {
    font-size: 0.55rem;
    color: var(--primary-color);
    font-weight: normal;
}

.recommendation-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.recommendation-slider-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    min-height: 80px;
}

.recommendations-slider {
    display: flex;
    gap: 0.75rem;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 0.25rem 0;
}

.recommendations-slider::-webkit-scrollbar {
    height: 6px;
}

.recommendations-slider::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.recommendations-slider::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.recommendation-item {
    min-width: 320px;
    width: 320px;
    height: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-right: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.recommendation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="minimal"] .recommendation-item:hover {
    transform: none;
    box-shadow: none;
}

.recommendation-history-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.history-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.history-header-bottom:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.history-header-bottom h4 {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Source Artist Sections */
.source-artist-section {
    margin: 1.5rem 0 1rem 0;
    padding: 0.5rem 0;
}

.source-artist-section h4 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.source-artist-section hr {
    border: none;
    border-top: 2px solid var(--primary-color);
    margin: 0.5rem 0 1rem 0;
}

.source-artist-section:first-child {
    margin-top: 0;
}

/* Artist Cards */
.artist-card {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.artist-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 1rem;
}

.artist-info h4 {
    margin-bottom: 0.25rem;
}

.artist-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.artist-actions {
    margin-top: 0.5rem;
}

.artist-actions button {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-right: 0.4rem;
}

/* Recommendation History Styles */
.recommendation-history {
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 15px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.history-item {
    padding: 8px 12px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background-color: rgba(29, 185, 84, 0.1);
}

[data-theme="minimal"] .history-item {
    border-bottom-color: var(--border-color);
}

[data-theme="minimal"] .history-item:hover {
    background-color: rgba(17, 17, 17, 0.04);
}

.history-artist {
    flex: 1;
}

.history-artist-name {
    font-weight: bold;
    color: #fff;
    font-size: 13px;
    margin-bottom: 2px;
}

.history-artist-reason {
    font-size: 11px;
    color: #aaa;
    line-height: 1.3;
}

.history-artist-source {
    font-size: 10px;
    color: #1db954;
    margin-top: 2px;
}

[data-theme="minimal"] .history-artist-name {
    color: var(--text-primary);
}

[data-theme="minimal"] .history-artist-reason {
    color: var(--text-secondary);
}

[data-theme="minimal"] .history-artist-source {
    color: var(--text-tertiary);
}

.history-actions {
    display: flex;
    gap: 4px;
}

.btn-history-action {
    padding: 2px 6px;
    font-size: 10px;
    background: transparent;
    color: #666;
    border: 1px solid #444;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-history-action:hover {
    background: #333;
    color: #1db954;
    border-color: #1db954;
}

#toggle-history i {
    transition: transform 0.3s ease;
}

.history-content:not(.collapsed) + .history-header #toggle-history i {
    transform: rotate(180deg);
}

.history-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 12px;
    line-height: 1.4;
}

.artist-actions button:hover {
    background-color: var(--primary-color);
    color: white;
}

.youtube-btn {
    background-color: #FF0000 !important;
    color: white !important;
    border-color: #FF0000 !important;
}

.youtube-btn:hover {
    background-color: #CC0000 !important;
    color: white !important;
    border-color: #CC0000 !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    main {
        flex-direction: row;
        gap: 0.75rem;
    }

    .config-panel {
        width: 220px;
        min-width: 200px;
        max-width: 280px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .visualization-container {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .recommendation-panel {
        width: 100%;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .auth-status {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Focus button specific styling */
.focus-btn {
    background-color: #f8f9fa !important;
    border-color: #007bff !important;
    color: #007bff !important;
}

.focus-btn:hover {
    background-color: #007bff !important;
    color: white !important;
    transform: scale(1.05);
}

/* Color slider styling */
.color-slider {
    width: 40px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-slider::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
}

.color-slider::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-slider::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Update setting group span for color values */
.setting-group span {
    font-size: 0.7rem;
    color: var(--text-color);
    min-width: 70px;
    text-align: right;
    font-family: monospace;
}

/* Small buttons for recommendation items */
.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.explore-btn {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.explore-btn:hover {
    background-color: var(--accent-color);
    color: white;
    flex: 1;
}

.explore-btn:hover {
    background-color: var(--accent-hover);
}

.spotify-btn {
    background-color: #1DB954;
    color: white;
    flex: 1;
}

.spotify-btn:hover {
    background-color: #1ed760;
}

.youtube-btn {
    background-color: #FF0000;
    color: white;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-btn:hover {
    background-color: #cc0000;
}

.artist-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: auto;
    align-items: center;
}

.no-recommendations {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Recommendation Detail Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.close-modal:hover {
    background: var(--accent-color);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

#settings-modal .modal-content {
    max-width: 760px;
    width: 92%;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#settings-modal .modal-header {
    padding: 0.85rem 1rem;
}

#settings-modal .modal-header h2 {
    font-size: 1.05rem;
}

#settings-modal .close-modal {
    width: 32px;
    height: 32px;
    font-size: 1.15rem;
    padding: 0.25rem;
}

#settings-modal .modal-body {
    padding: 0.9rem 1rem;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

.artist-detail-section {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.artist-image-large {
    flex-shrink: 0;
}

.artist-image-large img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.artist-info-detail {
    flex: 1;
    min-width: 300px;
}

.artist-info-detail h3 {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.recommendation-reason-full h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.recommendation-reason-full p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.artist-actions-modal {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 1rem;
}

.artist-actions-modal .btn {
    flex: 1;
    max-width: 160px;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#modal-explore-btn {
    background: #8A2BE2 !important; /* Purple color */
    color: white !important;
    border: 2px solid #9932CC !important;
    animation: pulse-purple 1.5s infinite !important;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5) !important;
    font-weight: bold !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 80px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
}

#modal-explore-btn:hover {
    background: #9932CC !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.8) !important;
}

[data-theme="minimal"] #modal-explore-btn {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    animation: none !important;
    box-shadow: none !important;
    font-weight: normal !important;
}

[data-theme="minimal"] #modal-explore-btn:hover {
    background: var(--light-bg) !important;
    transform: none !important;
    box-shadow: none !important;
}

#modal-spotify-btn {
    background: #1DB954;
    color: white;
}

#modal-spotify-btn:hover {
    background: #1ed760;
    transform: translateY(-1px);
}

[data-theme="minimal"] #modal-spotify-btn,
[data-theme="minimal"] #modal-youtube-btn {
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
    box-shadow: none;
}

[data-theme="minimal"] #modal-spotify-btn:hover,
[data-theme="minimal"] #modal-youtube-btn:hover {
    background: #000000;
    border-color: #000000;
    transform: none;
}

#modal-youtube-btn {
    background: #FF0000;
    color: white;
}

#modal-youtube-btn:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

/* Main Explore Button - Purple and Flashing */
#search-button {
    background: #8A2BE2 !important; /* Purple color */
    color: white !important;
    border: 1px solid #9932CC !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    animation: pulse-purple-main 1.5s infinite !important;
    box-shadow: 0 0 6px rgba(138, 43, 226, 0.4) !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 80px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
}

#search-button:hover {
    background: #9932CC !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 0 8px rgba(138, 43, 226, 0.6) !important;
}

[data-theme="minimal"] #search-button {
    background: #111111 !important;
    color: #ffffff !important;
    border-color: #111111 !important;
    box-shadow: none !important;
    animation: none !important;
}

[data-theme="minimal"] #search-button:hover,
[data-theme="minimal"] #search-button:active {
    background: #000000 !important;
    border-color: #000000 !important;
    transform: none !important;
    box-shadow: none !important;
}

#search-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 0 8px rgba(138, 43, 226, 0.6) !important;
}

/* Purple flashing animation for main button */
@keyframes pulse-purple-main {
    0% {
        background: #8A2BE2;
        box-shadow: 0 0 6px rgba(138, 43, 226, 0.4);
        border-color: #9932CC;
    }
    50% {
        background: #9932CC;
        box-shadow: 0 0 12px rgba(138, 43, 226, 0.7);
        border-color: #DA70D6;
    }
    100% {
        background: #8A2BE2;
        box-shadow: 0 0 6px rgba(138, 43, 226, 0.4);
        border-color: #9932CC;
    }
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-spotify {
    background: #1DB954;
    color: white;
}

.btn-spotify:hover {
    background: #1ed760;
    transform: translateY(-1px);
}

.btn-youtube {
    background: #FF0000;
    color: white;
}

.btn-youtube:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

.top-tracks-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.top-tracks-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.top-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.track-item:hover {
    background: var(--border-color);
    transform: translateX(4px);
}

.track-number {
    font-weight: 600;
    color: var(--accent-color);
    min-width: 30px;
    text-align: center;
}

.track-info {
    flex: 1;
}

.track-name {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
}

.track-album {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.loading-tracks {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

/* Recommendation header styling */
.recommendation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.artist-name-container {
    flex: 1;
    min-width: 0;
}

.artist-name-container h5 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-name-container span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Tree Mode Control Buttons - Dark Mode Fix */
.tree-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1000;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    width: 48px;
}

/* Horizontal orientation for tree controls */
.tree-controls.horizontal {
    flex-direction: row;
    width: auto;
    height: 48px;
}

.tree-controls.horizontal .drag-handle {
    width: 18px;
    height: calc(100% + 8px);
    margin: -4px 4px -4px -4px;
    border-radius: 6px 0 0 6px;
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.mode-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
    flex-shrink: 0;
}

.mode-btn:hover {
    background-color: var(--light-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mode-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mode-btn i {
    pointer-events: none;
}

/* Logo text styling with colorful pulsing animation */
.logo-text {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 0 20px;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: -0.5px;
    animation: colorfulPulse 45s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.logo-text:hover {
    transform: scale(1.05);
    animation-duration: 25s; /* Speed up animation on hover */
}

.logo-image {
    height: 40px;
    width: auto;
    display: block;
    margin: 0 0 0 20px;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

[data-theme="minimal"] .logo-image {
    filter: none !important;
    transform: none !important;
}

/* Colorful pulsing animation keyframes */
@keyframes colorfulPulse {
    0% { color: #ff6b6b; text-shadow: 0 0 10px rgba(255, 107, 107, 0.5); }
    4% { color: #ff8e53; text-shadow: 0 0 10px rgba(255, 142, 83, 0.5); }
    8% { color: #ff9f43; text-shadow: 0 0 10px rgba(255, 159, 67, 0.5); }
    12% { color: #feca57; text-shadow: 0 0 10px rgba(254, 202, 87, 0.5); }
    16% { color: #48dbfb; text-shadow: 0 0 10px rgba(72, 219, 251, 0.5); }
    20% { color: #0abde3; text-shadow: 0 0 10px rgba(10, 189, 227, 0.5); }
    24% { color: #006ba6; text-shadow: 0 0 10px rgba(0, 107, 166, 0.5); }
    28% { color: #5f27cd; text-shadow: 0 0 10px rgba(95, 39, 205, 0.5); }
    32% { color: #a55eea; text-shadow: 0 0 10px rgba(165, 94, 234, 0.5); }
    36% { color: #fd79a8; text-shadow: 0 0 10px rgba(253, 121, 168, 0.5); }
    40% { color: #e84393; text-shadow: 0 0 10px rgba(232, 67, 147, 0.5); }
    44% { color: #00b894; text-shadow: 0 0 10px rgba(0, 184, 148, 0.5); }
    48% { color: #00cec9; text-shadow: 0 0 10px rgba(0, 206, 201, 0.5); }
    52% { color: #55a3ff; text-shadow: 0 0 10px rgba(85, 163, 255, 0.5); }
    56% { color: #3742fa; text-shadow: 0 0 10px rgba(55, 66, 250, 0.5); }
    60% { color: #2f3542; text-shadow: 0 0 10px rgba(47, 53, 66, 0.5); }
    64% { color: #ff3838; text-shadow: 0 0 10px rgba(255, 56, 56, 0.5); }
    68% { color: #ff9ff3; text-shadow: 0 0 10px rgba(255, 159, 243, 0.5); }
    72% { color: #54a0ff; text-shadow: 0 0 10px rgba(84, 160, 255, 0.5); }
    76% { color: #5f27cd; text-shadow: 0 0 10px rgba(95, 39, 205, 0.5); }
    80% { color: #00d2d3; text-shadow: 0 0 10px rgba(0, 210, 211, 0.5); }
    84% { color: #ff9f43; text-shadow: 0 0 10px rgba(255, 159, 67, 0.5); }
    88% { color: #ee5a24; text-shadow: 0 0 10px rgba(238, 90, 36, 0.5); }
    92% { color: #0984e3; text-shadow: 0 0 10px rgba(9, 132, 227, 0.5); }
    96% { color: #a29bfe; text-shadow: 0 0 10px rgba(162, 155, 254, 0.5); }
    100% { color: #ff6b6b; text-shadow: 0 0 10px rgba(255, 107, 107, 0.5); }
}

/* Drag handle for tree controls */
.drag-handle {
    width: calc(100% + 8px);
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    border: none;
    border-radius: 6px 6px 0 0;
    cursor: grab;
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin: -4px -4px 4px -4px;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

.drag-handle:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Dragging state styles */
.tree-controls.dragging {
    opacity: 0.9;
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
}

.tree-controls.dragging .drag-handle {
    cursor: grabbing;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tree-controls.dragging .mode-btn {
    border-color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Settings Modal Styling */
.settings-section {
    padding: 1rem 0;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

#settings-modal .settings-section {
    padding: 0.5rem 0;
}

#settings-modal .settings-section + .settings-section {
    border-top: 1px solid var(--border-color);
}

#settings-modal .settings-section h3 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

#settings-modal label,
#settings-modal .help-text,
#settings-modal small {
    font-size: 0.78rem;
    line-height: 1.25;
}

.api-mode-selection {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

#settings-modal .api-mode-selection {
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--bg-secondary);
}

#settings-modal .radio-option {
    padding: 0.55rem 0.65rem;
    gap: 0.5rem;
    border-width: 1px;
}

#settings-modal .radio-option input[type="radio"] {
    margin-top: 2px;
    width: auto;
    height: auto;
    padding: 0;
    border: none;
    background: transparent;
    flex: 0 0 auto;
}

#settings-modal .radio-label {
    flex: 1;
    min-width: 0;
}

#settings-modal .radio-label strong,
#settings-modal .radio-label small {
    white-space: normal;
    overflow-wrap: anywhere;
}

.radio-option:hover {
    border-color: var(--primary-color);
    background-color: var(--light-bg);
}

.radio-option input[type="radio"] {
    margin: 0;
    accent-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: var(--primary-color);
}

.radio-option:has(input:checked) {
    border-color: var(--primary-color);
    background-color: var(--light-bg);
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.radio-label strong {
    color: var(--text-primary);
    font-weight: 600;
}

.radio-label small {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.3;
}

#settings-modal .radio-label small {
    font-size: 0.75rem;
}

.api-key-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#settings-modal .api-key-section {
    margin-bottom: 0.75rem;
    padding: 0.65rem;
}

.api-key-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.api-key-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#settings-modal .api-key-input-group {
    margin-bottom: 0.35rem;
}

.api-key-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

#settings-modal .api-key-input {
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

[data-theme="minimal"] .api-key-input:focus {
    border-color: rgba(17, 17, 17, 0.45);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.14);
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.settings-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

#settings-modal .settings-actions {
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#settings-modal .settings-actions .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
}

.test-result {
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.test-result.success {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.test-result.error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

/* AI Model and Prompt Settings in Modal */
.settings-section .model-selection {
    margin-bottom: 1.5rem;
}

#settings-modal .settings-section .model-selection {
    margin-bottom: 0.75rem;
}

.settings-section .model-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-section .model-selection select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

#settings-modal .settings-section .model-selection select {
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
}

.settings-section .model-selection select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

[data-theme="minimal"] .settings-section .model-selection select:focus {
    border-color: rgba(17, 17, 17, 0.45);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.14);
}

.settings-section .prompt-editor {
    margin-bottom: 1.5rem;
}

#settings-modal .settings-section .prompt-editor {
    margin-bottom: 0.75rem;
}

.settings-section .prompt-editor label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-section .prompt-editor textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

#settings-modal .settings-section .prompt-editor textarea {
    padding: 0.55rem 0.6rem;
    font-size: 0.82rem;
    min-height: 70px;
}

#settings-modal #visualization-settings-header {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

#settings-modal .settings-container {
    gap: 0.35rem;
}

.settings-section .prompt-editor textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

[data-theme="minimal"] .settings-section .prompt-editor textarea:focus {
    border-color: rgba(17, 17, 17, 0.45);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.14);
}

/* YouTube Playlist Modal Styling */
.youtube-modal {
    max-width: 600px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="minimal"] .youtube-modal {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

[data-theme="dark"] .youtube-modal {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

.youtube-modal .modal-header {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

[data-theme="minimal"] .youtube-modal .modal-header {
    background: transparent;
    color: var(--text-primary);
}

.youtube-modal .youtube-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.youtube-modal .modal-title-section h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

[data-theme="minimal"] .youtube-modal .modal-title-section h2 {
    color: var(--text-primary);
}

.youtube-modal .modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: white;
}

[data-theme="minimal"] .youtube-modal .modal-subtitle {
    color: var(--text-secondary);
    opacity: 1;
}

.youtube-modal .close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.youtube-modal .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

[data-theme="minimal"] .youtube-modal .close-modal {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="minimal"] .youtube-modal .close-modal:hover {
    background: rgba(17, 17, 17, 0.04);
    transform: none;
}

.youtube-modal .modal-body {
    padding: 2rem;
}

.playlist-info {
    margin-bottom: 2rem;
}

.playlist-name-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.playlist-name-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.playlist-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.playlist-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #FF0000;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.playlist-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

[data-theme="minimal"] .btn-large:hover {
    transform: none;
    box-shadow: none;
}

.btn-youtube.btn-large {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    border: none;
}

.btn-youtube.btn-large:hover {
    background: linear-gradient(135deg, #CC0000 0%, #AA0000 100%);
}

[data-theme="minimal"] .btn-youtube.btn-large,
[data-theme="minimal"] .btn-spotify.btn-large {
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
}

[data-theme="minimal"] .btn-youtube.btn-large:hover,
[data-theme="minimal"] .btn-spotify.btn-large:hover {
    background: #000000;
    border-color: #000000;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Spotify Modal Specific Styles */
.spotify-modal {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    border: none;
    box-shadow: 0 20px 40px rgba(29, 185, 84, 0.3);
    animation: modalSlideIn 0.4s ease-out;
}

[data-theme="minimal"] .spotify-modal {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.spotify-modal .modal-header {
    background: transparent;
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

[data-theme="minimal"] .spotify-modal .modal-header {
    color: var(--text-primary);
}

.spotify-modal .spotify-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.spotify-modal .modal-title-section h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

[data-theme="minimal"] .spotify-modal .modal-title-section h2 {
    color: var(--text-primary);
}

.spotify-modal .modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: white;
}

[data-theme="minimal"] .spotify-modal .modal-subtitle {
    color: var(--text-secondary);
    opacity: 1;
}

.spotify-modal .close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.spotify-modal .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

[data-theme="minimal"] .spotify-modal .close-modal {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="minimal"] .spotify-modal .close-modal:hover {
    background: rgba(17, 17, 17, 0.04);
    transform: none;
}

.spotify-modal .modal-body {
    padding: 2rem;
}

.spotify-modal .stat-number {
    color: #1DB954;
}

[data-theme="minimal"] .spotify-modal .stat-number {
    color: var(--text-primary);
}

.btn-spotify.btn-large {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    color: white;
    border: none;
}

.btn-spotify.btn-large:hover {
    background: linear-gradient(135deg, #1ed760 0%, #17a346 100%);
}

/* Animation for modal appearance */
.youtube-modal {
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Text Playlist Modal Styles */
#text-playlist-modal .modal-content {
    max-width: 700px;
    width: 95%;
}

#text-playlist-modal .modal-header {
    background: linear-gradient(135deg, #8A2BE2 0%, #9932CC 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

[data-theme="minimal"] #text-playlist-modal .modal-header {
    background: transparent;
    color: var(--text-primary);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--border-color);
}

#text-playlist-modal .modal-header h2 {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#text-playlist-modal .close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

#text-playlist-modal .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.playlist-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.playlist-description {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.playlist-stats {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.playlist-content {
    margin-bottom: 1.5rem;
}

#playlist-text {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: vertical;
    min-height: 300px;
}

#playlist-text:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.playlist-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.playlist-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

#download-playlist {
    background: #8A2BE2;
    color: white;
    border: none;
}

#download-playlist:hover {
    background: #9932CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

[data-theme="minimal"] #download-playlist:hover {
    background: rgba(17, 17, 17, 0.04);
    transform: none;
    box-shadow: none;
}

#copy-playlist {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

#copy-playlist:hover {
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Artist Information Card Styles */
.artist-info-section {
    margin-top: 1.5rem;
    padding: 0;
}

.config-panel .artist-info-section {
    margin-top: 0.75rem;
    overflow: hidden;
}

.artist-info-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.config-panel .artist-info-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.artist-info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.config-panel .artist-info-card {
    padding: 1rem;
    overflow: hidden;
}

.artist-info-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.artist-photo-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.config-panel .artist-photo-container {
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.artist-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-panel .artist-photo {
    width: 64px;
    height: 64px;
    border-width: 2px;
}

.artist-basic-info {
    flex: 1;
}

.artist-basic-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
}

.config-panel .artist-basic-info h4 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.artist-stat {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.config-panel .artist-stat {
    font-size: 0.8rem;
    margin: 0.15rem 0;
}

.albums-section {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.config-panel .albums-section {
    padding-top: 0.5rem;
}

.albums-section h5 {
    margin: 0 0 0.6rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.config-panel .albums-section h5 {
    margin: 0 0 0.4rem 0;
    font-size: 0.9rem;
}

.albums-scroller {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

.albums-scroller::-webkit-scrollbar {
    height: 6px;
}

.config-panel .albums-scroller {
    padding: 0.35rem 0;
}

.albums-scroller::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.albums-scroller::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.album-item {
    flex-shrink: 0;
    width: 92px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    scroll-snap-align: start;
}

.config-panel .album-item {
    width: 84px;
}

.album-item:hover {
    transform: translateY(-2px);
}

.album-cover {
    width: 92px;
    height: 92px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.config-panel .album-cover {
    width: 84px;
    height: 84px;
    margin-bottom: 0.35rem;
}

.album-item:hover .album-cover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.album-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.config-panel .album-name {
    font-size: 0.75rem;
}

.album-year {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

.config-panel .album-year {
    font-size: 0.65rem;
    margin-top: 0.15rem;
}

.loading-albums {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

.no-artist-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.no-artist-message p {
    margin: 0;
}

/* Artist Events Section Styles */
.artist-events-section {
    margin-top: 0.75rem;
    padding: 0;
    min-height: 0;
}

.artist-events-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.artist-events-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.artist-events-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.events-scroller {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

.events-scroller::-webkit-scrollbar {
    width: 6px;
}

.events-scroller::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.events-scroller::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    scroll-snap-align: start;
}

.event-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.event-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.event-details {
    flex: 1;
    min-width: 0;
}

.event-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.25rem 0;
}

.event-venue {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-location {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.event-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.event-stat {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.event-stat i {
    font-size: 0.7rem;
}

.loading-events {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

.no-events-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.no-events-message p {
    margin: 0;
}

.no-events-found {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.events-error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    font-style: italic;
}

/* Admin Management Styles */
.admin-users-list {
    margin-bottom: 1rem;
}

.admin-users-list label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

#admin-users-container {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-height: 60px;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    margin-bottom: 1rem;
}

.admin-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.admin-user-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-user-email {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.admin-user-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.remove-admin-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-admin-btn:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

[data-theme="minimal"] .remove-admin-btn {
    background-color: #111111;
    color: #ffffff;
    border: 1px solid #111111;
}

[data-theme="minimal"] .remove-admin-btn:hover {
    background-color: #000000;
    border-color: #000000;
    transform: none;
}

.add-admin-user {
    margin-top: 1rem;
}

.add-admin-user label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-email-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.admin-email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
}

.admin-email-input::placeholder {
    color: var(--text-secondary);
}

#add-admin-user {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#add-admin-user:hover {
    background-color: #1aa34a;
    transform: translateY(-1px);
}

#add-admin-user:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.empty-admin-list {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
}

/* Dark mode adjustments for admin management */
[data-theme="dark"] .admin-user-item {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .admin-user-email {
    color: var(--text-primary);
}

[data-theme="dark"] .admin-email-input {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .admin-email-input:focus {
    border-color: var(--primary-color);
}

/* Minimal theme hard overrides (keep flat + monochrome even if older !important rules exist) */
[data-theme="minimal"] #search-button,
[data-theme="minimal"] #modal-explore-btn,
[data-theme="minimal"] .btn-primary {
    background: #111111 !important;
    color: #ffffff !important;
    border-color: #111111 !important;
    box-shadow: none !important;
    animation: none !important;
    transform: none !important;
}

[data-theme="minimal"] .logo-text {
    animation: none !important;
    text-shadow: none !important;
    color: var(--text-primary) !important;
    transform: none !important;
}

[data-theme="minimal"] .logo-text:hover {
    animation: none !important;
    text-shadow: none !important;
    transform: none !important;
}

[data-theme="minimal"] #search-button:hover,
[data-theme="minimal"] #search-button:active,
[data-theme="minimal"] #modal-explore-btn:hover,
[data-theme="minimal"] #modal-explore-btn:active,
[data-theme="minimal"] .btn-primary:hover,
[data-theme="minimal"] .btn-primary:active {
    background: #000000 !important;
    border-color: #000000 !important;
    box-shadow: none !important;
    transform: none !important;
}
