/* Global Styles */
:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f1f1f1;
    
    --primary-color: #2481cc;
    --secondary-color: #f1f1f1;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--tg-theme-bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tg-theme-secondary-bg-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.version {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 400;
    background-color: rgba(255,255,255,0.15);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    cursor: help;
    transition: var(--transition);
}

.version:hover {
    opacity: 0.9;
    background-color: rgba(255,255,255,0.25);
}

.user-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background-color: var(--tg-theme-secondary-bg-color);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.nav-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--tg-theme-hint-color);
    transition: var(--transition);
    position: relative;
}

.nav-tab i {
    font-size: 1.25rem;
}

.nav-tab span {
    font-size: 0.875rem;
}

.nav-tab.active {
    color: var(--primary-color);
    background-color: var(--tg-theme-bg-color);
}

.queue-badge {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 56px; /* Space for bottom nav */
}

.tab-pane {
    padding: 1rem;
}

/* Upload Notice */
.upload-notice {
    margin-bottom: 1rem;
}

.notice-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.notice-card i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.notice-card h3 {
    margin: 0.5rem 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.notice-card p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Search Bar */
.search-bar {
    margin-bottom: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

/* Songs List */
.songs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.song-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.song-item.playing {
    background-color: var(--primary-color);
    color: white;
}

.song-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-right: 1rem;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.song-info {
    flex: 1;
}

.song-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.song-artist {
    font-size: 0.875rem;
    opacity: 0.7;
}

.song-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--primary-color);
}

.action-btn.like-btn {
    transition: all 0.3s ease;
}

.action-btn.like-btn.liked {
    color: #ff4757;
}

.action-btn.like-btn:hover {
    color: #ff4757;
    transform: scale(1.1);
}

/* Likes Tab */
.likes-header {
    margin-bottom: 1.5rem;
}

.likes-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--tg-theme-text-color);
}

.tab-menu {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab-menu-btn {
    padding: 0.5rem 1rem;
    background: var(--tg-theme-secondary-bg-color);
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-menu-btn:hover {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.tab-menu-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Playlists */
.playlist-header {
    margin-bottom: 1rem;
}

.playlists-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.playlist-item {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.playlist-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.playlist-cover {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 0.75rem;
}

.playlist-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.playlist-count {
    font-size: 0.875rem;
    color: var(--tg-theme-hint-color);
}

/* Upload Form */
.upload-container {
    max-width: 500px;
    margin: 0 auto;
}

.upload-form {
    background-color: var(--tg-theme-secondary-bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.upload-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--tg-theme-bg-color);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--tg-theme-hint-color);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1e6ba8;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1.5rem;
}

.progress-bar {
    height: 8px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--tg-theme-hint-color);
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--tg-theme-bg-color);
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 1rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.minimize-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
}

.minimize-btn:hover {
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.player-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

#player-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-right: 1rem;
}

.player-details h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.player-details p {
    font-size: 0.875rem;
    color: var(--tg-theme-hint-color);
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
    padding-right: 50px; /* Add space for speed button */
}

.player-progress span {
    font-size: 0.75rem;
    color: var(--tg-theme-hint-color);
    min-width: 35px;
}

.speed-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid var(--tg-theme-hint-color);
    color: var(--tg-theme-hint-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}

.speed-btn:hover,
.speed-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#seek-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--tg-theme-secondary-bg-color);
    outline: none;
    cursor: pointer;
}

#seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    width: 100%;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--tg-theme-text-color);
    font-size: 1.25rem;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn.main {
    width: 48px;
    height: 48px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.control-btn.small {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    opacity: 0.7;
}

.control-btn.active {
    color: var(--primary-color);
    opacity: 1;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn i {
    pointer-events: none;
    display: block;
    line-height: 1;
}

/* Repeat one indicator */
.control-btn span {
    position: absolute;
    top: -2px;
    right: -2px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    position: relative;
}

.volume-slider-container {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    background-color: var(--tg-theme-bg-color);
    border: 1px solid var(--tg-theme-secondary-bg-color);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.volume-control:hover .volume-slider-container {
    opacity: 1;
    visibility: visible;
}

#volume-slider {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--tg-theme-secondary-bg-color);
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--tg-theme-bg-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    padding: 1rem;
    background-color: var(--tg-theme-secondary-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-content.modal-large {
    max-width: 600px;
}

/* Playlist Selection in Modal */
.playlist-selection {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.playlist-select-item {
    padding: 0.75rem;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.playlist-select-item:hover {
    background-color: var(--primary-color);
    color: white;
}

.playlist-select-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.playlist-select-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-select-item:hover .playlist-select-icon {
    background-color: rgba(255,255,255,0.2);
}

.playlist-create-option {
    border-top: 1px solid var(--tg-theme-secondary-bg-color);
    padding-top: 1rem;
}

/* Button variants */
.btn-secondary {
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Playlist Details */
.playlist-meta {
    margin: 0;
    color: var(--tg-theme-hint-color);
    font-size: 0.875rem;
}

.playlist-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.playlist-songs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.playlist-song-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.playlist-song-item:hover {
    background-color: var(--primary-color);
    color: white;
}

.playlist-song-item:hover .song-artist,
.playlist-song-item:hover .action-btn {
    color: rgba(255,255,255,0.8);
}

.song-order {
    width: 24px;
    text-align: center;
    font-weight: 500;
    margin-right: 0.75rem;
    color: var(--tg-theme-hint-color);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--tg-theme-hint-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Queue Styles */
.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.queue-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.queue-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: move;
}

.queue-item.dragging {
    opacity: 0.5;
}

.queue-item.drag-over {
    background-color: var(--primary-color);
    color: white;
}

.queue-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.queue-item.playing {
    background-color: var(--primary-color);
    color: white;
}

.queue-number {
    width: 30px;
    text-align: center;
    font-weight: 500;
    color: var(--tg-theme-hint-color);
    margin-right: 0.75rem;
}

.queue-item.playing .queue-number,
.queue-item.playing .song-artist,
.queue-item.playing .action-btn {
    color: rgba(255,255,255,0.8);
}

.drag-handle {
    margin-right: 0.75rem;
    color: var(--tg-theme-hint-color);
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Queue Action Buttons */
.queue-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* Loading indicator for infinite scroll */
.loading-more {
    text-align: center;
    padding: 20px;
    color: var(--tg-theme-hint-color);
}

.loading-more i {
    margin-right: 8px;
}

/* Tab content scrollable for infinite scroll */
.tab-pane {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 360px) {
    .playlists-list {
        grid-template-columns: 1fr;
    }
    
    .library-quick-access {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .library-item {
        padding: 0.75rem 0.25rem;
    }
    
    .library-item-cover {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .library-item-info h4 {
        font-size: 0.75rem;
    }
    
    .library-item-info p {
        font-size: 0.625rem;
    }
    
    .library-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--tg-theme-bg-color);
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-nav .nav-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--tg-theme-hint-color);
    transition: var(--transition);
    position: relative;
    border-radius: var(--border-radius);
}

.bottom-nav .nav-tab i {
    font-size: 1.25rem;
}

.bottom-nav .nav-tab span {
    font-size: 0.75rem;
    font-weight: 500;
}

.bottom-nav .nav-tab.active {
    color: var(--primary-color);
}

.bottom-nav .nav-tab.active::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* Mini Player */
.mini-player {
    position: fixed;
    bottom: 56px; /* Height of bottom nav */
    left: 0;
    right: 0;
    background-color: var(--tg-theme-bg-color);
    border-top: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    transition: transform 0.3s ease;
}

.mini-player-content {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 0.75rem;
}

.mini-player img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

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

.mini-player-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-info p {
    font-size: 0.75rem;
    margin: 0;
    color: var(--tg-theme-hint-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-controls {
    display: flex;
    gap: 0.5rem;
}

.mini-player-controls .control-btn {
    background: none;
    border: none;
    color: var(--tg-theme-text-color);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.mini-player-controls .control-btn.small {
    font-size: 0.875rem;
}

.mini-player-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(0,0,0,0.1);
}

.mini-progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear;
}

/* Adjust main content for bottom navigation and players */
.tab-content {
    padding-bottom: 56px; /* Space for bottom nav */
}

/* When mini player is visible, add extra padding */
.mini-player-visible .tab-content {
    padding-bottom: 112px; /* Space for mini player + bottom nav */
}

/* When full player is visible, add extra padding */
.music-player:not([style*="display: none"]) ~ .bottom-nav {
    bottom: 0;
}

/* Home Tab Styles */
.home-header {
    text-align: center;
    padding: 2rem 0 1rem;
}

.greeting {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--tg-theme-text-color);
}

.home-subtitle {
    color: var(--tg-theme-hint-color);
    margin: 0;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.quick-action-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.3);
}

.quick-action-btn:nth-child(2) {
    background: linear-gradient(135deg, #e91e63, #f06292);
}

.quick-action-btn:nth-child(2):hover {
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.home-section {
    margin: 2rem 0;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary-color);
}

.see-all-link {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.horizontal-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.card-item {
    flex: 0 0 150px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.card-item:hover {
    transform: translateY(-2px);
}

.card-cover {
    width: 150px;
    height: 150px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 0.5rem;
    background-color: var(--tg-theme-secondary-bg-color);
    position: relative;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-cover .default-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 3rem;
}

/* Play overlay */
.card-play-overlay {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.card-play-overlay i {
    color: white;
    font-size: 0.875rem;
    margin-left: 2px; /* Center the play icon */
}

.card-item:hover .card-play-overlay {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.9);
}

/* Hover effect for desktop */
@media (hover: hover) {
    .card-cover::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .card-item:hover .card-cover::after {
        opacity: 1;
    }
}

.card-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info p {
    font-size: 0.75rem;
    color: var(--tg-theme-hint-color);
    margin: 0;
}

.song-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.song-item-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.song-item-compact:hover {
    background-color: rgba(36, 129, 204, 0.1);
}

.song-item-compact img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.song-item-compact-info {
    flex: 1;
    min-width: 0;
}

.song-item-compact-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item-compact-info p {
    font-size: 0.75rem;
    color: var(--tg-theme-hint-color);
    margin: 0;
}

/* Search Tab Styles */
.search-header {
    padding: 1rem 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--tg-theme-hint-color);
}

#global-search {
    width: 100%;
    padding: 1rem 3rem 1rem 2.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    font-size: 1rem;
    background-color: var(--tg-theme-secondary-bg-color);
    transition: var(--transition);
}

#global-search:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--tg-theme-bg-color);
}

.clear-search {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    padding: 0.5rem;
}

.search-results {
    padding: 1rem 0;
}

.search-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--tg-theme-hint-color);
}

.search-placeholder i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Library Tab Styles */
.library-header {
    margin-bottom: 1rem;
}

.library-header h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.library-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.library-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background-color: var(--tg-theme-secondary-bg-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.library-content {
    margin-top: 1.5rem;
}

.library-quick-access {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.library-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.library-item:hover {
    background-color: rgba(36, 129, 204, 0.1);
}

.library-item-cover {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.liked-songs-cover {
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: white;
}

.queue-cover {
    background: linear-gradient(135deg, #2196f3, #64b5f6);
    color: white;
}

.recent-cover {
    background: linear-gradient(135deg, #4caf50, #81c784);
    color: white;
}

.library-item-info h4 {
    margin: 0 0 0.125rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.library-item-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--tg-theme-hint-color);
}

.library-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* Profile Tab Styles */
.profile-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.profile-avatar {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#profile-username {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.profile-stats {
    color: var(--tg-theme-hint-color);
    font-size: 0.875rem;
}

.separator {
    margin: 0 0.5rem;
}

.profile-content {
    padding: 1rem 0;
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-section h3 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.storage-info {
    background-color: var(--tg-theme-secondary-bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.storage-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.storage-used {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.storage-text {
    font-size: 0.875rem;
    color: var(--tg-theme-hint-color);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--tg-theme-secondary-bg-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: left;
}

.setting-item:hover {
    background-color: rgba(36, 129, 204, 0.1);
}

.setting-item i:first-child {
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.setting-item span {
    flex: 1;
    font-weight: 500;
}

.setting-item i:last-child {
    color: var(--tg-theme-hint-color);
}

.about-info {
    text-align: center;
}

.app-version {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.app-description {
    color: var(--tg-theme-hint-color);
    margin-bottom: 1rem;
}

.channel-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* View Header (for sub-views) */
.view-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.back-btn {
    background: none;
    border: none;
    color: var(--tg-theme-text-color);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
}

.view-header h2 {
    flex: 1;
    margin: 0;
    font-size: 1.25rem;
}

/* Adjust music player to account for bottom nav */
.music-player {
    bottom: 56px !important; /* Space for bottom nav only */
    display: flex !important;
    flex-direction: column !important;
}

/* Hide full player when mini player is visible */
.mini-player-visible .music-player {
    display: none !important;
}

/* Animation for mini player */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mini-player-entering {
    animation: slideUp 0.3s ease-out;
}