:root {
    --bg-color: #0d1117;
    --text-color: #e6edf3;
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --border-radius: 12px;
}


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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
}

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #3498db, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #8b949e;
}

.supported-platforms {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.supported-platforms span {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: #c9d1d9;
    font-size: 0.82rem;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #c9d1d9;
}

.input-help {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #8b949e;
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}

input[type="text"]:focus-visible,
button:focus-visible,
footer a:focus-visible {
    outline: 2px solid #58a6ff;
    outline-offset: 2px;
}

button {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    border: none;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.btn-success {
    background-color: var(--success-color);
}

button.btn-success:hover:not(:disabled) {
    background-color: #27ae60;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    background: var(--primary-color);
    color: #fff;
}

.hidden {
    display: none !important;
}

.status-message {
    margin-top: 20px;
    text-align: center;
    padding: 15px;
    border-radius: var(--border-radius);
}

.status-error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.loader {
    margin-top: 30px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.result-container {
    margin-top: 30px;
    display: grid;
    gap: 20px;
}

.result-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-header h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 5px;
    word-break: break-word;
}

.thumbnail-container {
    width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.thumbnail-container img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    object-fit: contain;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.image-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.image-item:hover img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;
    font-size: 1.5rem;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

/* Download Sections */
.download-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-section h3 {
    font-size: 1rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

/* Music List */
.track-list {
    display: grid;
    gap: 15px;
}

.track-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    transition: background 0.3s, transform 0.2s;
    align-items: center;
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(5px);
}

.track-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.track-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.track-title {
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    font-size: 0.85rem;
    color: #8b949e;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.track-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.track-download {
    flex-shrink: 0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    margin-top: 50px;
    color: #484f58;
    font-size: 0.8rem;
}

footer a {
    color: #8b949e;
}

footer a:hover {
    color: #c9d1d9;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    button:hover:not(:disabled),
    .track-item:hover,
    .image-item:hover img {
        transform: none;
    }
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }

    #download-btn {
        width: 100%;
    }

    .track-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .track-thumb {
        width: 100%;
        height: 150px;
    }

    .track-download {
        width: 100%;
    }

    .track-download button {
        width: 100%;
    }
}
