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

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* Контейнер */
.container {
    display: grid;
    grid-template-rows: 70px 1fr 90px;
    grid-template-areas:
        "header"
        "main"
        "player";
    height: 100vh;
    background-color: #1a1a1a;
}

.main-content {
    background-color: #1a1a1a;
}

.player {
    grid-area: player;
    background-color: #181818; /* перекрывает чёрный фон */
    border-top: 1px solid #282828;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player.visible {
    transform: translateY(0);
}

.top-bar {
    grid-area: header;
    background-color: #121212;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #282828;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.name {
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-menu a {
    color: #b3b3b3;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: #ffffff;
}

.main-content {
    grid-area: main;
    background-color: #1a1a1a;
    padding: 40px;
    overflow-y: auto;
}

.project-info {
    display: flex;
    justify-content: center;
}

.info-card {
    background: linear-gradient(135deg, #282828 0%, #1a1a1a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px #000000;
    max-width: 900px;
    width: 100%;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.info-header h2 {
    font-size: 28px;
    color: #ffffff;
}

.badge {
    background-color: #7b2cbf;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-text {
    font-size: 16px;
    line-height: 1.6;
    color: #cccccc;
}

.track-info {
    display: flex;
    align-items: center;
    width: 30%;
    min-width: 220px;
    gap: 12px;
}

.track-cover {
    width: 56px;
    height: 56px;
    background-color: #333;
    border-radius: 4px;
    flex-shrink: 0;
}

.track-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.track-name-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.track-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    color: #b3b3b3;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
}

.player-menu-trigger,
.track-actions .like-button {
    background: none;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    width: 32px;
    height: 32px;
}

.track-actions .like-button {
    font-size: 16px;
}

.player-menu-trigger:hover,
.track-actions .like-button:hover {
    color: #fff;
}

.track-actions .like-button.liked i {
    color: #7b2cbf;
}

/* Меню в плеере */
.player-context-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 8px 20px #00000066;
    z-index: 1000;
    min-width: 200px;
    display: none;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #3e3e3e;
}

.player-context-menu.active {
    display: block;
}

.player-context-menu button {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: background 0.2s ease;
}

.player-context-menu button:hover {
    background: #3a3a3a;
}

.player-context-menu button i {
    width: 20px;
    color: #9d4edd;
    font-size: 14px;
}

/* Кнопка лайка */
.track-info .like-button {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin-left: auto;
}

.track-info .like-button.liked i {
    color: #7b2cbf;
}

.like-button:hover {
    color: #fff;
    transform: scale(1.1);
}

.like-button:active {
    transform: scale(0.9);
}

/* Контролы плеера */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    max-width: 722px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 8px;
}

.control-button {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-button:hover {
    color: #fff;
    transform: scale(1.05);
}

.play-pause-button {
    background-color: #ffffff;
    color: #000000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, background-color 0.2s;
}

.play-pause-button:hover {
    transform: scale(1.1);
    background-color: #f0f0f0;
    color: #000000;
}

.play-pause-button i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.progress-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    padding: 0;
}

.time {
    color: #a7a7a7;
    font-size: 13px;
    min-width: 35px;
    text-align: center;
}

.progress-bar, .volume-bar {
    height: 4px;
    background-color: #535353;
    border-radius: 2px;
    width: 100%;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

.progress-fill, .volume-fill {
    height: 100%;
    background-color: #b3b3b3;
    border-radius: 2px;
}

.progress-handle, .volume-handle {
    width: 12px;
    height: 12px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    transform: translateX(-50%);
    opacity: 0;
    box-shadow: 0 2px 4px #000000;
}

.progress-handle { left: 35%; }
.volume-handle { left: 70%; }

.progress-bar:hover .progress-fill, 
.volume-bar:hover .volume-fill {
    background-color: #7b2cbf;
}

.progress-bar:hover .progress-handle,
.volume-bar:hover .volume-handle {
    opacity: 1;
}

.player-settings {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30%;
    min-width: 180px;
    gap: 16px;
}

.volume-control {
    display: flex;
    align-items: center;
    width: 100px;
    gap: 8px;
}

.volume-button {
    color: #b3b3b3;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
}

.volume-button:hover {
    color: #fff;
}

/* Аутентификация */
.auth-box, .profile-card {
    background: #181818;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
    box-shadow: 0 10px 30px #000000;
}

.auth-box h2, .profile-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
}

