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

:root {
    --font-persian: 'Vazirmatn', sans-serif;
    --font-english: 'Poppins', sans-serif;
}

*:not(i) {
    font-family: var(--font-persian);
}

body {
    background-color: #121212;
    color: #fff;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    margin-right: 20px;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border-radius: 20px;
    border: none;
    background-color: #282828;
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-english);
}

.search-bar i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.explore-section {
    display: flex;
    justify-content: center;
    padding: 1rem;
    margin-bottom: 200px;
}

.explore-link {
    background-color: #1DB954;
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.explore-link:hover {
    background-color: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.explore-link i {
    font-size: 1.2rem;
}

.tracks-container, .users-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: calc(1rem + 200px);
}

.users-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding-bottom: 1rem;
}

.user-card {
    background-color: #282828;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.user-card:hover {
    transform: translateY(-5px);
    background-color: #333;
}

.user-card .user-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
}

.user-card .user-info {
    margin-bottom: 1.5rem;
}

.user-card .user-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.user-card .user-username {
    color: #b3b3b3;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.user-card .user-tracks-count {
    color: #1DB954;
    font-size: 0.9rem;
}

.user-card .view-tracks-btn {
    background-color: #1DB954;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-card .view-tracks-btn:hover {
    background-color: #1ed760;
}

.user-card.error {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
    color: #ff5555;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background-color: #282828;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.track-item.skeleton {
    cursor: default;
}

.track-item.skeleton .track-thumbnail {
    background: linear-gradient(90deg, #282828 0%, #383838 50%, #282828 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.track-item.skeleton .track-title,
.track-item.skeleton .track-artist {
    background: linear-gradient(90deg, #282828 0%, #383838 50%, #282828 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent;
    border-radius: 4px;
}

.track-item.skeleton .track-title {
    width: 70%;
    height: 1rem;
}

.track-item.skeleton .track-artist {
    width: 40%;
    height: 0.8rem;
}

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

.track-item.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}

.track-item.loading::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid transparent;
    border-top-color: #1db954;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

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

.track-item:hover {
    background-color: #383838;
}

.track-item.playing {
    background-color: #383838;
}

.track-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    margin-right: 1rem;
    object-fit: cover;
    background-color: #383838;
}

.track-thumbnail.error {
    filter: grayscale(1) opacity(0.7);
}

.track-info {
    flex: 1;
}

.track-title {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: #fff;
}

.track-artist {
    font-size: 0.8rem;
    color: #888;
}

.player-container {
    background-color: rgba(40, 40, 40, 0.8);
    padding: 0.5rem;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}

.player-container.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: #282828;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #fff;
}

.modal-message {
    color: #b3b3b3;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-button {
    background-color: #1DB954;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-button:hover {
    background-color: #1ed760;
}

.song-info {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(64, 64, 64, 0.5);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.progress-bar:hover {
    height: 8px;
}

.progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #1db954, #1ed760);
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress::after {
    opacity: 1;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
    width: 100%;
}

.current-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 1rem;
    object-fit: cover;
    background-color: #383838;
}

.current-thumbnail.error {
    filter: grayscale(1) opacity(0.7);
}

.song-details {
    flex: 1;
}

.current-song-title {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.current-song-artist {
    font-size: 0.9rem;
    color: #888;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.control-btn:hover {
    background-color: #383838;
}

.play-btn {
    font-size: 1.8rem;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.play-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn:hover {
    background-color: #383838;
    transform: scale(1.05);
}

.control-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.control-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}