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

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', 'Gotham', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow: hidden;
}

/* Make the app a single vertical scroll container so Tesla touchscreen scrolls the page, not inner panels */
#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lyrics-view {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Login Screen - Tesla Style */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

.login-container {
    text-align: center;
    padding: 3rem;
    max-width: 500px;
    animation: fadeIn 0.6s ease-in;
}

.login-container h1 {
    font-size: 3.5em;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.login-container p {
    font-size: 1.2em;
    color: #b0b0b0;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Tesla-style Buttons */
.btn-primary {
    background: #3e6ae1;
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.1em;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(62, 106, 225, 0.3);
    letter-spacing: 0.5px;
    width: 100%;
}

.btn-primary:hover {
    background: #5a7fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(62, 106, 225, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Standalone What's Playing view */
.whats-playing-view {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at top, rgba(25, 25, 25, 0.85), rgba(0, 0, 0, 0.95)),
        linear-gradient(135deg, #050505 0%, #111111 100%);
    color: #ffffff;
}

.whats-playing-header h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.6rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.back-link:hover,
.back-link:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.whats-playing-body {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    width: 100%;
}

.whats-playing-card {
    width: 100%;
    max-width: 960px;
    background: rgba(5, 5, 5, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    padding: 2.75rem;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.45s ease;
}

.wp-tagline {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.8em;
    color: #8c8c8c;
}

.wp-loading,
.wp-status {
    font-size: 1rem;
    color: #b0b0b0;
}

.wp-track {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    align-items: center;
}

.wp-art-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(62, 106, 225, 0.25), rgba(62, 106, 225, 0));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.wp-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.wp-track-text {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.wp-label {
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.3em;
    color: #9c9c9c;
}

.wp-track-name {
    font-size: 2.5em;
    font-weight: 500;
}

.wp-track-artist {
    font-size: 1.2em;
    color: #e0e0e0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.wp-track-artist:not([aria-disabled="true"]):hover,
.wp-track-artist:not([aria-disabled="true"]):focus-visible {
    color: #ffffff;
}

.wp-track-artist[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.65;
}

.wp-track-album {
    font-size: 1em;
    color: #b0b0b0;
}

.wp-status-row {
    min-height: 1.5rem;
}

@media (max-width: 1024px) {
    .whats-playing-body {
        padding: 2rem 1.25rem;
    }

    .whats-playing-card {
        padding: 2rem;
    }

    .wp-track {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .wp-art-frame {
        max-width: 320px;
        margin: 0 auto;
    }

    .wp-track-text {
        text-align: center;
    }
}

@media (max-width: 600px) {
    .whats-playing-card {
        border-radius: 18px;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .wp-track-name {
        font-size: 1.6em;
    }

    .wp-track-artist {
        font-size: 1.05em;
    }
}

/* Artist detail page */
.artist-view {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at top, rgba(15, 15, 15, 0.9), rgba(0, 0, 0, 0.95));
}

.artist-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 2.5rem;
    display: flex;
    justify-content: center;
}

.artist-card {
    width: 100%;
    max-width: 1200px;
    background: rgba(5, 5, 5, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.artist-header-text h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.artist-subtitle {
    color: #b0b0b0;
    font-size: 0.95em;
    margin-top: 0.15rem;
}

.artist-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.artist-name {
    font-size: 2.4em;
    letter-spacing: -0.6px;
}

.artist-tagline {
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.75em;
    color: #7b7b7b;
}

.artist-loading {
    text-align: center;
    color: #b0b0b0;
    font-size: 1.05em;
}

.artist-status {
    color: #b0b0b0;
    font-size: 0.95em;
    min-height: 1.25rem;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.album-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    color: inherit;
    text-decoration: none;
}

.album-art-frame {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.album-art-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-art-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    font-size: 0.9em;
}

.album-card-text h3 {
    font-size: 1.1em;
    font-weight: 500;
}

.album-meta {
    font-size: 0.9em;
    color: #b0b0b0;
}

.album-type {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #8c8c8c;
}

.album-link {
    margin-top: auto;
    align-self: flex-start;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.9em;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s ease;
}

.album-link:hover,
.album-link:focus-visible {
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .artist-body {
        padding: 1.5rem;
    }

    .artist-card {
        border-radius: 24px;
        padding: 1.75rem;
    }

}

.album-view {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at top, rgba(15, 15, 15, 0.9), rgba(0, 0, 0, 0.95));
}

.album-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 2.5rem;
    display: flex;
    justify-content: center;
}

.album-detail-card {
    width: 100%;
    max-width: 1200px;
    background: rgba(5, 5, 5, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.album-detail-hero {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.album-cover-large {
    width: 320px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.album-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-meta {
    flex: 1 1 280px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.album-title {
    font-size: 2.3em;
    letter-spacing: -0.6px;
}

.album-artist {
    font-size: 1.1em;
    color: #e0e0e0;
}

.album-info {
    font-size: 0.95em;
    color: #b0b0b0;
}

.track-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.track-row {
    display: grid;
    grid-template-columns: 48px 1fr 64px;
    align-items: center;
    padding: 0.9rem 1.25rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
    border: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.track-number {
    font-size: 0.9em;
    color: #8c8c8c;
}

.track-name {
    font-size: 1em;
    font-weight: 500;
}

.track-row-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.track-explicit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.7em;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.track-duration {
    justify-self: end;
    font-size: 0.9em;
    color: #b0b0b0;
}

.track-row:hover:not(:disabled),
.track-row:focus-visible {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.track-row:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.track-list li {
    list-style: none;
}

@media (max-width: 768px) {
    .album-body {
        padding: 1.5rem;
    }

    .album-detail-card {
        border-radius: 24px;
        padding: 1.75rem;
    }

    .album-detail-hero {
        flex-direction: column;
    }

    .track-row {
        grid-template-columns: 32px 1fr 48px;
    }
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-logout {
    background: transparent;
    color: #b0b0b0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.5rem;
    font-size: 0.9em;
    font-weight: 400;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 1.5em;
    font-weight: 300;
    letter-spacing: -0.4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#user-name {
    font-size: 0.95em;
    color: #e0e0e0;
    font-weight: 400;
}

/* No Track State */
.no-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    padding: 2rem;
    animation: fadeIn 0.5s ease-in;
}

.no-track p {
    font-size: 1.5em;
    color: #ffffff;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.no-track .subtitle {
    font-size: 1.1em;
    color: #707070;
    font-weight: 300;
}

/* Track Info Container */
#track-info {
    padding: 2rem;
    animation: slideUp 0.5s ease-out;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.btn-control {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.4em;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.btn-control-primary {
    width: 80px;
    height: 80px;
    font-weight: 600;
    background: #3e6ae1;
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(62, 106, 225, 0.35);
}

.btn-control svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    display: block;
}

.btn-control:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.btn-control:active {
    transform: translateY(0);
}

.btn-control:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.playback-status {
    min-height: 1.5rem;
    font-size: 0.95em;
    color: #b0b0b0;
    margin-top: 0.25rem;
}


/* Lyrics Container - Tesla Screen Style */
.lyrics-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.lyrics-container h3 {
    font-size: 1.3em;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.lyrics-content {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.5em;
    line-height: 1.9;
    color: #e0e0e0;
    font-weight: 300;
    white-space: pre-wrap;
    padding-bottom: 1.25rem;
    justify-content: center;
    display: flex;
    text-align: center;
}

/* Custom Scrollbar - Tesla Style */
.lyrics-content::-webkit-scrollbar {
    width: 8px;
}

.lyrics-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.lyrics-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.lyrics-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Persistent Footer */
.lyrics-view .lyrics-footer {
    position: relative;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(5, 5, 5, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
    margin-top: auto;
}

.lyrics-view .footer-section {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lyrics-view .footer-now-playing {
    min-width: 240px;
}

.lyrics-view .footer-track-link {
    text-decoration: none;
    color: inherit;
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    border-radius: 8px;
}

.lyrics-view .footer-track-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 4px;
}

.lyrics-view .footer-album-art {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.lyrics-view .footer-track-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lyrics-view .footer-track-name {
    font-size: 1.1em;
    font-weight: 500;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lyrics-view .footer-track-meta {
    font-size: 0.9em;
    color: #b0b0b0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lyrics-view .footer-controls {
    justify-content: center;
    gap: 1.5rem;
}

.lyrics-view .footer-status {
    justify-content: flex-end;
}

.lyrics-view .footer-spinner {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lyrics-view .footer-spinner.active {
    opacity: 1;
}

.lyrics-view .spinner-icon {
    width: 32px;
    height: 32px;
}

.lyrics-view .spinner-track {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 4;
    fill: none;
}

.lyrics-view .spinner-head {
    stroke: #ffffff;
    stroke-width: 4;
    stroke-dasharray: 90;
    stroke-dashoffset: 60;
    fill: none;
    transform-origin: center;
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    to {
        stroke-dashoffset: 0;
        transform: rotate(360deg);
    }
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    font-size: 1.3em;
    color: #707070;
    font-weight: 300;
}

.loading::after {
    content: '...';
    animation: ellipsis 1.5s infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ellipsis {
    0% {
        content: '.';
    }

    33% {
        content: '..';
    }

    66% {
        content: '...';
    }
}

/* Responsive adjustments for Tesla screen */
@media (min-width: 1200px) {
    .lyrics-content {
        font-size: 1.8em;
        line-height: 1.9;
        justify-content: center;
        display: flex;
        text-align: center;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    #track-info {
        padding: 1rem;
    }

    .lyrics-container {
        padding: 1.5rem;
    }
}