/* Visual theme adapted from GEMINI/version28. Existing markup and actions stay intact. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/version28/inter-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/version28/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/version28/space-grotesk-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/version28/space-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

body.v28-theme {
    --v28-pink: #ff006e;
    --v28-purple: #8338ec;
    --v28-cyan: #31e1e7;
    --v28-display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --musicaia-bg: #f8f7fc;
    --musicaia-sidebar: #f0eef6;
    --musicaia-card: #ffffff;
    --musicaia-hover: #e9e5f2;
    --musicaia-text: #252133;
    --musicaia-muted: #6d657f;
    --musicaia-border: rgb(65 44 90 / 12%);
    --v28-field: #f7f5fb;
    --v28-shadow: 0 16px 48px rgb(42 29 63 / 6%);
    --v28-panel: rgb(255 255 255 / 94%);
    --v28-active: linear-gradient(105deg, #ff008018, #9435ec12);
    --v28-focus: #8338ec;
    background: radial-gradient(1000px 650px at 50% -10%, #8338ec0a, transparent 65%), var(--musicaia-bg);
    color: var(--musicaia-text);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.dark body.v28-theme {
    --musicaia-bg: #1b1b22;
    --musicaia-sidebar: #1e1e28;
    --musicaia-card: #23232d;
    --musicaia-hover: #2b2b37;
    --musicaia-text: #fafafa;
    --musicaia-muted: #b5b4c5;
    --musicaia-border: rgb(255 255 255 / 9%);
    --v28-field: #1c1c25;
    --v28-shadow: 0 20px 50px rgb(0 0 0 / 20%);
    --v28-panel: rgb(34 34 43 / 95%);
    --v28-active: linear-gradient(105deg, #401a35, #2a203d);
    --v28-focus: #31e1e7;
    background: radial-gradient(circle at 50% 0%, rgb(255 46 99 / 5%), transparent 55%), var(--musicaia-bg);
}

/* The existing mobile drawer and navigation continue to control visibility. */
.v28-theme #main-sidebar {
    width: min(288px, calc(100vw - 32px));
    background: var(--musicaia-sidebar);
    border-right: 1px solid var(--musicaia-border);
    box-shadow: none;
}
.v28-theme #main-sidebar > div:first-child {
    display: flex;
    align-items: center;
    min-height: 80px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--musicaia-border);
}
.v28-theme #main-sidebar > div:first-child img {
    max-width: 100%;
    max-height: 40px;
    object-fit: contain;
    object-position: left center;
}
.v28-theme #sidebar-user-container {
    margin-block: 16px 10px;
}
.v28-theme #sidebar-user-container > .relative > div:first-child {
    padding: 12px;
    border: 1px solid var(--musicaia-border);
    border-radius: 16px;
    background: rgb(255 255 255 / 3%);
}
.v28-theme #main-sidebar nav {
    padding: 4px 16px 18px;
    overscroll-behavior: contain;
}
.v28-theme #main-sidebar .nav-item {
    position: relative;
    min-height: 46px;
    padding: 12px 16px;
    gap: 12px;
    border-radius: 12px;
    color: var(--musicaia-muted);
    font-size: 14px;
    line-height: 1.5;
    transition: background .18s ease, color .18s ease;
}
.v28-theme #main-sidebar .nav-item:hover {
    background-color: rgb(255 255 255 / 5%);
    color: var(--musicaia-text);
}
.v28-theme #main-sidebar .nav-item > :is(i, svg) {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.v28-theme #main-sidebar .nav-item:is(.active, [aria-current="page"]) {
    background-image: var(--v28-active) !important;
    color: var(--musicaia-text);
    font-weight: 600;
}
.v28-theme #main-sidebar .nav-item:is(.active, [aria-current="page"])::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    width: 3px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(var(--v28-pink), var(--v28-purple));
    transform: translateY(-50%);
}
/* Keep the Packages gradient independent of the current-section style. */
.v28-theme #main-sidebar #nav-packages {
    background-image: linear-gradient(to right, #f43f5e, #a855f7, #ec4899) !important;
    background-size: 200% 200%;
    background-position: 50% 50%;
    animation: gradient-x 3s ease infinite;
    color: #fff;
    text-shadow: 0 1px 2px rgb(26 8 47 / 45%);
}
.v28-theme #main-sidebar #nav-packages > span {
    font-weight: 700;
}
.v28-theme #main-sidebar #nav-packages:hover {
    box-shadow: 0 6px 18px rgb(236 72 153 / 24%);
}
.v28-theme #main-sidebar > div:last-child {
    border-top-color: var(--musicaia-border);
}
.v28-theme #main-sidebar :is(#lang-btn, #theme-btn, #more-btn) {
    border: 1px solid var(--musicaia-border);
    border-radius: 10px;
}