.auth-button {
    background: #7b2cbf;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: bold;
}

.auth-button:hover { 
    background: #9d4edd;
    color: #fff;
    border-color: #fff;
    transform: scale(1.05);
}

.auth-box input {
    display: block;
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    background: #282828;
    border: 1px solid transparent;
    color: white;
    border-radius: 4px;
}

.profile-card {
    max-width: 500px;
    margin: 50px auto;
    border: 1px solid #282828;
}

.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.avatar-big {
    font-size: 100px;
    color: #7b2cbf;
}

.edit-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #9d4edd;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 3px solid #181818;
    cursor: pointer;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #282828;
    border-bottom: 1px solid #282828;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.stat-label {
    font-size: 12px;
    color: #888;
}

.logout-button {
    background: #7b2cbf;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: bold;
}

.logout-button:hover { 
    background: #9d4edd; 
}

.secondary-button {
    background-color: transparent;
    color: #b3b3b3;
    border: 1px solid #b3b3b3;
    padding: 10px 30px;
    border-radius: 500px;
    cursor: pointer;
    font-weight: bold;
}

.secondary-button:hover {
    color: #fff;
    border-color: #fff;
    transform: scale(1.05);
}

/* Медиатека */
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    padding: 0 10px;
}

.library-header h2 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.subtitle {
    color: #b3b3b3;
    font-size: 0.9rem;
}

.library-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.filter-tag {
    background: #282828;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
}

.filter-tag:hover { 
    background: #3e3e3e; 
}

.filter-tag.active { 
    background: #fff; color: #000; 
}

.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    padding: 10px;
}

/* Карточки треков */
.track-card {
    background: #181818;
    padding: 16px;
    border-radius: 12px;
    transition: background 0.3s ease;
    cursor: pointer;
    text-align: center;
    position: relative;
}

.track-card:hover {
    background: #282828;
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px #000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fa-music {
    color: #7b2cbf;
    font-size: 60px;
}

.track-title-text {
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    padding-bottom: 5px;
    text-overflow: ellipsis;
    text-align: center;
}

.track-author {
    color: #b3b3b3;
    font-size: 0.9em;
    text-align: center;
    pointer-events: none;
}

/* Кнопка меню на карточке */
.track-menu-trigger {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.track-menu-trigger:hover {
    background: #7b2cbf;
}

/* Контекстное меню на карточке */
.track-context-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 8px 20px #00000066;
    z-index: 100;
    width: 100%;
    min-width: auto;
    display: none;
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid #3e3e3e;
}

.track-context-menu.active {
    display: block;
}

.track-context-menu button {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: background 0.2s ease;
}

.track-context-menu button:hover {
    background: #3e3e3e;
}

.track-context-menu button i {
    width: 20px;
    color: #9d4edd;
    font-size: 14px;
}

.delete-track-btn i {
    color: #9b2c3d;
}

/* Пустые состояния */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #b3b3b3;
    text-align: center;
}

.empty-state i {
    font-size: 80px;
    color: #282828;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    max-width: 300px;
    line-height: 1.5;
}

/* Кнопки действий */
.add-track-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    color: white;
    border: 2px solid #7b2cbf;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
}

.add-track-button:hover {
    background-color: #7b2cbf;
    transform: scale(1.05);
}

/* Плейлисты */
.playlist-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
}

.play-playlist-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 5;
    backdrop-filter: blur(2px);
}

.track-card:hover .play-playlist-button {
    opacity: 1;
}

.play-playlist-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-playlist-button i {
    font-size: 18px;
    margin-left: 3px;
}

/* Модалки */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000CC;
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    gap: 25px;
    background: #181818;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.upload-form-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.upload-box h3 {
    margin: 0;
    text-align: center;
}

