/* Layout Styles */

.app-container {
    display: grid;
    grid-template-areas:
        "sidebar main"
        "player player";
    grid-template-columns: 280px 1fr;
    grid-template-rows: 1fr 72px;
    height: 100vh;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background-color: var(--bg-primary);
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    overflow-y: auto;
    z-index: var(--z-sidebar);
}

.sidebar-header {
    margin-bottom: var(--spacing-xl);
}

.logo i {
    cursor: pointer;
    font-size: 32px;
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.nav-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.nav-section .section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
}

.nav-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

/* Change views as Library-content */
.library-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.library-content.compact-list .item-icon {
    display: none;
}

.library-content.compact-list .item-subtitle {
    display: none;
}
.library-content.compact-list .item-image {
    display: none;
}

.library-content.compact-grid {
    flex-direction: row;
    flex-wrap: wrap;
}

.library-content.compact-grid .item-subtitle {
    display: none;
}

.library-content.compact-grid .item-info {
    display: none;
}

.library-content.compact-grid .item-title {
    display: none;
}

.library-content.compact-grid .item-image,
.library-content.compact-grid .item-icon {
    width: 100%;
    height: 88px;
    background-color: var(--bg-secondary);
}

.library-content.compact-grid .library-item {
    flex-basis: 48%;
}

.library-content.compact-grid .library-item.active {
    background-color: var(--bg-secondary);
}

.library-content.default-grid {
    flex-direction: row;
    flex-wrap: wrap;
}

.library-content.default-grid .library-item {
    flex-direction: column;
    flex-basis: 48%;
    align-items: flex-start;
    gap: 4px;
}

.library-content.default-grid .item-title {
    font-size: 12px;
}

.library-content.default-grid .item-subtitle {
    font-size: 10px;
}

.library-content.default-grid .item-image,
.library-content.default-grid .item-icon {
    width: 100%;
    height: 88px;
}

.library-content.default-grid .library-item.active {
    background-color: var(--bg-secondary);
}

/* Main Content */
.main-content {
    grid-area: main;
    background: linear-gradient(
        to bottom,
        #535353 0%,
        var(--bg-secondary) 250px
    );
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: transparent;
    z-index: var(--z-header);
}

.search-container {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    max-width: 420px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.auth-buttons {
    display: flex; /*Flex*/
    align-items: center;
    gap: var(--spacing-md);
}

.auth-buttons.hide {
    display: none;
}

.content-wrapper {
    position: relative;

    flex: 1;
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    overflow-y: auto;
}

/* Player */
.player {
    grid-area: player;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: var(--z-player);
    border-top: 1px solid var(--border-color);
}

.player-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
    flex: 1;
    max-width: 300px;
}

.player-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

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

.player-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.player-artist {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 2;
    max-width: 722px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.control-btn {
    position: relative;
}

.tool-tip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    min-width: 0;
    white-space: nowrap;
    font-size: 14px;
    padding: 3px 8px;
    color: #fff;
    font-weight: 500;
    background-color: var(--bg-hover);
    border-radius: 5px;
    margin-bottom: 20px;
    z-index: 100;
}

.tool-tip-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-50%);
    display: none;
    min-width: 0;
    white-space: nowrap;
    font-size: 14px;
    padding: 3px 8px;
    color: #fff;
    font-weight: 500;
    background-color: var(--bg-hover);
    border-radius: 5px;
    margin-left: 10px;
    z-index: 10000;
}

.create-btn {
    position: relative;
}

.create-btn .plus-icon {
    rotate: 0;
    transition: rotate ease 0.3s;
}

.create-btn .plus-icon.active {
    rotate: 45deg;
}

.tool-tip.full-screen {
    transform: translateX(-80%);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
}

.progress-bar {
    flex: 1;
}

.time {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
    font-weight: 400;
}

.player-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    justify-content: flex-end;
    max-width: 300px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.volume-bar {
    width: 93px;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
    background-clip: content-box;
}

.dropdown {
    display: none;
    position: absolute;
    background-color: #252525;
    border-radius: 6px;
    width: 200px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.section-title {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 6px;
}

.option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.option:hover {
    background-color: #333;
}

.option.active {
    color: #00ff88;
    font-weight: bold;
}

.check-icon {
    visibility: hidden;
    color: #00ff88;
}

.option.active .check-icon {
    visibility: visible;
}

hr {
    border: none;
    border-top: 1px solid #444;
    margin: 10px 0;
}

.view-options {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.view-btn {
    flex: 1;
    padding: 8px;
    background-color: #333;
    border: none;
    color: #aaa;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
}

.view-btn.active {
    background-color: #444;
    color: #00ff88;
}

.modal-create-playlist {
    width: 260px;
    background-color: #181818;
    border-radius: 8px;
}

.modal-create-playlist.active {
    position: absolute;
    top: 123px;
    left: 167px;
    z-index: 1000;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-item:hover {
    background-color: #282828;
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
    color: white;
}

.menu-text {
    display: flex;
    flex-direction: column;
}

.menu-title {
    font-weight: bold;
    font-size: 14px;
}

.menu-desc {
    font-size: 12px;
    color: #a7a7a7;
}

.divider {
    height: 1px;
    background-color: #282828;
    margin: 4px 0;
}

/* Context menu */
.context-my-playlist,
.context-my-followed,
.liked-playlists {
    display: none;
}

.context-my-playlist.show,
.context-my-followed.show,
.liked-playlists.show {
    display: block;
}

.context-artist {
    display: none;
}

.context-artist.show {
    display: block;
}

.menu-item:hover {
    background-color: #5f5e5e;
    border-radius: 4px;
}

/* Detail create */
.detail-create {
    background: linear-gradient(to bottom, #2a2a2a, #121212);
    color: white;
    padding: 20px;
    font-family: "Circular", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all ease 0.3s;
    overflow-y: auto; /* thanh cuộn dọc */
}

.detail-create.show {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 24px;
}

/* Header */
.detail-create .header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.detail-create .cover {
    width: 180px;
    height: 180px;
    background: #282828;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #b3b3b3;
}

.detail-create .info .type {
    font-size: 14px;
    color: #b3b3b3;
    margin-bottom: 5px;
}

.detail-create .info .name {
    font-size: 48px;
    font-weight: bold;
    margin: 0;
    cursor: pointer;
}

.detail-create .info .owner {
    font-size: 14px;
    color: #b3b3b3;
}

/* Controls */
.detail-create .controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
}

.detail-create .controls .left {
    display: flex;
    gap: 15px;
}

.detail-create .controls button {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 18px;
    cursor: pointer;
}

.detail-create .controls button:hover {
    color: white;
}

.detail-create .controls .right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-create .controls .view-label {
    font-size: 14px;
    color: #b3b3b3;
}

/* Search Section */
.detail-create .search-section {
    border-top: 1px solid #333;
    padding-top: 20px;
}

.detail-create .search-section .title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.detail-create .search-box {
    background: #282828;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
}

.detail-create .search-box i {
    color: #b3b3b3;
    margin-right: 8px;
}

.detail-create .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 14px;
}

.detail-create .search-box .clear {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 16px;
    cursor: pointer;
}

.detail-create .search-box .clear:hover {
    color: white;
}

/* Empty Placeholder */
.detail-create .empty-placeholder {
    height: 200px;
}

.edit-info-playlist {
    display: none;
}

.edit-info-playlist.show {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-25%, -70%);
}
