/* ========================================
   Song Library Panel Styles
   ======================================== */

/* Panel backdrop */
.library-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 199;
}

.library-panel.open .library-panel-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* Main Panel */
.library-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    pointer-events: none;
}

.library-panel-content {
    position: relative;
    background: linear-gradient(180deg, #1e1e2e, #13131d);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    height: 100vh;
    max-height: none;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.6);
    z-index: 205;
}

.library-panel.open .library-panel-content {
    transform: translateY(0);
}

/* Panel Header */
.library-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    gap: 16px;
}

.library-panel-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
}

.library-controls {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Filter Toggle */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.filter-toggle input {
    display: none;
}

.filter-toggle-slider {
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    position: relative;
    transition: background 0.3s;
}

.filter-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.filter-toggle input:checked+.filter-toggle-slider {
    background: #6366f1;
}

.filter-toggle input:checked+.filter-toggle-slider::before {
    transform: translateX(18px);
}

.filter-toggle-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.close-panel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #aaa;
    transition: all 0.2s;
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Library Body - Split View */
.library-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Category Sidebar */
.category-sidebar {
    width: 220px;
    min-width: 220px;
    background: rgba(0, 0, 0, 0.2);
    border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.8);
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.category-item.active {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
}

.category-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.category-name {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.add-category-btn {
    background: rgba(99, 102, 241, 0.3);
    border: none;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6366f1;
    transition: all 0.2s;
}

.add-category-btn:hover {
    background: #6366f1;
    color: #fff;
}

/* User category item with delete */
.category-item .category-delete {
    opacity: 0;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s;
    font-size: 12px;
}

.category-item:hover .category-delete {
    opacity: 1;
}

/* Songs Grid Container */
.songs-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.songs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

/* 2 columns on small screens */
@media (min-width: 500px) {
    .songs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3 columns on medium screens */
@media (min-width: 750px) {
    .songs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 4 columns on large screens */
@media (min-width: 1000px) {
    .songs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 5 columns on extra large screens */
@media (min-width: 1300px) {
    .songs-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 6 columns on ultra wide screens */
@media (min-width: 1600px) {
    .songs-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Song Card */
.song-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    position: relative;
    width: 100%;
    margin: 0;
    /* Center in grid cell if cell is larger */
    width: 100%;
}

.song-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.song-card.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
}

/* Built-in song indicator */
/* Built-in song indicator - REMOVED */

/* Card Image */
.song-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #2a2a3d, #1a1a2d);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.song-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-card-image .placeholder-icon {
    color: rgba(255, 255, 255, 0.15);
}

/* Difficulty Badge on Image */
.difficulty-badge {
    position: absolute;
    bottom: 8px;
    inset-inline-start: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.difficulty-beginner {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.difficulty-easy {
    background: linear-gradient(135deg, #84cc16, #65a30d);
}

.difficulty-intermediate {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.difficulty-advanced {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.difficulty-expert {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Image Upload Button */
.image-upload-btn {
    position: absolute;
    bottom: 8px;
    inset-inline-end: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: white;
}

.song-card:hover .image-upload-btn {
    opacity: 1;
}

.image-upload-btn:hover {
    background: #6366f1;
    transform: scale(1.1);
}

/* Share to Market Button (positioned left of image upload) */
.song-card-share-btn {
    position: absolute;
    bottom: 8px;
    inset-inline-end: 44px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: white;
}

.song-card:hover .song-card-share-btn {
    opacity: 1;
}

.song-card-share-btn:hover {
    background: #8b5cf6;
    transform: scale(1.1);
}

/* Card Info */
.song-card-info {
    padding: 12px;
}

.song-card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.song-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.song-card-stats {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
}

.song-card-best {
    color: #4ade80;
    font-weight: 600;
}

/* Delete button on card */
.song-card-delete {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: white;
    font-size: 14px;
}

.song-card:hover .song-card-delete {
    opacity: 1;
}

.song-card-delete:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* Share Project button on card */
.song-card-share-project-btn {
    position: absolute;
    top: 8px;
    inset-inline-end: 40px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: white;
    font-size: 14px;
}

.song-card:hover .song-card-share-project-btn {
    opacity: 1;
}

.song-card-share-project-btn:hover {
    background: #8b5cf6;
    transform: scale(1.1);
}

/* Category Button on Card */
.song-card-category-btn {
    position: absolute;
    top: 8px;
    inset-inline-end: 40px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: white;
    font-size: 12px;
}

.song-card:hover .song-card-category-btn {
    opacity: 1;
}

.song-card-category-btn:hover {
    background: #6366f1;
    transform: scale(1.1);
}

/* Stats Button */
.song-card-stats-btn {
    position: absolute;
    top: 8px;
    inset-inline-end: 72px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: white;
    z-index: 5;
}

.song-card:hover .song-card-stats-btn {
    opacity: 1;
}

.song-card-stats-btn:hover {
    background: #22c55e;
    transform: scale(1.1);
}

/* Empty state */
.library-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.4);
    min-height: 300px;
}

.library-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.library-empty h4 {
    margin: 0 0 8px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   Category Modal Styles
   ======================================== */

.category-modal {
    max-width: 400px;
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.emoji-btn {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.emoji-btn.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.2);
}

/* Assign Category Modal */
.assign-category-modal {
    max-width: 500px;
    min-width: 450px;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.category-select-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 16px;
}

.category-select-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.category-select-item:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.category-select-item.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
    color: #fff;
}

.category-select-item .category-icon {
    font-size: 1.5rem;
}

.category-select-item .category-name {
    font-size: 0.8rem;
    font-weight: 500;
}

/* ========================================
   Main Content Layout
   ======================================== */
.app-body {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    overflow: hidden;
    position: relative;
    background-color: var(--bg-primary);
}

.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    flex-direction: column;
}

.canvas-container {
    flex: 1;
    width: 100%;
    height: auto;
    min-height: 0;
}

/* Hidden input for image upload */
.hidden-file-input {
    display: none;
}

/* ========================================
   Legacy History Panel Support
   (For backward compatibility)
   ======================================== */
.history-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    pointer-events: none;
}

.history-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 199;
}

.history-panel.open .history-panel-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.history-panel-content {
    position: relative;
    background: linear-gradient(180deg, #252535, #1a1a28);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    height: 100vh;
    max-height: none;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 205;
}

.history-panel.open .history-panel-content {
    transform: translateY(0);
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    align-content: start;
}

.history-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.history-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ========================================
   Library Controls & Search
   ======================================== */

.library-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-inline-start: auto;
    /* Push to right (or left in RTL) */
    padding-inline-end: 12px;
}

.library-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 12px;
    width: 220px;
    transition: all 0.2s;
}

.library-search:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.library-search svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.5);
    margin-inline-end: 10px;
    flex-shrink: 0;
}

.library-search input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    padding: 0;
    font-family: inherit;
}

.library-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Category Icons (SVG support) */
.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.category-icon svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}

