
/* ============================================
   MY UNIVERSE
   VERSION 0.2 - VISUAL UPGRADE
   ============================================ */

/* FONT */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');


/* ============================================
   1. VARIABILI
   ============================================ */

:root {
    --background: #070b17;
    --sidebar: #0b1020;
    --card: rgba(19, 27, 49, 0.85);

    --border: rgba(130, 160, 255, 0.12);

    --text: #f4f7ff;
    --muted: #8490ad;

    --blue: #448aff;
    --cyan: #39d9ff;
    --purple: #9868ff;

    --glow-blue: rgba(68, 138, 255, 0.4);
    --glow-purple: rgba(152, 104, 255, 0.25);
}


/* ============================================
   2. RESET GENERALE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

button {
    font: inherit;
    cursor: pointer;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.app {
    display: flex;
    min-height: 100vh;
}


/* ============================================
   3. SIDEBAR
   ============================================ */

.sidebar {
    width: 255px;
    min-width: 255px;
    height: 100vh;

    position: sticky;
    top: 0;

    display: flex;
    flex-direction: column;

    padding: 30px 18px;

    background: var(--sidebar);
    border-right: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.6px;

    margin-bottom: 65px;
}

.logo-icon {
    color: var(--cyan);
    font-size: 30px;

    text-shadow:
        0 0 15px var(--blue),
        0 0 30px rgba(57, 217, 255, 0.4);
}

.dot {
    color: var(--cyan);
}

.sidebar-label,
.card-label,
.eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--muted);
}

.sidebar-label {
    margin: 0 12px 18px;
}


/* NAVIGAZIONE */

.navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 15px;

    color: var(--muted);
    background: transparent;

    border: 1px solid transparent;
    border-radius: 12px;

    text-align: left;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.nav-item:hover {
    color: white;
    background: rgba(68, 138, 255, 0.1);
    transform: translateX(4px);
}

.nav-item.active {
    color: white;

    background: linear-gradient(
        90deg,
        rgba(68, 138, 255, 0.22),
        rgba(68, 138, 255, 0.04)
    );

    border-color: rgba(68, 138, 255, 0.2);

    box-shadow:
        inset 3px 0 0 var(--cyan);
}


/* STATO SISTEMA */

.sidebar-bottom {
    margin-top: auto;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;

    color: #69e4b0;
}

.sidebar-bottom small {
    display: block;
    color: var(--muted);
    margin-top: 10px;
}

.online-dot {
    display: inline-block;

    width: 7px;
    height: 7px;

    margin-right: 8px;

    background: #69e4b0;
    border-radius: 50%;

    box-shadow: 0 0 12px #69e4b0;

    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px #69e4b0;
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 18px #69e4b0;
    }
}


/* ============================================
   4. CONTENUTO PRINCIPALE
   ============================================ */

.main-content {
    position: relative;
    isolation: isolate;

    flex: 1;
    min-width: 0;

    padding: 0 45px 30px;

    background:
        radial-gradient(
            ellipse at 65% 0%,
            rgba(54, 72, 180, 0.16),
            transparent 45%
        ),
        var(--background);
}


/* GRIGLIA FUTURISTICA */

.main-content::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: -1;

    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(85, 125, 255, 0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(85, 125, 255, 0.035) 1px,
            transparent 1px
        );

    background-size: 45px 45px;

    mask-image: linear-gradient(
        to bottom,
        black,
        transparent 85%
    );
}


/* ============================================
   5. TOPBAR
   ============================================ */

.topbar {
    height: 90px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 45px;

    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 20px;

    color: var(--muted);
    font-size: 12px;
}

.avatar {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    color: white;
    font-weight: 800;

    background: linear-gradient(
        135deg,
        var(--blue),
        var(--purple)
    );

    box-shadow:
        0 0 20px rgba(68, 138, 255, 0.2);
}


/* ============================================
   6. PAGINE
   ============================================ */

.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================
   7. BENVENUTO
   ============================================ */

.welcome {
    margin-bottom: 38px;
}

.eyebrow {
    color: var(--cyan);
    margin-bottom: 16px;
}

.welcome h1 {
    font-size: clamp(35px, 4vw, 58px);
    line-height: 1.12;

    letter-spacing: -2px;
    font-weight: 900;
}

.welcome h1 span {
    background: linear-gradient(
        90deg,
        var(--blue),
        var(--cyan),
        var(--purple),
        var(--blue)
    );

    background-size: 200% auto;

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;

    animation: gradientFlow 6s linear infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.welcome p {
    color: var(--muted);
    margin-top: 18px;
    font-size: 14px;
}


/* ============================================
   8. CARD GLASSMORPHISM
   ============================================ */

.card {
    position: relative;

    padding: 25px;

    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 20px;

    backdrop-filter: blur(18px);

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.12);

    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.card:hover {
    border-color: rgba(68, 138, 255, 0.45);

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.25),
        0 0 30px rgba(68, 138, 255, 0.09);
}


