/* --- Design Tokens & Variables --- */
:root {
    --bg-dark: #0A0508;
    --primary: #E25E7F;
    --primary-glow: rgba(226, 94, 127, 0.45);
    --secondary: #FF8FA3;
    --secondary-glow: rgba(255, 143, 163, 0.35);
    --accent: #F4A0B5;
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --glass-bg: rgba(18, 6, 10, 0.58);
    --glass-border: rgba(226, 94, 127, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --card-bg: rgba(30, 8, 16, 0.38);
    --font-outfit: 'Outfit', 'Inter', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

/* --- Global Reset & Scrollbars --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-inter);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-bottom: 120px;
    /* Push content below Telegram fullscreen chrome (--tg-content-safe-area-inset-top)
       or OS notch (env safe-area-inset-top) whichever applies */
    padding-top: calc(max(
        var(--tg-content-safe-area-inset-top, 0px),
        env(safe-area-inset-top, 0px)
    ) + 24px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(9, 5, 20, 0.8);
}
::-webkit-scrollbar-thumb {
    background: rgba(226, 94, 127, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(226, 94, 127, 0.6);
}

/* --- Aurora Background System --- */
.aurora-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    contain: layout style paint;
}

.aurora-blob {
    position: absolute;
    will-change: transform;
    transform: translateZ(0);
    /* No filter: blur — radial-gradient handles softness natively */
}

.aurora-blob-1 {
    width: 80vw;
    height: 80vw;
    max-width: 900px;
    max-height: 900px;
    background: radial-gradient(ellipse at 45% 45%,
        rgba(226, 94, 127, 0.55) 0%,
        rgba(194, 59, 96, 0.25) 40%,
        transparent 65%);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 55%;
    top: -25%;
    left: -18%;
    opacity: 0.9;
    animation: aurora-drift-1 22s ease-in-out infinite alternate;
}

.aurora-blob-2 {
    width: 70vw;
    height: 70vw;
    max-width: 780px;
    max-height: 780px;
    background: radial-gradient(ellipse at 55% 55%,
        rgba(139, 26, 60, 0.6) 0%,
        rgba(180, 40, 80, 0.25) 40%,
        transparent 65%);
    border-radius: 40% 60% 45% 55% / 60% 35% 65% 40%;
    bottom: -18%;
    right: -12%;
    opacity: 0.85;
    animation: aurora-drift-2 28s ease-in-out infinite alternate;
}

.aurora-blob-3 {
    width: 55vw;
    height: 55vw;
    max-width: 620px;
    max-height: 620px;
    background: radial-gradient(ellipse at 50% 50%,
        rgba(255, 143, 163, 0.35) 0%,
        rgba(226, 94, 127, 0.15) 45%,
        transparent 65%);
    border-radius: 70% 30% 50% 50% / 30% 65% 35% 70%;
    top: 30%;
    left: 38%;
    opacity: 0.7;
    animation: aurora-drift-3 34s ease-in-out infinite alternate;
}

.aurora-blob-4 {
    width: 45vw;
    height: 45vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(ellipse at 50% 50%,
        rgba(255, 100, 130, 0.4) 0%,
        rgba(226, 94, 127, 0.15) 48%,
        transparent 65%);
    border-radius: 50% 50% 65% 35% / 55% 40% 60% 45%;
    top: 50%;
    right: 18%;
    opacity: 0.6;
    animation: aurora-drift-4 19s ease-in-out infinite alternate;
}

/* Drift animations — slow, independent per blob */
@keyframes aurora-drift-1 {
    0%   { transform: translate(0, 0) scale(1); }
    30%  { transform: translate(5%, 6%) scale(1.06); }
    70%  { transform: translate(-3%, 9%) scale(0.97); }
    100% { transform: translate(7%, -5%) scale(1.03); }
}
@keyframes aurora-drift-2 {
    0%   { transform: translate(0, 0) scale(1); }
    35%  { transform: translate(-6%, -5%) scale(1.08); }
    65%  { transform: translate(8%, -4%) scale(0.92); }
    100% { transform: translate(-9%, 7%) scale(1.05); }
}
@keyframes aurora-drift-3 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-9%, 6%) scale(1.14); }
    100% { transform: translate(6%, -9%) scale(0.88); }
}
@keyframes aurora-drift-4 {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.35; }
    50%  { transform: translate(-8%, -11%) scale(1.18); opacity: 0.55; }
    100% { transform: translate(11%, 7%) scale(0.82); opacity: 0.3; }
}


