:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
}

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

.counter-section, .music-section {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.counter-section:hover, .music-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background-color: var(--background);
    padding: 0.25rem;
    border-radius: 8px;
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle button.active {
    background-color: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

h1, h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

#counter {
    font-size: 3em;
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

button {
    transition: all 0.2s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#incrementBtn, #searchBtn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

#incrementBtn:hover, #searchBtn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.secondary-btn {
    background-color: var(--background);
    color: var(--text-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: var(--border-color);
}

.results-grid, .playlist-grid {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.result-item {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.result-item.selected {
    background-color: #eff6ff;
    border-color: var(--primary-color);
}

.result-item img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.result-item .item-info {
    flex: 1;
}

.result-item h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.result-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.result-item .add-to-playlist {
    padding: 0.5rem;
    border: none;
    border-radius: 50%;
    background-color: var(--background);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.empty-playlist {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    background-color: var(--background);
    border-radius: 8px;
}

#playerContainer {
    margin-top: 2rem;
    background-color: var(--background);
    border-radius: 12px;
    overflow: hidden;
}

.player-info {
    padding: 1rem;
}

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

#songThumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.song-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

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

.progress-container {
    margin: 1rem 0;
}

.progress-bar {
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

#progressFill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0;
    transition: width 0.1s linear;
}

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

.control-btn {
    padding: 0.75rem;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.1);
}

.control-btn.primary {
    background-color: var(--primary-color);
    color: white;
    width: 48px;
    height: 48px;
}

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

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

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.volume-slider-container {
    width: 100px;
    padding: 0 0.5rem;
}

#volumeSlider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background-color: var(--border-color);
    border-radius: 2px;
    outline: none;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

#volumeSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(3px);
    }
}

@media (max-width: 768px) {
    .music-header {
        flex-direction: column;
        gap: 1rem;
    }

    .search-section {
        flex-direction: column;
    }

    .player-controls {
        flex-wrap: wrap;
    }

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