/* RIFLESSO INTERATTIVO */

.card::before {
    content: "";

    position: absolute;
    inset: 0;

    border-radius: inherit;

    pointer-events: none;
    z-index: 0;

    background: radial-gradient(
        350px circle at
        var(--mouse-x, 50%)
        var(--mouse-y, 50%),
        rgba(95, 150, 255, 0.12),
        transparent 70%
    );

    opacity: 0;

    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card > * {
    position: relative;
    z-index: 1;
}


/* ============================================
   9. STATISTICHE
   ============================================ */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -2px;

    margin: 20px 0 8px;

    background: linear-gradient(
        135deg,
        #ffffff,
        #a9caff
    );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-description {
    color: var(--muted);
    font-size: 12px;
}


/* ============================================
   10. DASHBOARD GRID
   ============================================ */

.dashboard-grid {
    display: grid;

    grid-template-columns: 1.1fr 1fr;

    gap: 22px;
    margin-bottom: 22px;
}


/* ============================================
   11. UNIVERSO E PIANETA
   ============================================ */

.universe-card {
    min-height: 440px;
    text-align: center;
    overflow: hidden;
}

.universe-card .card-label {
    text-align: left;
}

.universe-card h2 {
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.universe-card p {
    color: var(--muted);
    font-size: 12px;
}


/* SCENA SPAZIALE */

.universe-scene {
    height: 300px;

    position: relative;

    display: grid;
    place-items: center;

    perspective: 900px;
    transform-style: preserve-3d;
}


/* PIANETA */

.planet {
    position: relative;
    z-index: 2;

    width: 165px;
    height: 165px;

    border-radius: 50%;

    background: radial-gradient(
        circle at 30% 25%,
        #8cf2ff 0%,
        #398cff 22%,
        #2440aa 55%,
        #090e3c 90%
    );

    box-shadow:
        0 0 45px rgba(68, 138, 255, 0.5),
        0 0 110px rgba(68, 138, 255, 0.18),
        inset -25px -20px 35px rgba(0, 0, 0, 0.45);

    animation: planetFloat 5s ease-in-out infinite;

    transition: filter 0.4s ease;
}

.universe-card:hover .planet {
    filter: brightness(1.2) saturate(1.25);
}


/* ATMOSFERA */

.planet::before {
    content: "";

    position: absolute;
    inset: -18px;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(60, 160, 255, 0.22),
        transparent 70%
    );

    filter: blur(14px);
    z-index: -1;
}

.planet::after {
    content: "";

    position: absolute;
    inset: -8px;

    border-radius: 50%;

    border: 1px solid rgba(80, 180, 255, 0.3);

    filter: blur(3px);
}


/* ORBITE */

.orbit {
    position: absolute;

    border: 1px solid rgba(83, 135, 255, 0.18);
    border-radius: 50%;

    transform: rotate(-25deg);
}

.orbit-one {
    width: 225px;
    height: 225px;

    animation: orbitSpin 25s linear infinite;
}

.orbit-two {
    width: 275px;
    height: 275px;

    animation: orbitSpin 35s linear infinite reverse;
}

.orbit-three {
    width: 330px;
    height: 330px;

    border-style: dashed;

    animation: orbitSpin 45s linear infinite;
}


/* SATELLITI LUMINOSI */

.orbit-one::after,
.orbit-two::after {
    content: "";

    position: absolute;

    width: 8px;
    height: 8px;

    top: 15%;
    left: 15%;

    border-radius: 50%;

    background: #9deeff;

    box-shadow:
        0 0 12px #39d9ff,
        0 0 25px rgba(57, 217, 255, 0.7);
}


/* STELLE GENERATE DAL JAVASCRIPT */

.star {
    position: absolute;

    width: 3px;
    height: 3px;

    border-radius: 50%;

    background: white;

    box-shadow: 0 0 8px #8deaff;

    pointer-events: none;

    animation:
        starTwinkle 3s ease-in-out infinite;
}


/* ANIMAZIONI SPAZIALI */

@keyframes planetFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-13px);
    }
}

@keyframes orbitSpin {
    from {
        transform: rotate(-25deg);
    }

    to {
        transform: rotate(335deg);
    }
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.6);
    }

    50% {
        opacity: 1;
        transform: scale(1.4);
    }
}


