/* Bottom Sheet Styles - Bootstrap Variables */
.playlist-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.playlist-bottom-sheet.open {
    visibility: visible;
    opacity: 1;
}

.bottom-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bs-body-bg);
    border-radius: 1rem 1rem 0 0;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.playlist-bottom-sheet.open .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-header {
    padding: 1rem 1rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}
.bottom-sheet-header h3{font-size: 20px;}

.bottom-sheet-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* Bottom Sheet List Items */
.playlists-list {
    margin-bottom: 1rem;
}

.playlist-item {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    padding: 0.5rem 0rem;
    border-radius: var(--bs-border-radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}


.playlist-item.in-playlist {

}

.playlist-item-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--bs-primary);
    flex-shrink: 0;
}

.playlist-item.in-playlist .playlist-item-checkbox {
    border-color: var(--bs-success);
    background: var(--bs-success);
    color: var(--bs-white);
}

.playlist-item-info {
    flex: 1;
}

.playlist-item-name {
    font-weight: 500;
    color: var(--bs-body-color);
}

.playlist-item-count {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

/* Create Playlist Section */
.create-playlist-section {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.new-playlist-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    font-size: 0.875rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    outline: none;
}

.create-playlist-btn {
    background: var(--bs-primary);
    color: var(--bs-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--bs-border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background-color 0.2s;
    font-weight: 600;
}


.create-playlist-btn:disabled {
    background: var(--bs-secondary);
    cursor: not-allowed;
}

/* Loading and Error States */
.loading-playlists,
.error-loading,
.no-playlists {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--bs-secondary-color);
    font-style: italic;
}

.error-loading {
    color: var(--bs-danger);
}

/* Drag Handle */
.drag-handle {
    width: 2.5rem;
    height: 0.25rem;
    background: var(--bs-secondary);
    border-radius: 0.125rem;
    margin: 0 auto 0.75rem auto;
}
.bottom-sheet-header .drag-handle::before{display: none;}

/* Close Button */
.close-sheet {
    position: absolute;
    top: 1.5rem;
    right: 0.7rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--bs-secondary-color);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-sheet:hover {
    background: var(--bs-light);
    color: var(--bs-body-color);
}

/* Prevent body scroll when bottom sheet is open */
body.playlist-bottom-sheet-open {
    overflow: hidden;
}

/* Responsive */
@media (min-width: 768px) {
    .bottom-sheet-content {
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        width: 400px;
        max-width: 90vw;
        border-radius: var(--bs-border-radius);
    }
    
    .playlist-bottom-sheet.open .bottom-sheet-content {
        transform: translateX(-50%) translateY(0);
    }
}


@media (min-width: 1199px) {
    .playlist-bottom-sheet.open .bottom-sheet-content {
        transform: translateX(-50%) translateY(0) !important;
        top: 35%;
        bottom: 0;
        height: max-content;
        width: 600px;
    }
}