.category-item:hover .category-icon svg {
    color: rgba(255, 255, 255, 0.9);
}

.category-item.active .category-icon svg {
    color: #fff;
}

.category-item[data-category="favorites"] .category-icon svg {
    color: #eab308;
    /* Yellow for favorites icon */
}

.category-item[data-category="favorites"].active .category-icon svg {
    color: #fef08a;
    fill: #eab308;
}

/* Favorite Toggle Button on Song Card */
.song-card-favorite-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    /* Moved to left as requested (replacing built-in indicator) */
    right: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
    z-index: 10;
}



.song-card-favorite-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fbbf24;
    transform: scale(1.1);
}

.song-card-favorite-btn.active {
    color: #fbbf24;
    /* Yellow */
    fill: #fbbf24;
    /* Filled */
}

.song-card-favorite-btn svg {
    width: 16px;
    height: 16px;
}

/* Exercises Sidebar Items */
.sidebar-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.sidebar-category-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-category-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    border-left: 3px solid #6366f1;
}

.sidebar-category-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-category-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.sidebar-category-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-category-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-category-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   Marketplace Styles
   ======================================== */

/* Market section highlight */
.market-section .category-item {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.market-section .category-item:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border-color: rgba(139, 92, 246, 0.4);
}

.market-section .category-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
    border-color: #8b5cf6;
}

.market-icon svg {
    color: #a78bfa;
}

/* Market Song Card */
.market-song-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.market-song-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Market Card Image Area */
.market-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #2a2a3d, #1a1a2d);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.market-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-card-image .placeholder-icon {
    color: rgba(255, 255, 255, 0.2);
}

.market-card-image .difficulty-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    bottom: auto;
    z-index: 1;
    padding: 4px 10px;
    height: auto;
}

/* Preview button on hover */
.market-card-image .preview-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: white;
}

.market-song-card:hover .preview-btn {
    opacity: 1;
}

.market-card-image .preview-btn:hover {
    background: #8b5cf6;
    transform: scale(1.1);
}

/* Market Card Info */
.market-card-info {
    padding: 10px 12px;
}

.market-song-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.market-song-artist {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Market Card Footer */
.market-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.market-uploader {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.market-uploader:hover {
    opacity: 0.8;
}

.market-uploader-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.market-uploader-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-uploader-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Downloads badge in footer */
.market-downloads {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.market-downloads svg {
    width: 10px;
    height: 10px;
}

/* Add button in footer */
.market-card-footer .market-action-btn.add {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    transition: all 0.2s;
    flex-shrink: 0;
}

.market-card-footer .market-action-btn.add:hover {
    background: rgba(34, 197, 94, 0.3);
    transform: scale(1.1);
}

.market-action-btn.favorite {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.market-action-btn.favorite:hover {
    background: rgba(239, 68, 68, 0.2);
}

.market-action-btn.add {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.market-action-btn.add:hover {
    background: rgba(34, 197, 94, 0.2);
}

/* Popularity sort option */
.library-sort-select option[value="popularity"] {
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
}

/* ========================================
   Share to Market Modal
   ======================================== */

.share-market-modal {
    max-width: 450px;
    text-align: center;
    padding: 0 !important;
}

.share-market-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.2));
    border-radius: 12px 12px 0 0;
    margin: 0;
}

.share-market-body {
    padding: 20px 28px 28px 28px;
}

.share-market-header svg {
    color: #a78bfa;
}

.share-market-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 600;
}

.share-market-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.share-market-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.share-preview-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3b3b5c, #252540);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(167, 139, 250, 0.6);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.share-preview-icon svg {
    width: 36px;
    height: 36px;
}

.share-preview-info {
    flex: 1;
    min-width: 0;
}

.share-preview-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.share-preview-artist {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.share-difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.share-market-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    text-align: left;
}

.share-market-notice svg {
    color: #a78bfa;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Enhanced modal buttons for Share */
.share-market-modal .modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.share-market-modal .btn-primary {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    transition: all 0.2s;
}

.share-market-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

.share-market-modal .btn-ghost {
    padding: 12px 20px;
}

/* Share Option Button Hover Effects */
.share-option-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.share-option-btn:hover svg:last-child {
    color: rgba(255, 255, 255, 0.6);
    transform: translateX(4px);
}

#shareToMarketBtn:hover {
    border-color: rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.1) 100%);
}

#shareToExerciseBtn:hover {
    border-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.1) 100%);
}