:root {
    --primary: #6d28d9;
    --secondary: #db2777;
    --bg: #e0e7ff;
    --card-bg: rgba(255, 255, 255, 0.2);
    --text: #1f2937;
    --muted: #6b7280;
    --accent-gradient: linear-gradient(45deg, #7235ff, #089211);
    --progress-bg: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --border: rgba(255, 255, 255, 0.2);
}

/* body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Arial;
    background: var(--bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
} */

body{
    min-height: 100vh;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 24px;
    width: 100%;
    max-width: 900px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* background: #fcfefb; */
    margin: 1rem auto;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.speaker {
    font-size: 36px;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent-gradient);
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.speaker:hover {
    transform: scale(1.1);
}

.meta {
    flex: 1;
    min-width: 220px;
}

.card h1 {
    font-size: 20px;
    margin: 0 0 8px;
    color: var(--text);
    font-weight: 700;
    text-transform: capitalize;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.controls {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    align-items: center;
    flex-wrap: wrap;
}

button {
    border: none;
    background: var(--accent-gradient);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 1 0 auto;
}

button.ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

a.download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: var(--accent-gradient);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    flex: 1 0 auto;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.progress {
    height: 10px;
    width: 100%;
    background: var(--progress-bg);
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    margin-top: 12px;
    transition: background 0.3s ease;
}

.progress:hover {
    background: rgba(255, 255, 255, 0.5);
}

.progress>i {
    display: block;
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress>i::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateX(50%);
}

.visually-hidden {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


#errorMsg {
    color: #dc2626;
    margin-top: 12px;
    display: none;
    font-size: 14px;
    text-align: center;
}

#loading {
    display: none;
    margin-top: 12px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 auto;
}

#volumeSlider {
    width: 100px;
    accent-color: var(--primary);
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-gradient);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#volumeSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent-gradient);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.playlist-section {
    margin-top: 20px;
    /* color: #db2777; */
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#uploadBtn {
    background: var(--accent-gradient);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#fileInput {
    display: none;
}

#playlistSelector {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    max-width: 200px;
}

#playlistSelector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(109, 40, 217, 0.3);
}

#playlist {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

#playlist li {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text);
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    color: #255604;
    font-weight: 600;

}

#playlist li:last-child {
    border-bottom: none;
}

#playlist li:hover {
    background: rgba(255, 255, 255, 0.2);
}

#playlist li.active {
    background: var(--accent-gradient);
    color: #fff;
}

@media (max-width: 800px) {

    .card {
        padding: 20px;
        max-width: 90%;
        margin-bottom: 13rem;
        margin-top: 3rem;
    }

    .speaker {
        width: 64px;
        height: 64px;
        font-size: 30px;
    }

    h1 {
        font-size: 18px;
    }

    .meta {
        min-width: 180px;
    }

    .controls {
        gap: 6px;
    }

    button,
    a.download {
        padding: 8px 12px;
        font-size: 13px;
    }

    #volumeSlider {
        width: 80px;
    }

    .playlist-section {
        margin-top: 16px;
    }

    #playlist li {
        padding: 8px 12px;
        font-size: 13px;
    }

    #playlistSelector {
        max-width: 150px;
        font-size: 13px;
    }
}