:root {
    --background: #0f0f13;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --primary: #007aff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --blur: 20px;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    height: 100vh;
    overflow-x: hidden;
    background: radial-gradient(circle at top left, #1a1a2e, #0f0f13);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    overflow-y: auto;
    /* Enable scrolling for landing page */
    display: flex;
    flex-direction: column;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* App Screen centering fix */
#app-screen {
    align-items: center;
    justify-content: center;
}

/* Landing Page Styles */
header {
    padding: 24px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(15, 15, 19, 0.7);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pulse 4s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    background: var(--surface-hover);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.how-it-works {
    padding: 6rem 5%;
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.3));
}

.steps-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.step {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    position: relative;
}

.step-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--surface-hover);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
}

footer {
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Glassmorphism Card for Login/App */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    max-width: 400px;
    width: 90%;
    margin: auto;
    /* Center in scrollable view if needed */
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Modals */
.modal {
    opacity: 1 !important;
    /* Override screen opacity */
    display: flex;
    /* Ensure it overrides display:none when active */
}

/* Fullscreen player (Spotify-like) */
#fullPlayer .sheet {
    width: 100%;
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #021026, #07122b);
    box-shadow: none
}

#fullPlayer .artwork {
    width: 62vmin;
    height: 62vmin;
    max-width: 520px;
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(2, 6, 23, 0.7);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 96px;
    background: #1a1a2e;
    color: white;
}

#fullPlayer .meta {
    text-align: center;
    margin-top: 18px
}

#fullPlayer .meta h1 {
    font-size: 28px;
    margin: 0
}

#fullPlayer .meta p {
    margin: 6px 0 0;
    color: var(--text-secondary)
}

#fullPlayer .controls {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-top: 20px
}

#fullPlayer .controls .btn {
    padding: 12px 14px;
    border-radius: 999px;
    font-size: 18px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

#fullPlayer .controls .btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

#fullPlayer .controls .play-large {
    padding: 18px 22px;
    font-size: 22px;
    border-radius: 999px;
    background: white;
    color: black;
}

#fullPlayer .controls .play-large:hover {
    transform: scale(1.05);
    background: #f0f0f0;
}

#fullPlayer .progress-wrap {
    width: 100%;
    max-width: 960px;
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 12px
}

#fullPlayer .time {
    width: 56px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px
}

#fullPlayer input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(125, 211, 252, 0.4), rgba(96, 165, 250, 0.25));
    outline: none;
    cursor: pointer;
}

#fullPlayer .btn.active {
    background: linear-gradient(90deg, #007aff, #00c6ff);
    color: #fff;
}

@media(max-width:520px) {
    #fullPlayer .artwork {
        width: 86vw;
        height: 86vw;
        font-size: 64px
    }

    #fullPlayer .meta h1 {
        font-size: 20px
    }
}

/* Forms in Modal */
.form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px
}

.form-row input[type=text],
.form-row input[type=file],
textarea,
select {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    outline: none;
    font-size: 16px;
}

.form-row input:focus {
    border-color: var(--primary);
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.device-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.device-item.online .status {
    color: #0f0;
}

.device-item.offline .status {
    color: #666;
}

.hidden {
    display: none !important;
}

p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Media Overlay Title */
.media-title-overlay {
    position: absolute;
    bottom: 40px;
    left: 40px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    z-index: 5002;
    max-width: 80%;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.btn-primary:hover {
    background: #0062cc;
    transform: scale(1.02);
}

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

/* App Screen specific */
#user-info {
    margin-bottom: 20px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--surface);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border: 2px solid var(--glass-border);
}

.hidden {
    display: none !important;
}