/* --- Helper Classes --- */
.hidden {
    display: none !important;
}
.disc-spinning {
    animation: spin 3.5s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Glassmorphism Panel Base --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 var(--glass-highlight);
    border-radius: 20px;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Premium Buttons --- */
button {
    font-family: var(--font-outfit);
    border: none;
    outline: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 12px;
}

.glow-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 600;
    padding: 14px 28px;
    font-size: 16px;
    box-shadow: 0 4px 15px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow), 0 0 12px var(--secondary-glow);
    opacity: 0.92;
}
.glow-btn:active {
    transform: translateY(1px);
}

.glow-btn-sm {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 500;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px var(--primary-glow);
}
.glow-btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
    opacity: 0.9;
}

.sec-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-weight: 500;
    padding: 12px 24px;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.sec-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.15);
}

.icon-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.icon-btn-danger:hover {
    background: #EF4444;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
}

/* --- Login Screen --- */
#login-container {
    width: 90%;
    max-width: 440px;
    margin-top: 15vh;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#login-container .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}
#login-container .logo i {
    font-size: 54px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
#login-container .logo h2 {
    font-family: var(--font-outfit);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
#login-container .logo span {
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.login-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}
.login-desc code {
    background: rgba(226, 94, 127, 0.15);
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--accent);
    font-family: monospace;
    font-size: 13px;
}

.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}
.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}
.input-group input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-family: var(--font-inter);
    transition: all 0.3s ease;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    background: rgba(0, 0, 0, 0.4);
}

#login-btn {
    width: 100%;
    margin-top: 10px;
}

.error-msg {
    margin-top: 20px;
    font-size: 13px;
    color: #F87171;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.15);
    width: 100%;
}

/* --- Main Dashboard --- */
#app-container {
    width: 90%;
    max-width: 1200px;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- Header Layout --- */
header {
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
header .brand i {
    font-size: 32px;
    color: var(--accent);
}
header .brand h1 {
    font-family: var(--font-outfit);
    font-size: 24px;
    font-weight: 700;
}
header .brand h1 span {
    color: var(--text-muted);
    font-weight: 400;
}

.profile-widget {
    display: flex;
    align-items: center;
    gap: 16px;
}
.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.profile-info .name {
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 15px;
}
.profile-info .tag {
    font-size: 12px;
    color: var(--text-muted);
}
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    object-fit: cover;
}

/* --- Search & Stats bar --- */
.search-bar-container {
    display: flex;
    gap: 20px;
    width: 100%;
}
.search-input-group {
    flex: 1;
    position: relative;
    padding: 0;
}
.search-input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}
.search-input-group input {
    width: 100%;
    padding: 16px 20px 16px 54px;
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    border-radius: 20px;
}
.search-input-group input:focus {
    outline: none;
}
.stats-badge {
    padding: 0 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 15px;
}
.stats-badge i {
    color: var(--accent);
}

/* --- Empty state --- */
#empty-state {
    width: 100%;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}
.empty-icon {
    font-size: 64px;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 10px;
}
#empty-state h3 {
    font-family: var(--font-outfit);
    font-size: 22px;
}
#empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 400px;
    line-height: 1.6;
}

/* --- Source Filters --- */
.source-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-outfit);
    cursor: pointer;
    transition: transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s;
}
.filter-chip i { font-size: 12px; }
.filter-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-main);
    transform: translateY(-1px);
}
.filter-chip.active {
    background: rgba(226, 94, 127, 0.18);
    border-color: rgba(226, 94, 127, 0.45);
    color: var(--accent);
}

/* --- Tracks Grid --- */
.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
}

/* --- Track Card --- */
.track-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s;
    position: relative;
    overflow: hidden;
}
.track-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}
.track-card:hover {
    transform: translateY(-5px);
    border-color: rgba(226, 94, 127, 0.3);
    box-shadow: 0 12px 30px rgba(226, 94, 127, 0.15);
}
.track-card:hover::before {
    opacity: 0.05;
}

.track-card-header {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 1;
}
.track-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.track-card:hover .track-card-header img {
    transform: scale(1.08);
}

.card-play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(9, 5, 20, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.track-card-header:hover .card-play-overlay,
.track-card.playing .card-play-overlay {
    opacity: 1;
}

.card-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.2s ease;
}
.card-play-btn:hover {
    transform: scale(1.1);
    background: var(--secondary);
    box-shadow: 0 4px 20px var(--secondary-glow);
}