/* ============================================
   12. MISSIONI GIORNALIERE
   ============================================ */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    margin-bottom: 25px;
}

.section-heading h2 {
    font-size: 18px;
}

.section-heading span {
    font-size: 11px;
    color: var(--cyan);
    font-weight: 700;
}

.mission {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 17px 12px;

    border-bottom: 1px solid var(--border);
    border-radius: 10px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.mission:hover {
    background: rgba(68, 138, 255, 0.06);
    transform: translateX(4px);
}

.mission input {
    width: 19px;
    height: 19px;

    accent-color: var(--blue);

    cursor: pointer;
}

.mission span {
    font-size: 13px;
}

.mission.completed span {
    color: var(--muted);
    text-decoration: line-through;
}


/* PULSANTE RESET */

.secondary-button {
    margin-top: 25px;

    width: 100%;
    padding: 13px;

    border-radius: 10px;

    border: 1px solid var(--border);

    background: rgba(68, 138, 255, 0.08);

    color: var(--muted);

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.secondary-button:hover {
    color: white;

    border-color: var(--blue);

    background: rgba(68, 138, 255, 0.16);
}


/* ============================================
   13. MONDI E PROGRESSI
   ============================================ */

.worlds-card:hover {
    transform: translateY(-3px);
}

.world {
    display: grid;

    grid-template-columns: 160px 1fr 50px;

    align-items: center;
    gap: 20px;

    margin: 24px 0;
}

.world-name {
    font-size: 13px;
    font-weight: 600;
}

.progress-track {
    height: 8px;

    background: rgba(255, 255, 255, 0.07);

    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;

    border-radius: 10px;

    background: linear-gradient(
        90deg,
        var(--blue),
        var(--cyan)
    );

    box-shadow:
        0 0 15px rgba(57, 217, 255, 0.3);

    transition: width 1s ease;
}

.world-percent {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}


/* ============================================
   14. PAGINE SECONDARIE
   ============================================ */

.detail-hero {
    padding: 55px 35px;

    border-radius: 24px;
    border: 1px solid var(--border);

    background:
        radial-gradient(
            circle at 80% 50%,
            rgba(68, 138, 255, 0.18),
            transparent 50%
        ),
        var(--card);

    animation: fadeIn 0.5s ease;
}

.detail-icon {
    font-size: 50px;
    margin-bottom: 22px;
}

.detail-hero h1 {
    font-size: clamp(32px, 4vw, 54px);
    margin-bottom: 15px;
}

.detail-hero p {
    color: var(--muted);
    line-height: 1.8;
    max-width: 550px;
}

.detail-tag {
    display: inline-block;

    margin-top: 25px;
    padding: 10px 15px;

    border-radius: 20px;

    background: rgba(68, 138, 255, 0.12);

    color: var(--cyan);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}


/* ============================================
   15. FOOTER
   ============================================ */

footer {
    text-align: center;

    color: #56617d;

    font-size: 10px;
    letter-spacing: 2px;

    padding: 45px 0 10px;
}


/* ============================================
   16. RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


/* ============================================
   17. RESPONSIVE - SMARTPHONE
   ============================================ */

@media (max-width: 700px) {

    .app {
        flex-direction: column;
    }

    .sidebar {
        position: relative;

        width: 100%;
        min-width: 0;
        height: auto;

        padding: 18px;
    }

    .logo {
        margin-bottom: 20px;
    }

    .sidebar-label,
    .sidebar-bottom {
        display: none;
    }

    .navigation {
        flex-direction: row;
        overflow-x: auto;
    }

    .nav-item {
        flex-shrink: 0;
        padding: 12px;
    }

    .nav-item:hover {
        transform: none;
    }

    .main-content {
        padding: 0 18px 25px;
    }

    .topbar {
        height: 65px;
        margin-bottom: 30px;
    }

    .breadcrumb {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .profile {
        gap: 10px;
    }

    .profile #current-date {
        display: none;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }

    .card {
        padding: 18px;
    }

    .stat-number {
        font-size: 32px;
    }

    .stat-description {
        font-size: 11px;
    }

    .world {
        grid-template-columns: 100px 1fr 40px;
        gap: 10px;
    }

    .world-name {
        font-size: 11px;
    }

    .universe-scene {
        height: 270px;
    }

    .planet {
        width: 135px;
        height: 135px;
    }

    .orbit-one {
        width: 190px;
        height: 190px;
    }

    .orbit-two {
        width: 230px;
        height: 230px;
    }

    .orbit-three {
        width: 265px;
        height: 265px;
    }

    .detail-hero {
        padding: 35px 22px;
    }

}


/* ============================================
   18. ACCESSIBILITA'
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

}
