/* Apple Music Picker Styles */

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

:root {
    --apple-red: #FF0436;
    --apple-pink: #FF4E6B;
    --apple-white: #FFFFFF;
    --apple-bg: #F5F5F7;
    --apple-text: #1D1D1F;
    --apple-text-secondary: #86868B;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--apple-bg);
    min-height: 100vh;
    color: var(--apple-text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 0;
}

.header-content {
    background: var(--apple-white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 0 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
}

.title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--apple-text);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.03em;
}

.music-note {
    font-size: 2.5rem;
    display: inline-block;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--apple-text-secondary);
    font-weight: 400;
}

.main {
    flex: 1;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remix-btn {
    background: linear-gradient(135deg, var(--apple-red), var(--apple-pink));
    color: var(--apple-white);
    border: none;
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 4, 54, 0.25);
}

.remix-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 4, 54, 0.35);
}

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

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

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.genre-card {
    background: var(--apple-white);
    border-radius: 18px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.genre-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--apple-red), var(--apple-pink));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.genre-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.genre-card:hover::before {
    transform: scaleX(1);
}

.genre-card:active {
    transform: translateY(-4px) scale(1.01);
}

.genre-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--apple-text);
    margin-bottom: 10px;
    line-height: 1.3;
}

.genre-description {
    font-size: 0.9rem;
    color: var(--apple-text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.genre-action {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--apple-red);
    font-weight: 500;
    font-size: 0.9rem;
}

.genre-action i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.genre-card:hover .genre-action i {
    transform: scale(1.2);
}

.loading {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: var(--apple-white);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.loading.show {
    display: block;
}

.loading p {
    color: var(--apple-text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--apple-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.footer {
    text-align: center;
    padding: 20px;
    color: var(--apple-text-secondary);
    font-size: 0.9rem;
}

.footer-link {
    color: var(--apple-red);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.footer-link:hover {
    color: var(--apple-pink);
    border-bottom-color: var(--apple-pink);
}

.footer-link:active {
    transform: translateY(0);
}

.mobile-refresh {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        margin-bottom: 15px;
    }
    
    .controls {
        margin-bottom: 15px;
    }
    
    .header-content {
        padding: 30px 20px;
    }
    
    .title {
        font-size: 2.2rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .music-note {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .genre-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .genre-card {
        padding: 20px;
    }
    
    .genre-name {
        font-size: 1.2rem;
    }
    
    .mobile-refresh {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .music-note {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .genre-card {
        padding: 18px;
    }
    
    .genre-name {
        font-size: 1.1rem;
    }
}

/* Animation for card entrance */
.genre-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.genre-card.animated {
    transform: translateY(0);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delay for cards */
.genre-card:nth-child(1) { animation-delay: 0.05s; }
.genre-card:nth-child(2) { animation-delay: 0.1s; }
.genre-card:nth-child(3) { animation-delay: 0.15s; }
.genre-card:nth-child(4) { animation-delay: 0.2s; }
.genre-card:nth-child(5) { animation-delay: 0.25s; }
.genre-card:nth-child(6) { animation-delay: 0.3s; }
.genre-card:nth-child(7) { animation-delay: 0.35s; }
.genre-card:nth-child(8) { animation-delay: 0.4s; }
.genre-card:nth-child(9) { animation-delay: 0.45s; }
.genre-card:nth-child(10) { animation-delay: 0.5s; }
.genre-card:nth-child(11) { animation-delay: 0.55s; }
.genre-card:nth-child(12) { animation-delay: 0.6s; }

/* Search Container Styles */
.search-container {
    margin-bottom: 20px;
    text-align: center;
}

.search-input-wrapper {
    position: relative;
    display: inline-block;
    max-width: 500px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 50px;
    font-size: 1.1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: var(--apple-white);
    color: var(--apple-text);
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: var(--apple-text-secondary);
    -webkit-text-fill-color: var(--apple-text-secondary);
}

.search-input::selection {
    background: rgba(255, 4, 54, 0.15);
    color: var(--apple-text);
}

.search-input::-moz-selection {
    background: rgba(255, 4, 54, 0.15);
    color: var(--apple-text);
}

.search-input:focus {
    outline: none;
    border-color: var(--apple-red);
    box-shadow: 0 0 0 4px rgba(255, 4, 54, 0.1);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--apple-text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus ~ .search-icon {
    color: var(--apple-red);
}

.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--apple-text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--apple-text);
    transform: translateY(-50%) scale(1.1);
}

.clear-search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.search-stats {
    margin-top: 10px;
    color: var(--apple-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.search-stats span {
    color: var(--apple-red);
    font-weight: 600;
}

/* Search Highlight Styles */
.search-highlight {
    background: rgba(255, 4, 54, 0.12);
    color: var(--apple-red);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* Show More Button Styles */
.show-more-btn {
    background: var(--apple-white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--apple-red);
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 20px auto;
    display: block;
    font-family: inherit;
}

.show-more-btn:hover {
    background: var(--apple-white);
    border-color: var(--apple-red);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 4, 54, 0.15);
}

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

.show-more-btn i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.show-more-btn:hover i {
    transform: translateY(2px);
}

/* Subtitle Styles for Search Version */
.subtitle {
    color: var(--apple-text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: 5px;
    text-align: center;
}

/* Chrome-specific fixes for search input */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* Responsive Search Styles */
@media (max-width: 768px) {
    .search-container {
        margin-bottom: 15px;
    }
    
    .search-input {
        padding: 12px 45px 12px 45px;
        font-size: 1rem;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .search-icon {
        left: 15px;
        font-size: 1rem;
    }
    
    .clear-search-btn {
        right: 12px;
        width: 28px;
        height: 28px;
    }
    
    .show-more-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding: 10px 40px 10px 40px;
        font-size: 0.95rem;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .search-icon {
        left: 12px;
        font-size: 0.9rem;
    }
    
    .clear-search-btn {
        right: 10px;
        width: 26px;
        height: 26px;
    }
    
    .show-more-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}
