* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.auth-section {
    text-align: center;
    padding: 40px 0;
}

.search-section {
    margin-bottom: 30px;
}

.bpm-input-group {
    margin-bottom: 30px;
}

.bpm-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.input-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
}

#bpmInput {
    width: 150px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    transition: border-color 0.3s;
}

#bpmInput:focus {
    outline: none;
    border-color: #667eea;
}

#bpmSlider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

#bpmSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

#bpmSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.bpm-display {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-top: 10px;
}

.bpm-range-info {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

#bpmValue {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.popular-filter-group {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.switch-label input[type="checkbox"] {
    display: none;
}

.switch-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.3s;
    margin-right: 12px;
    flex-shrink: 0;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-label input[type="checkbox"]:checked + .switch-slider {
    background-color: #667eea;
}

.switch-label input[type="checkbox"]:checked + .switch-slider::before {
    transform: translateX(24px);
}

.switch-text {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.filter-info {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
    margin-left: 62px;
}

.tolerance-group {
    margin-bottom: 25px;
}

.tolerance-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

#toleranceInput {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

#toleranceInput::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #764ba2;
    cursor: pointer;
}

#toleranceInput::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #764ba2;
    cursor: pointer;
    border: none;
}

.search-options {
    margin-bottom: 25px;
}

.search-options label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

#genreSelect {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

#genreSelect:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

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

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.results-section {
    margin-top: 30px;
}

.results-section h2 {
    margin-bottom: 20px;
    color: #333;
}

#resultsContainer {
    display: grid;
    gap: 15px;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #667eea;
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.result-info {
    flex: 1;
}

.result-info h3 {
    margin-bottom: 5px;
    color: #333;
}

.result-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 2px 0;
}

.bpm-info {
    color: #667eea;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 5px;
}

.bpm-badge {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 10px;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #c33;
}

.error.success {
    background: #efe;
    color: #3c3;
    border-left-color: #3c3;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.playlist-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.playlist-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.playlist-options {
    margin-bottom: 15px;
}

.playlist-options label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.playlist-options input[type="radio"] {
    margin-right: 8px;
}

#existingPlaylistContainer,
#newPlaylistContainer {
    margin: 15px 0;
}

#existingPlaylistContainer label,
#newPlaylistContainer label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

#playlistSelect,
#newPlaylistName {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px;
}

#newPlaylistName:focus,
#playlistSelect:focus {
    outline: none;
    border-color: #667eea;
}

#newPlaylistContainer label[for="newPlaylistPublic"] {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

#newPlaylistContainer input[type="checkbox"] {
    margin-right: 8px;
}

.result-item {
    position: relative;
}

.track-checkbox {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
}

.result-item img,
.result-item .result-info {
    margin-left: 35px;
}

.load-more-section {
    margin-top: 20px;
    text-align: center;
    padding: 20px;
}

.load-more-info {
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
}

/* SEO Content Sections */
.intro-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.intro-section h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.intro-section p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 12px 0;
    color: #444;
    line-height: 1.6;
    border-bottom: 1px solid #e0e0e0;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list strong {
    color: #667eea;
}

.footer-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
}

.footer-content h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-content h4 {
    color: #555;
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 12px;
}

.footer-content p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 15px;
}

.footer-content ol,
.footer-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
    color: #555;
    line-height: 1.7;
}

.footer-content li {
    margin-bottom: 8px;
}

.footer-content strong {
    color: #667eea;
}

.footer-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    color: #856404;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    #bpmInput {
        width: 100%;
    }

    .result-item {
        flex-direction: column;
        text-align: center;
    }

    .result-item img {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .intro-section,
    .footer-section {
        padding: 20px;
    }

    .intro-section h2 {
        font-size: 1.5rem;
    }

    .footer-content h3 {
        font-size: 1.3rem;
    }

    .footer-content h4 {
        font-size: 1.1rem;
    }
}