/* Source emblem badge */
.source-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.source-badge.yandex { color: #FFCC00; }
.source-badge.apple { color: #FC3C44; }
.source-badge.soundcloud { color: #FF5500; }
.source-badge.youtube { color: #FF0000; }

.track-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}
.track-card-body .title {
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-card-body .artist {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
    margin-top: 4px;
}
.track-card-footer .dur {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.card-actions {
    display: flex;
    gap: 8px;
}

.card-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.card-action-btn:hover {
    background: rgba(226, 94, 127, 0.2);
    border-color: var(--primary);
    color: var(--accent);
}
.card-action-btn.dl-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: var(--secondary);
    color: #F472B6;
}
.card-action-btn.send-btn:hover {
    background: rgba(32, 162, 220, 0.2);
    border-color: #20A2DC;
    color: #60CDFF;
}

/* --- Floating Bottom Audio Player Bar --- */
.player-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 99;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(226, 94, 127, 0.2);
}

.player-cover-thumb {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.player-cover-thumb:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 18px rgba(226, 94, 127, 0.5);
}

.player-core {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
}

.player-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    /* offset right by half of vol-btn+gap so buttons center over pill */
    padding-left: 50px;
}
.player-control-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.player-control-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
.player-control-btn.play-btn {
    width: 46px;
    height: 46px;
    background: white;
    color: var(--bg-dark);
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.25);
}
.player-control-btn.play-btn:hover {
    transform: scale(1.05);
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.player-timeline-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-timeline {
    flex: 1;
}

/* Volume pill button */
.volume-pill-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.volume-pill-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

/* Vertical popup */
.volume-popup {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 40px;
    height: 130px;
    background: rgba(20, 8, 14, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}
/* Invisible bridge between button and popup to keep hover alive */
.volume-pill-btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 14px;
}

.volume-pill-btn:hover .volume-popup,
.volume-pill-btn.popup-open .volume-popup {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

/* Vertical range input */
#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 4px;
    height: 90px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}
#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 6px rgba(226, 94, 127, 0.5);
}
#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: none;
}

.timeline-container {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.timeline-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    pointer-events: none;
}

.timeline-pill-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-outfit);
    color: rgba(255, 255, 255, 0.85);
    pointer-events: none;
    z-index: 1;
    padding: 0 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
    transition: opacity 0.2s ease;
}



/* --- Premium Modal Overlay --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 3, 15, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(226, 94, 127, 0.3);
}
.modal-overlay:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-header h2 {
    font-family: var(--font-outfit);
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}
.close-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 30px;
}

/* Left Pane: Artwork + Fields */
.modal-left-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.art-upload-container {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
    align-self: center;
}
.art-upload-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-overlay {
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: rgba(9, 5, 20, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.art-upload-container:hover .upload-overlay {
    opacity: 1;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.form-group input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    font-size: 14px;
    transition: border-color 0.2s ease;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
}

/* Right Pane: Trimmer */
.modal-right-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: 30px;
}
.modal-right-pane h3 {
    font-family: var(--font-outfit);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.trim-inputs-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.glass-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.glass-card .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.time-adjuster {
    display: flex;
    align-items: center;
    gap: 8px;
}
.adjust-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 500;
    width: 44px;
    height: 36px;
    border-radius: 8px;
}
.adjust-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}
.time-adjuster input {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    color: white;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}
.time-adjuster input::-webkit-inner-spin-button,
.time-adjuster input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.set-current-btn {
    background: rgba(226, 94, 127, 0.12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    padding: 8px 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(226, 94, 127, 0.15);
}
.set-current-btn:hover {
    background: var(--primary);
    color: white;
}

/* Visual Trimmer Slider Styling */
.range-slider-container {
    position: relative;
    width: 100%;
    height: 36px;
    margin: 15px 0 20px 0;
    display: flex;
    align-items: center;
}
.range-slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    z-index: 1;
}
.range-slider-progress {
    position: absolute;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    z-index: 2;
}
.range-input {
    position: absolute;
    width: 100%;
    height: 36px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    z-index: 3;
}
.range-input::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--primary);
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
    box-shadow: 0 0 10px rgba(226, 94, 127, 0.6);
    transition: transform 0.1s ease, background-color 0.1s ease;
}
.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: var(--accent);
}
.range-input::-webkit-slider-thumb:active {
    transform: scale(1.35);
}
.range-input::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--primary);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 10px rgba(226, 94, 127, 0.6);
    transition: transform 0.1s ease;
}
.range-input::-moz-range-thumb:hover {
    transform: scale(1.25);
    background: var(--accent);
}

