/* --- 1. CORE RESET & BASE --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    background-color: #f8f9fa; 
    color: #1a1a1a; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    line-height: 1.5;
    padding: 40px 20px;
}

.app { 
    max-width: 600px; 
    margin: 0 auto; 
}

/* --- 2. HEADER & INTRO --- */
header { text-align: center; margin-bottom: 40px; }

h1 { 
    font-size: 2.4rem; 
    font-weight: 800; 
    letter-spacing: -0.03em; 
    margin-bottom: 15px; 
}

.intro-box { 
    background: #ffffff; 
    padding: 25px; 
    border-radius: 12px; 
    border: 1px solid #e0e0e0; 
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.intro-box p { margin-bottom: 12px; font-size: 1rem; color: #444; }
.intro-box a { color: #000; font-weight: 700; text-decoration: none; border-bottom: 2px solid #000; }

/* --- 3. FILTER SECTION --- */
.card.filters { 
    background: #ffffff; 
    padding: 24px; 
    border-radius: 16px; 
    border: 1px solid #eeeeee; 
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.filter-group label { 
    font-weight: 700; 
    font-size: 0.75rem; 
    color: #888; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    display: block; 
    margin-bottom: 6px; 
}

select { 
    width: 100%;
    padding: 12px; 
    border-radius: 8px; 
    border: 1px solid #ddd; 
    font-size: 1rem; 
    background-color: #fff;
    cursor: pointer;
    outline: none;
}

select:focus { border-color: #000; }

#recommendBtn { 
    padding: 16px; 
    background-color: #000000; 
    color: #ffffff; 
    border: none; 
    border-radius: 10px; 
    font-weight: 700; 
    font-size: 1rem;
    text-transform: uppercase; 
    cursor: pointer; 
    transition: transform 0.1s ease, background-color 0.2s ease;
}

#recommendBtn:hover { background-color: #333; }
#recommendBtn:active { transform: scale(0.98); }

/* --- 4. DISCOVERY RESULT CARD --- */
.song-card { 
    background: #ffffff; 
    padding: 32px; 
    border-radius: 20px; 
    border: 2px solid #000000; 
    margin-top: 30px; 
    animation: fadeIn 0.4s ease-out; 
}

.song-card label { color: #FF0000; font-size: 0.8rem; margin-bottom: 8px; }

/* The Action Buttons */
.search-links { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
    margin-top: 25px; 
}

.search-btn { 
    display: block; 
    text-align: center; 
    padding: 14px 10px; 
    border-radius: 8px; 
    text-decoration: none !important; 
    color: #ffffff !important; 
    font-weight: 700; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    transition: opacity 0.2s ease;
}

.yt { background-color: #FF0000 !important; } /* YouTube Red */
.sp { background-color: #000000 !important; } /* Apple Music Black */

.search-btn:hover { opacity: 0.85; }

/* --- 5. TOP 15 SECTION --- */
.favorites-section { 
    margin-top: 60px; 
    border-top: 2px solid #e0e0e0; 
    padding-top: 40px; 
}

.fav-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
}

.fav-header h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.playlist-link { font-size: 0.8rem; font-weight: 700; color: #000; text-decoration: none; border-bottom: 2px solid #000; }

.fav-intro { color: #666; font-size: 0.95rem; margin-bottom: 25px; }

/* Top 15 List Grid */
.favorites-grid { 
    display: grid; 
    gap: 12px; 
}

.fav-item { 
    background: #ffffff; 
    padding: 18px 24px; 
    border-radius: 12px; 
    border: 1px solid #eeeeee; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    text-decoration: none; 
    color: inherit; 
    transition: all 0.2s ease;
}

.fav-item:hover { 
    border-color: #000000; 
    transform: translateX(6px); 
    box-shadow: 4px 4px 0px #000000; 
}

.fav-artist { font-weight: 800; font-size: 1rem; display: block; }
.fav-title { font-size: 0.9rem; color: #666; }
.play-icon { color: #FF0000; font-size: 1.1rem; }

/* --- 6. UTILITIES --- */
.fallback-msg { 
    background: #fffbe6; 
    padding: 12px; 
    border-radius: 8px; 
    text-align: center; 
    margin-bottom: 12px; 
    font-size: 0.9rem; 
    border: 1px solid #ffe58f; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(15px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Mobile Tweak */
@media (max-width: 480px) {
    .search-links { grid-template-columns: 1fr; }
    h1 { font-size: 2rem; }
}