:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --background: #0f0f1a;
    --surface: #1a1a2e;
    --surface-light: #252538;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --error: #ef4444;
    --success: #10b981;
    --shadow: rgba(99, 102, 241, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a1a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Filter Section */
.filter-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

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

.filter-header label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.clear-filters {
    padding: 0.4rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.clear-filters:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

.genre-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.genre-filter-item {
    display: flex;
    align-items: center;
}

.genre-checkbox {
    display: none;
}

.genre-label {
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.genre-label:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.genre-checkbox:checked + .genre-label {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.song-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Music List */
.music-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.8s ease;
}

.music-item {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.1);
    position: relative;
    overflow: hidden;
}

.music-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.music-item:hover::before {
    opacity: 0.1;
}

.music-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.music-item-content {
    position: relative;
    z-index: 1;
}

.music-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.music-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background-repeat: no-repeat;
}

.music-icon .artist-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.music-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.music-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.music-item-artist {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.genre-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
}

.music-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.music-duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lock-icon {
    color: var(--primary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.player-modal {
    max-width: 600px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-body {
    padding: 2rem;
}

/* Song Details */
.song-details {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.album-art {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.song-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.song-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form Styles */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--surface-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

/* Player Styles */
.player-container {
    padding: 2rem;
}

.player-album-art {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.player-album-art svg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.player-info {
    text-align: center;
    margin-bottom: 2rem;
}

.player-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.player-info p {
    color: var(--text-secondary);
}

.player-progress {
    margin-bottom: 2rem;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-btn {
    background: var(--surface-light);
    border: none;
    color: var(--text-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.control-btn-play {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.control-btn-play:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 20px var(--shadow);
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
}

.player-volume svg {
    flex-shrink: 0;
}

.player-volume input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    outline: none;
}

.player-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    cursor: pointer;
}

.player-volume input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .filter-section {
        padding: 1rem;
    }

    .genre-filters {
        gap: 0.5rem;
    }

    .genre-label {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .song-count {
        text-align: center;
        font-size: 0.85rem;
    }

    .clear-filters {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }

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

    .logo h1 {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
    }

    .song-details {
        flex-direction: column;
        text-align: center;
    }
}