.duration-preview-badge {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.15);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.duration-preview-badge span {
    color: var(--text-muted);
}
.duration-preview-badge strong {
    color: var(--secondary);
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 16px;
}

.player-tip {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.modal-footer {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.modal-footer-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Delete (danger) button */
.danger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.danger-btn:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}
.danger-btn:active { transform: scale(0.97); }
.danger-btn:disabled { opacity: 0.55; cursor: not-allowed; }


/* --- Fullscreen Now Playing --- */
.fullscreen-player {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    /* GPU-accelerated transition on opacity + inner scale */
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}
.fullscreen-player.open {
    opacity: 1;
    pointer-events: all;
}

/* Blurred cover background */
.fs-bg {
    position: absolute;
    inset: -40px;          /* overshoot so blur edges don't show */
    background-size: cover;
    background-position: center;
    filter: blur(48px) brightness(0.35) saturate(1.4);
    will-change: filter;
    transform: translateZ(0);
}

/* Close chevron */
.fs-close-btn {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, color 0.2s;
    z-index: 1;
}
.fs-close-btn:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

/* Main content card */
.fs-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    transform: scale(0.92) translateY(24px);
    transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
    will-change: transform;
}
.fullscreen-player.open .fs-content {
    transform: scale(1) translateY(0);
}

/* Cover art */
.fs-cover {
    width: min(72vw, 360px);
    height: min(72vw, 360px);
    border-radius: 20px;
    object-fit: cover;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.7),
        0 0 0 1px rgba(255,255,255,0.06);
    /* subtle spin-in on open */
    transition: box-shadow 0.3s ease;
}
.fullscreen-player.open .fs-cover {
    box-shadow:
        0 40px 100px rgba(0,0,0,0.8),
        0 0 60px rgba(226, 94, 127, 0.3),
        0 0 0 1px rgba(255,255,255,0.08);
}