#packages-grid-container {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.package-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .15rem .5rem;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.package-price-amount {
    color: var(--musicaia-text);
    font-size: clamp(1.875rem, 3.5vw, 2.25rem);
    font-weight: 900;
    white-space: nowrap;
}
.package-price-period, .package-price-before {
    color: var(--musicaia-muted);
    font-size: .9rem;
    white-space: nowrap;
}
.package-price-before {
    flex-basis: 100%;
}
.package-note-marker {
    color: var(--musicaia-muted);
    font-size: .75em;
    font-weight: 700;
    white-space: nowrap;
}

.v28-theme > header {
    background: var(--v28-panel);
    border-bottom-color: var(--musicaia-border);
    backdrop-filter: blur(16px);
}

/* Shared presentation for existing PHP views and dynamically rendered editors. */
.v28-theme > main {
    background: transparent;
    min-width: 0;
}
.v28-theme #app-content {
    scrollbar-color: var(--musicaia-hover) transparent;
    scrollbar-width: thin;
}
.v28-theme :is(h1, h2, h3, .nueva-page-title) {
    font-family: var(--v28-display);
    letter-spacing: -.025em;
}
.v28-theme :is(h1, .text-3xl) {
    letter-spacing: -.035em;
}
.v28-theme :is(.bg-musicaia-card, .nueva-panel, .nueva-card, .glass-panel) {
    background-color: var(--musicaia-card);
    border-color: var(--musicaia-border);
}
.v28-theme .glass-panel {
    background: var(--v28-panel);
    box-shadow: var(--v28-shadow);
    backdrop-filter: blur(16px);
}
.v28-theme :is(.nueva-panel, .nueva-card, .nueva-search) {
    border-radius: 20px;
    box-shadow: var(--v28-shadow);
}
.v28-theme #app-content :is([id^="song-card-"], [id^="workspace-card-"], [id^="playlist-card-"]) {
    border: 1px solid var(--musicaia-border);
    border-radius: 18px;
    background: linear-gradient(145deg, rgb(255 255 255 / 2%), transparent), var(--musicaia-card);
    box-shadow: none;
}
.v28-theme #app-content :is([id^="song-card-"], [id^="workspace-card-"], [id^="playlist-card-"]):hover {
    border-color: #8338ec55;
    background-color: var(--musicaia-hover);
}
.v28-theme #app-content :is([id^="song-row-"], .nueva-table tr) {
    border-radius: 12px;
}
.v28-theme :is(input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], textarea, select) {
    background-color: var(--v28-field);
    border-color: var(--musicaia-border);
    border-radius: 12px;
    color: var(--musicaia-text);
    font-family: inherit;
}
.v28-theme :is(input, textarea, select)::placeholder {
    color: var(--musicaia-muted);
    opacity: .75;
}
.v28-theme :is(input, textarea, select):focus {
    border-color: #ff006e80;
    box-shadow: 0 0 0 3px #ff006e0c;
}
.v28-theme :is(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--v28-focus);
    outline-offset: 3px;
}
.v28-theme :is(.bg-musicaia-accent, .nueva-button:not(.nueva-secondary, .nueva-danger)) {
    background: linear-gradient(135deg, #ff2e63, #c9184a);
    border-color: rgb(255 255 255 / 15%);
    box-shadow: 0 8px 22px -4px rgb(255 46 99 / 22%);
    color: #fff;
}
.v28-theme .text-musicaia-accent {
    color: #ff4a91;
}
.v28-theme .nueva-secondary {
    background: var(--musicaia-card);
    border-color: var(--musicaia-border);
    color: var(--musicaia-text);
    box-shadow: none;
}
.v28-theme .nueva-hero {
    background: radial-gradient(ellipse at 80% 0%, #8338ec1a, transparent 65%), var(--musicaia-card);
    border-color: var(--musicaia-border);
    border-radius: 24px;
    box-shadow: none;
}
/* Keep the existing home carousel and its content inside the reference's panel style. */
.v28-theme #app-content :has(> #hero-slider) {
    width: calc(100% - 64px);
    height: clamp(340px, 42vh, 420px);
    min-height: 340px;
    margin: 32px 32px 36px;
    overflow: hidden;
    border: 1px solid var(--musicaia-border);
    border-radius: 24px;
    box-shadow: none;
}
.v28-theme #hero-slider {
    background: #17131f;
}
.v28-theme #hero-slider [data-slide-index] > img {
    opacity: .42;
}
.v28-theme #hero-slider .text-center {
    align-items: flex-start;
    padding: 32px 40px 56px;
    text-align: left;
}
.v28-theme #hero-slider .hero-title {
    max-width: 700px;
    font-size: clamp(2rem, 3.8vw, 3.25rem);
    line-height: 1.1;
    font-weight: 700;
}
.v28-theme #hero-slider .hero-subtitle {
    max-width: 560px;
    margin-inline: 0;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.75;
    color: #d1cbd9;
}
.v28-theme #hero-slider .hero-cta {
    border-radius: 12px;
    font-size: 14px;
}
.v28-theme #hero-slider > [class~="bottom-8"] {
    left: 40px;
    bottom: 24px;
    transform: none;
}
.v28-theme #app-content .snap-start.bg-musicaia-card {
    border: 1px solid var(--musicaia-border);
    border-radius: 18px;
    box-shadow: none;
}
.v28-theme .nueva-server-view {
    --nueva-accent: #ff4a91;
}
.v28-theme :is(#user-context-menu, #lang-menu, #more-menu, #global-action-menu, .details-modal-panel) {
    background-color: var(--musicaia-sidebar);
    border-color: var(--musicaia-border);
    border-radius: 16px;
    box-shadow: var(--v28-shadow);
}
.v28-theme :is(.player-compact, .player-expanded) {
    background: var(--v28-panel);
    border-color: var(--musicaia-border);
    box-shadow: 0 16px 48px rgb(0 0 0 / 24%);
}

@media (min-width: 1024px) {
    .v28-theme #main-sidebar {
        width: 288px;
    }
}
@media (max-width: 639px) {
    .v28-theme #app-content :has(> #hero-slider) {
        width: calc(100% - 32px);
        min-height: 360px;
        height: 360px;
        margin: 16px 16px 28px;
    }
    .v28-theme #hero-slider .text-center {
        padding-inline: 24px;
    }
    .v28-theme #hero-slider > [class~="bottom-8"] {
        left: 24px;
    }
    .v28-theme > header img[alt="MusicaIA"] {
        height: 28px;
        width: auto;
    }
    .v28-theme #main-sidebar > div:first-child {
        min-height: 72px;
        padding: 18px 24px;
    }
    .v28-theme :is(.nueva-panel, .nueva-card, .nueva-search) {
        border-radius: 16px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .v28-theme #main-sidebar .nav-item {
        transition: none;
    }
    .v28-theme #main-sidebar #nav-packages {
        animation: none;
    }
}
