@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary: #1DB954;
    --primary-dark: #1aa34a;
    --dark-bg: #121212;
    --card-bg: #181818;
    --text-white: #ffffff;
    --text-gray: #b3b3b3;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
    background-color: #000;
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Grid Pattern */
.grid-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(#1a1a1a 1px, transparent 1px), linear-gradient(90deg, #1a1a1a 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* --- MAIN CARD --- */
.downloader-card {
    background: var(--card-bg);
    width: 100%;
    border-radius: 20px;
    padding: 40px 25px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border: 1px solid #282828;
    position: relative;
    overflow: hidden;
}

/* Header */
.header { margin-bottom: 30px; }
.header i { font-size: 50px; color: var(--primary); margin-bottom: 10px; }
.header h2 { font-size: 28px; font-weight: 700; }
.header h2 span { color: var(--primary); }
.header p { color: var(--text-gray); font-size: 13px; margin-top: 5px; }

/* View Switching Utility */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Input Styling */
.input-box {
    background: #2a2a2a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    transition: 0.3s;
}
.input-box:focus-within { border-color: var(--primary); box-shadow: 0 0 10px rgba(29, 185, 84, 0.2); }
.input-box i { color: var(--text-gray); margin-right: 15px; }
.input-box input {
    background: transparent; border: none; outline: none;
    color: white; flex: 1; font-size: 15px;
}

/* Button Styling */
.action-btn {
    width: 100%;
    background: var(--primary);
    color: #000;
    font-weight: 700;
    padding: 16px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.action-btn:hover { background: var(--primary-dark); transform: scale(1.02); }

/* --- RESULT CARD STYLING --- */
.track-card { animation: fadeIn 0.4s; }
.track-img {
    width: 180px; height: 180px;
    border-radius: 15px; /* Sedikit lebih rounded sesuai gambar modern */
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.track-details h3 { font-size: 20px; font-weight: 700; margin-bottom: 5px; color: white; }
.track-details p { color: var(--text-gray); font-size: 14px; margin-bottom: 15px; font-weight: 500;}

.meta-tags { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.tag {
    background: #333; color: #ddd;
    padding: 5px 12px; border-radius: 50px;
    font-size: 12px; display: flex; align-items: center; gap: 5px;
}
.green-tag { background: rgba(29, 185, 84, 0.15); color: var(--primary); }

.download-confirm-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--primary); color: #000; text-decoration: none;
    padding: 15px; border-radius: 50px; font-weight: 700; font-size: 16px;
    transition: 0.2s;
}
.download-confirm-btn:hover { transform: scale(1.03); background: var(--primary-dark); }

.reset-area { margin-top: 15px; }
#resetBtn { background: none; border: none; color: var(--text-gray); text-decoration: underline; cursor: pointer; }

/* --- LOADING ANIMATION --- */
.loader-container { padding: 40px 0; }
.spotify-pulse {
    width: 50px; height: 50px; background: var(--primary);
    border-radius: 50%; margin: 0 auto 20px;
    animation: pulse-ring 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7);
}
@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(29, 185, 84, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

/* --- FEATURES & DOCS (UNCHANGED) --- */
.features-grid {
    display: flex; justify-content: space-between;
    width: 100%; gap: 10px;
}
.feature-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; flex: 1;
}
.icon-circle {
    width: 45px; height: 45px;
    background: #1a1a1a; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); font-size: 18px;
    border: 1px solid #333;
}
.feature-item span { font-size: 10px; color: var(--text-gray); font-weight: 600; text-transform: uppercase; }

.documentation-section {
    width: 100%; background: #1a1a1a;
    padding: 20px; border-radius: 15px;
    border: 1px solid #333;
}
.documentation-section h3 { font-size: 16px; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; align-items: center; gap: 15px; }
.step-num {
    background: var(--primary); color: #000;
    width: 25px; height: 25px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.step p { font-size: 13px; color: #ccc; }

.footer {
    color: #444; font-size: 11px; font-weight: 700; letter-spacing: 2px;
    margin-top: 10px;
}
