/* Base Reset */
* {
    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, #1e1e2f 0%, #2a2a4a 100%);
    color: #333;
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    max-width: 750px;
    margin: 0 auto;
}

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

header h1 {
    font-size: 3.5em;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -1px;
}

header p {
    font-size: 1.1em;
    color: #a8a8c0;
}

/* Search Box & Clear Button */
.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

#search-input {
    width: 100%;
    padding: 15px 50px 15px 25px;
    font-size: 16px;
    border: none;
    border-radius: 30px; /* Modern pill shape */
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#search-input:focus {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    background: #fff;
}

#clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.08);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 16px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 0;
    padding-bottom: 2px;
}

#clear-btn:hover {
    background: #ff4757;
    color: white;
}

.search-btn {
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    background: #764ba2;
}

.search-btn:active {
    transform: scale(0.97);
}

/* Player Dashboard */
#player-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none; /* Controlled by JS */
}

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

#player-container.active {
    display: block;
    animation: slideDown 0.4s ease-out forwards;
}

.now-playing-header {
    margin-bottom: 12px;
}

.np-badge {
    display: inline-block;
    background: #ff4757;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.np-title {
    color: #1e1e2f;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

#player audio {
    width: 100%;
    height: 40px;
    outline: none;
    margin-top: 10px;
}

/* Volume Control */
#volume-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

#volume-box label {
    font-size: 1.2em;
    color: #555;
}

#volume-slider {
    flex: 1;
    height: 6px;
    background: #dfe4ea;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

#volume-slider::-webkit-slider-thumb:hover {
    background: #764ba2;
}

/* Results Section */
.section-title {
    color: white;
    margin: 25px 0 15px 0;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    gap: 15px;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-item h3 {
    color: #2a2a4a;
    margin-bottom: 5px;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-item .meta {
    color: #666;
    font-size: 0.85em;
    margin: 0;
}

.play-btn {
    background: #e4e7eb;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.play-btn:hover {
    background: #667eea;
    color: white;
}

/* History Toggle Button */
.toggle-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2.5em;
    }
    .search-box {
        flex-direction: column;
    }
    .search-btn {
        width: 100%;
        padding: 15px;
    }
}