/* Metadata */
.fs-meta {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fs-title {
    font-family: var(--font-outfit);
    font-size: clamp(1.3rem, 4vw, 1.9rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    max-width: min(80vw, 400px);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.fs-artist {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

/* Clickable cover in player bar */
#player-cover {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#player-cover:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 18px rgba(226, 94, 127, 0.5);
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--primary);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.active,
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- Upload Modal --- */
.upload-modal-content {
    max-width: 620px;
}

.upload-modal-body {
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    max-height: calc(90vh - 160px);
}

.upload-drop-zone {
    border: 2px dashed rgba(226, 94, 127, 0.35);
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: rgba(226, 94, 127, 0.04);
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
    border-color: var(--primary);
    border-style: solid;
    background: rgba(226, 94, 127, 0.1);
    box-shadow: 0 0 20px rgba(226, 94, 127, 0.3), inset 0 0 30px rgba(226, 94, 127, 0.06);
}

.upload-drop-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.upload-drop-icon {
    font-size: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.upload-drop-title {
    font-family: var(--font-outfit);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
}

.upload-drop-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.upload-drop-formats {
    font-size: 11px;
    color: rgba(226, 94, 127, 0.6);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* File list */
.upload-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.upload-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 14px;
}

.upload-file-icon {
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.upload-file-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upload-file-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.upload-file-size {
    font-size: 11px;
    color: var(--text-muted);
}

.upload-file-remove {
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.upload-file-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
}

.upload-summary-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─────────────────────────────────────────────
   DESKTOP TAB NAV
───────────────────────────────────────────── */
.desktop-nav {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Desktop nav is visible only on desktop */
@media (max-width: 960px) {
    .desktop-nav { display: none !important; }
}

.desktop-nav-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 5px;
}

.desktop-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-outfit);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.desktop-tab svg { flex-shrink: 0; opacity: 0.7; transition: opacity 0.2s; }
.desktop-tab:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
}
.desktop-tab:hover svg { opacity: 1; }
.desktop-tab.is-active {
    background: rgba(226, 94, 127, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(226, 94, 127, 0.3);
}
.desktop-tab.is-active svg { opacity: 1; }

/* ─────────────────────────────────────────────
   LIQUID GLASS NAVBAR
───────────────────────────────────────────── */

/* Registers --lg-angle as an animatable <angle> for the conic-gradient border */
@property --lg-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Navbar accent vars — inherit from existing pink palette */
:root {
    --accent-light: var(--secondary);      /* #FF8FA3 */
    --accent-mid:   #E87090;
    --accent-rgb:   226, 94, 127;          /* matches --primary */
    --neon-1: #C0445E;
    --neon-2: var(--primary);              /* #E25E7F */
    --neon-3: var(--secondary);            /* #FF8FA3 */

    --nav-frost-bg:      rgba(18, 6, 10, 0.60);
    --nav-frost-border:  rgba(226, 94, 127, 0.14);
    --nav-frost-shadow:  0 14px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
    --nav-pill-face:     rgba(22, 6, 12, 0.84);
    --nav-label-idle:    #7A5060;
    --nav-label-active:  var(--secondary);
}

.lg-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    padding: 0 0.7rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}
/* Show only on mobile; navbar is hidden on desktop */
@media (min-width: 961px) { .lg-nav { display: none !important; } }

.lg-nav-bar {
    pointer-events: auto;
    position: relative;
    border-radius: 28px;
    background: var(--nav-frost-bg);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--nav-frost-border);
    box-shadow: var(--nav-frost-shadow);
    overflow: hidden;
}

.lg-nav-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.lg-nav-scroll::-webkit-scrollbar { display: none; }

.lg-nav-track {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 100%;
    padding: 7px;
    gap: 2px;
}

/* Sliding pill */
.lg-nav-pill {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    border-radius: 20px;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    background: conic-gradient(
        from var(--lg-angle),
        rgba(var(--accent-rgb), 0.18) 0deg,
        rgba(var(--accent-rgb), 0.18) 200deg,
        var(--neon-1) 270deg,
        var(--neon-3) 320deg,
        var(--neon-2) 345deg,
        rgba(var(--accent-rgb), 0.18) 360deg
    );
    animation: lg-pill-spin 2.6s linear infinite;
    transition:
        transform 0.45s cubic-bezier(0.34, 1.28, 0.4, 1),
        width     0.45s cubic-bezier(0.34, 1.28, 0.4, 1),
        height    0.45s cubic-bezier(0.34, 1.28, 0.4, 1),
        opacity   0.25s ease;
    box-shadow: 0 0 18px -2px rgba(var(--accent-rgb), 0.5);
}
.lg-nav-pill.is-ready { opacity: 1; }

.lg-nav-pill::after {
    content: '';
    position: absolute;
    inset: 1.8px;
    border-radius: 18.2px;
    background: var(--nav-pill-face);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

@keyframes lg-pill-spin {
    to { --lg-angle: 360deg; }
}

/* Tab buttons */
.lg-nav-tab {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    min-width: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nav-label-idle);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.3s ease;
    border-radius: 0;
}
.lg-nav-tab.is-active { color: var(--nav-label-active); }
.lg-nav-tab svg { display: block; }

.lg-nav-icon {
    display: flex;
    transform-origin: center;
}

.lg-nav-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.2px;
    font-family: var(--font-outfit);
}

/* Per-tab icon micro-animations */
.lg-nav-icon.anim-library  { animation: ic-home      0.6s ease both; }
.lg-nav-icon.anim-download { animation: ic-dl        0.6s ease both; }
.lg-nav-icon.anim-upload   { animation: ic-upload    0.6s ease both; }
.lg-nav-icon.anim-profile  { animation: ic-twirl     0.6s ease both; }

@keyframes ic-home {
    0%   { transform: translateY(0) scale(1); }
    30%  { transform: translateY(-4px) scale(1.08); }
    55%  { transform: translateY(1px) scale(0.96); }
    75%  { transform: translateY(-1px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}
@keyframes ic-dl {
    0%   { transform: translateY(-4px) scale(0.9); opacity: 0.7; }
    50%  { transform: translateY(2px) scale(1.05); opacity: 1; }
    75%  { transform: translateY(-1px) scale(0.98); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes ic-upload {
    0%   { transform: translateY(4px) scale(0.9); opacity: 0.7; }
    50%  { transform: translateY(-2px) scale(1.05); opacity: 1; }
    75%  { transform: translateY(1px) scale(0.98); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes ic-twirl {
    0%   { transform: rotateY(0deg) scale(1); }
    50%  { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(360deg) scale(1); }
}

/* ─────────────────────────────────────────────
   APP SECTIONS
───────────────────────────────────────────── */
.app-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ─────────────────────────────────────────────
   DOWNLOAD SECTION
───────────────────────────────────────────── */
.download-hero {
    width: 100%;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}
.download-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(226, 94, 127, 0.12);
    border: 1px solid rgba(226, 94, 127, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
    box-shadow: 0 0 30px rgba(226, 94, 127, 0.2);
}
.download-hero h2 {
    font-family: var(--font-outfit);
    font-size: 26px;
    font-weight: 700;
}
.download-hero > p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 480px;
    line-height: 1.6;
}
.download-input-row {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 620px;
    flex-wrap: wrap;
    justify-content: center;
}
.download-url-input-wrap {
    position: relative;
    flex: 1;
    min-width: 260px;
}
.download-url-input-wrap i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}
.download-url-input-wrap input {
    width: 100%;
    padding: 15px 18px 15px 46px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    color: white;
    font-size: 14px;
    font-family: var(--font-inter);
    transition: border-color 0.25s, box-shadow 0.25s;
}
.download-url-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 14px var(--primary-glow);
    background: rgba(0, 0, 0, 0.4);
}
.download-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    background: rgba(226, 94, 127, 0.08);
    border: 1px solid rgba(226, 94, 127, 0.15);
    padding: 12px 20px;
    border-radius: 12px;
}
.download-status i { color: var(--primary); }
.download-platforms {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   PROFILE SECTION
───────────────────────────────────────────── */
.profile-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
.profile-avatar-area {
    position: relative;
    width: 96px;
    height: 96px;
}
.profile-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    position: relative;
    z-index: 1;
}
.profile-avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(var(--primary), var(--secondary), var(--primary));
    opacity: 0.3;
    animation: ring-spin 4s linear infinite;
}
@keyframes ring-spin {
    to { transform: rotate(360deg); }
}
.profile-meta {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-meta h2 {
    font-family: var(--font-outfit);
    font-size: 22px;
    font-weight: 700;
}
.profile-tag-text {
    font-size: 13px;
    color: var(--text-muted);
}
.profile-stats-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.profile-stat {
    padding: 14px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 100px;
}
.stat-value {
    font-family: var(--font-outfit);
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.profile-key-row {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.key-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.key-label i { color: var(--primary); }
.key-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.key-value {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    color: var(--accent);
    word-break: break-all;
}
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.icon-btn:hover {
    background: rgba(226, 94, 127, 0.15);
    color: var(--accent);
}
.logout-full-btn {
    width: 100%;
    justify-content: center;
    padding: 13px 0;
    font-size: 15px;
    border-radius: 14px;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media(max-width: 900px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .modal-right-pane {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 20px;
    }
}

@media(max-width: 960px) {
    /* Extra bottom padding for navbar + player bar */
    body {
        padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px));
    }

    /* Shift player bar above the navbar */
    .player-bar {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Compact mobile header ── */
    header {
        flex-direction: row;
        padding: 10px 14px;
        gap: 10px;
        align-items: center;
    }
    header .brand h1 {
        font-size: 16px;
    }
    header .brand h1 span {
        display: none;  /* hide "Downloader" word — too long */
    }
    header .brand img {
        width: 28px !important;
        height: 28px !important;
    }

    /* On mobile show only avatar + logout, hide name/tag text */
    .profile-info {
        display: none;
    }
    .avatar {
        width: 36px;
        height: 36px;
    }
    .profile-widget {
        gap: 8px;
        margin-left: auto;
    }
    .icon-btn-danger {
        width: 36px;
        height: 36px;
    }

    /* Smaller upload button text on mobile */
    #upload-open-btn span {
        display: none;
    }

    /* Prevent iOS auto-zoom on input focus (requires font-size >= 16px) */
    input, textarea, select {
        font-size: 16px !important;
    }

    .search-bar-container {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
    }
    .search-input-group {
        flex: 1;
        min-width: 0;
    }
    .stats-badge {
        padding: 0 12px;
        height: 48px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    #app-container {
        width: 95%;
        margin-top: 12px;
    }

    .download-hero {
        padding: 28px 18px;
    }
    .download-input-row {
        flex-direction: column;
    }
    .download-url-input-wrap {
        min-width: unset;
    }
    #download-url-btn {
        width: 100%;
        justify-content: center;
    }
    .profile-card {
        padding: 28px 18px;
    }
}
