/* Basic styling for the tree view */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.container-main {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tree ul.root-list {
    display: block; /* Root list should always be visible */
}

.tree ul.tracks-list {
    display: none; /* Hidden by default */
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid #4B5563; /* gray-600 */
}

.tree li {
    list-style: none;
    margin: 0.5rem 0;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.tree .playlist-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.tree .playlist-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.tree .playlist-item:hover .playlist-name {
    color: #60A5FA;
}

.tree .playlist-item:active {
    transform: scale(0.98);
}

/* Triangle toggle icon */
.toggle {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 10px; /* Triangle shape */
    border-color: transparent transparent transparent #9CA3AF; /* gray-400 */
    transition: transform 0.3s ease;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Rotated state for the toggle when expanded */
.tree .playlist-item.expanded .toggle {
    transform: rotate(90deg);
}

.tree .track-item {
    color: #D1D5DB; /* gray-300 */
    font-size: 0.9rem;
    padding: 0.5rem 0 0.5rem 1.25rem;
    position: relative;
    transition: color 0.2s ease;
}

.tree .track-item:hover {
    color: #F3F4F6;
}

/* Small line connecting the track to the playlist branch */
.tree .track-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.9rem;
    width: 0.75rem;
    height: 1px;
    background-color: #4B5563; /* gray-600 */
}

/* Simple loader animation */
.loader {
    border: 4px solid #374151; /* gray-700 */
    border-top: 4px solid #3B82F6; /* blue-500 */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button animations */
button {
    position: relative;
    overflow: hidden;
}

button:active {
    transform: scale(0.98);
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

/* Status message animations */
.status-message {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar */
.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899);
    background-size: 200% 100%;
    animation: progressMove 2s linear infinite;
}

@keyframes progressMove {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #1F2937;
    color: #F3F4F6;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Card hover effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1F2937;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #4B5563;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