.input-group {
    width: 100%;
    max-width: 320px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: #282828;
    border: 1px solid #3e3e3e;
    border-radius: 8px;
    color: white;
}

.file-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.custom-file-upload {
    width: 60px;
    height: 60px;
    background-color: #7b2cbf;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.custom-file-upload i {
    color: white;
    font-size: 24px;
}

.custom-file-upload:hover {
    transform: scale(1.1);
    background-color: #9d4edd;
}

#file-name-display,
#cover-name-display,
#edit-cover-name-display  {
    color: #b3b3b3;
    font-size: 0.85rem;
    text-align: left;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.form-actions {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sort-button {
    background: #282828;
    border: none;
    color: #b3b3b3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.sort-button:hover {
    background: #3e3e3e;
    color: #fff;
}

.sort-button:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #282828;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    border: 1px solid #3e3e3e;
}

.sort-button.active {
    background: #7b2cbf;
    color: #fff;
}

.sort-button i {
    font-size: 16px;
}

/* Список треков для плейлиста */
.playlist-track-list {
    width: 100%;
    max-width: 450px;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 12px;
    background: #121212;
    margin: 10px 0;
}

.playlist-track-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #282828;
}

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

.playlist-track-item:hover {
    background: #282828;
}

.playlist-track-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.playlist-track-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-track-artist {
    font-size: 12px;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-track-item input[type="checkbox"] {
    display: none;
}

.playlist-track-item .custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #555;
    border-radius: 6px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.playlist-track-item .custom-checkbox i {
    font-size: 12px;
    color: white;
    opacity: 0;
}

.playlist-track-item input[type="checkbox"]:checked + .custom-checkbox {
    background: #7b2cbf;
    border-color: #7b2cbf;
}

.playlist-track-item input[type="checkbox"]:checked + .custom-checkbox i {
    opacity: 1;
}

.playlist-track-item:hover .custom-checkbox {
    border-color: #7b2cbf;
}

/* Очередь */
.queue-overlay {
    position: fixed;
    bottom: 110px;
    right: -420px;
    width: 340px;
    max-height: 50vh;
    background: #121212;
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid #32194a;
    padding: 20px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
}

.queue-overlay.active {
    right: 20px;
    opacity: 1;
    pointer-events: all;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #1a1a1a;
}

.queue-list {
    margin-top: 10px;
    overflow-y: auto;
}

.queue-list::-webkit-scrollbar {
    width: 4px;
}

.queue-list::-webkit-scrollbar-thumb {
    background: #32194a;
    border-radius: 10px;
}

.queue-item {
    cursor: pointer;
    display: flex;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.queue-item:hover {
    background: #32194a;
}

.queue-item.current {
    color: #a855f7;
    background: #32194a;
    font-weight: bold;
}

.cover-preview {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.cover-preview img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px #000000;
}

.cover-preview p {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

/* Кнопка закрытия модалки */
.modal-close-button {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-button:hover {
    color: #fff;
    transform: scale(1.1);
}

.playlist-simple-list {
    background: #121212;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
}

.playlist-simple-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #282828;
    transition: background 0.2s;
}

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

.playlist-simple-item:hover {
    background: #282828;
}

.playlist-simple-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #7b2cbf;
    cursor: pointer;
}

.playlist-simple-item .playlist-icon {
    width: 24px;
    text-align: center;
    color: #7b2cbf;
    font-size: 16px;
    flex-shrink: 0;
}

.playlist-simple-item .playlist-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#add-to-playlist-track-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    padding: 8px 0;
    border-bottom: 1px solid #282828;
    margin-bottom: 12px;
    line-height: 1.4;
}
#add-to-playlist-track-name span {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #121212;
}

::-webkit-scrollbar-thumb {
    background: #4f4f4f;
    border-radius: 6px;
    border: 3px solid #121212;
}

::-webkit-scrollbar-thumb:hover {
    background: #7b2cbf;
}

.swal2-container {
    z-index: 99999 !important;
}

.repeat-button, .shuffle-button {
    transition: color 0.3s ease;
    cursor: pointer;
}