/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 2rem;
    color: #4fc3f7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.storage-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.btn-small {
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #1976d2;
}

/* Player Section */
.player-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
}

.album-art {
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, #2196f3, #4fc3f7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    flex-shrink: 0;
}

.track-info {
    flex: 1;
}

.track-info h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: #fff;
}

.track-info p {
    color: #b0b0b0;
    margin-bottom: 15px;
}

.progress-container {
    margin-top: 15px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background: #2196f3;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #b0b0b0;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.play-btn {
    background: #2196f3;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
}

.play-btn:hover {
    background: #1976d2;
    transform: scale(1.05);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 30px;
}

.volume-control i {
    color: #4fc3f7;
}

#volumeSlider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2196f3;
    cursor: pointer;
}

/* Library Section */
.library-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #4fc3f7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border-radius: 25px;
    width: 250px;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: #b0b0b0;
}

.sort-select {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Music List */
.music-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.music-list::-webkit-scrollbar {
    width: 8px;
}

.music-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.music-list::-webkit-scrollbar-thumb {
    background: #2196f3;
    border-radius: 4px;
}

.music-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.music-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(33, 150, 243, 0.3);
    transform: translateY(-2px);
}

.music-item.active {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196f3;
}

.music-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #2196f3, #4fc3f7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.music-details {
    flex: 1;
    min-width: 0;
}

.music-details h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-details p {
    font-size: 0.85rem;
    color: #b0b0b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: #b0b0b0;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.action-btn.delete:hover {
    color: #f44336;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #b0b0b0;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state .small {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Offline Status */
.offline-status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(244, 67, 54, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

.offline-status.show {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .now-playing {
        flex-direction: column;
        text-align: center;
    }

    .player-controls {
        flex-wrap: wrap;
        gap: 15px;
    }

    .volume-control {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .music-list {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #2196f3;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(33, 150, 243, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
