﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: monospace;
}

/* BARRA SUPERIORE (TOP NAVBAR) */
.top-navbar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13, 20, 36, 0.92);
    border: 1px solid #2a4365;
    border-radius: 8px;
    padding: 6px 12px;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    width: max-content;
    max-width: 95vw;
}

    .top-navbar .nav-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

.btn-nav {
    background: rgba(26, 38, 56, 0.8);
    color: #ffffff;
    border: 1px solid #3182ce;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .btn-nav:hover {
        background: #2b6cb0;
        border-color: #63b3ed;
        box-shadow: 0 0 8px rgba(99, 179, 237, 0.4);
    }

.btn-nav-primary {
    background: #007bff;
    border-color: #0056b3;
    color: #ffffff;
}

    .btn-nav-primary:hover {
        background: #0069d9;
        border-color: #004085;
        box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
    }

    .btn-nav-primary.active-pause {
        background: #dc3545;
        border-color: #bd2130;
    }

        .btn-nav-primary.active-pause:hover {
            background: #c82333;
        }

/* DISPLAY CRONOMETRO */
.chrono-display {
    background: #060b13;
    border: 1px solid #1a365d;
    border-radius: 6px;
    padding: 5px 12px;
    color: #00bfff;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    min-width: 130px;
    text-align: center;
    box-shadow: inset 0 0 5px rgba(0, 191, 255, 0.2);
}

/* SVG CANVAS */
svg {
    width: 100vw;
    height: 100vh;
    display: block;
    cursor: crosshair;
}

#coords-mobile-box {
    position: absolute;
    color: yellow;
    background-color: transparent;
    padding: 4px 8px;
    font-size: 14px;
    pointer-events: none;
    user-select: none;
    display: none;
    white-space: pre-line;
}

.sun-corona {
    cx: 50%;
    cy: 50%;
    r: 100px;
    fill: url(#sun-corona-gradient);
    filter: blur(15px);
    opacity: 0.85;
    pointer-events: none;
}

.sun-body {
    cx: 50%;
    cy: 50%;
    r: 50px;
    fill: url(#sun-surface-gradient);
    filter: drop-shadow(0 0 10px #ff6600);
}

/* RENDERING TRIDIMENSIONALE E SFERICO DEI TRE PIANETI */
#planet-1 {
    fill: url(#planet-a-gradient) !important;
}

#planet-2 {
    fill: url(#planet-b-gradient) !important;
}

#planet-3 {
    fill: url(#planet-c-gradient) !important;
}

.effetto-boccia {
    fill: url(#boccia-gradient);
    pointer-events: none; /* Impedisce di bloccare i click del mouse */
}

.star {
    fill: #ffffff;
    opacity: 0.8;
}

/* PANNELLO DI CONTROLLO FLUTTUANTE */
#control-panel {
    position: absolute;
    top: 70px;
    left: 20px;
    width: 320px;
    z-index: 1000;
    background: rgba(15, 15, 25, 0.92);
    border: 1px solid #00ff00;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    color: #00ff00;
    font-size: 24px;
    font-weight: 600;
    overflow: hidden;
    user-select: none;
    display: none;
}

    #control-panel label,
    #control-panel header,
    #control-panel .title {
        font-size: 16px;
        font-weight: bold;
    }

    #control-panel input[type="text"],
    #control-panel input[type="number"] {
        font-size: 22px;
        font-weight: bold;
        padding: 4px 6px;
    }

.panel-header {
    padding: 8px 12px;
    background: rgba(0, 255, 0, 0.15);
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    cursor: move;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

/* SEZIONE OPZIONI GRAFICHE */
.panel-options {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

    .panel-options input[type="checkbox"] {
        accent-color: #00ff00;
        cursor: pointer;
        width: 16px;
        height: 16px;
    }

/* Stili campi input pianeta */
.planet-input-group {
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 4px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
}

.planet-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
}

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.input-row {
    display: flex;
    align-items: center;
    font-size: 13px;
}

    .input-row label {
        width: 28px;
    }

    .input-row input {
        width: 100%;
        background: #000;
        border: 1px solid rgba(0, 255, 0, 0.4);
        color: #00ff00;
        font-family: inherit;
        font-size: 13px;
        font-weight: bold;
        padding: 3px 5px;
        border-radius: 2px;
        text-align: right;
    }

        .input-row input:focus {
            outline: none;
            border-color: #00ff00;
            background: #051505;
        }

        .input-row input[readonly] {
            border-color: rgba(0, 255, 0, 0.15);
            color: #00cc00;
            background: rgba(0, 0, 0, 0.5);
        }

/* PANNELLO IMPULSI ORBITALI */
.impulse-panel {
    border: 1px solid #2a4365;
    background: rgba(13, 20, 36, 0.9);
    border-radius: 6px;
    padding: 10px;
    margin-top: 4px;
    box-shadow: 0 0 8px rgba(30, 144, 255, 0.2);
}

.impulse-title {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #63b3ed;
    margin-bottom: 8px;
    border-bottom: 1px solid #2b6cb0;
    padding-bottom: 4px;
}

.impulse-selector {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #9ae6b4;
}

    .impulse-selector label {
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .impulse-selector input[type="radio"] {
        accent-color: #00ff00;
        cursor: pointer;
    }

.pad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pad-row {
    display: flex;
    gap: 4px;
}

/* DIMENSIONI E STILE PULSANTI D-PAD */
.btn-pad {
    width: 44px;
    height: 44px;
    background: #1a2638;
    border: 1px solid #3182ce;
    border-radius: 6px;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

    .btn-pad:hover {
        background: #2b6cb0;
        border-color: #63b3ed;
        box-shadow: 0 0 8px rgba(99, 179, 237, 0.6);
    }

    .btn-pad:active {
        transform: scale(0.92);
        background: #3182ce;
    }

/* STILE PER IL PULSANTE CENTRALE (RESET/X) */
#pad-reset {
    color: #ff5555;
    font-size: 16px;
}

.impulse-readout {
    text-align: center;
    font-size: 15px;
    color: #63b3ed;
    margin-top: 8px;
    font-weight: bold;
}

.orbit-trail {
    fill: none;
    stroke-width: 1.5;
    stroke-dasharray: 5 1;
    pointer-events: none;
}

/* MODALE TEORIA E FORMULE */
.theory-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.theory-card {
    background: rgba(13, 20, 36, 0.96);
    border: 1px solid #1e3a8a;
    border-radius: 10px;
    width: 200%;
    max-width: 1000px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(30, 144, 255, 0.2);
    color: #e2e8f0;
    overflow: hidden;
}

.theory-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #1e3a8a;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

    .theory-card-header h2 {
        color: #63b3ed;
        font-size: 24px;
        letter-spacing: 1.5px;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .theory-card-header h3 {
        color: #a0aec0;
        font-size: 16px;
        font-weight: normal;
    }

.btn-close-control {
    background: transparent;
    color: #a0aec0;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .btn-close-control:hover {
        color: #ffffff;
        background: rgba(220, 53, 69, 0.8);
    }

.theory-card-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.4;
}

.theory-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 680px) {
    .theory-grid-two {
        grid-template-columns: 1fr;
    }
}

.theory-block {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.theory-block-title {
    color: #ecc94b;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.theory-block-text {
    color: #cbd5e0;
    font-size: 14px;
    margin-bottom: 4px;
}

/* FORMULE IN STILE ALGEBRICO CLASSICO */
.theory-formula-box {
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}

.math-eq {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Times New Roman", Times, serif;
    font-size: 18px;
    color: #ffffff;
}

    .math-eq i {
        font-style: italic;
    }

.frac {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    padding: 0 4px;
}

    .frac .num {
        border-bottom: 1px solid #ffffff;
        padding-bottom: 2px;
        line-height: 1.1;
    }

    .frac .den {
        padding-top: 2px;
        line-height: 1.1;
    }

.theory-section-title {
    color: #63b3ed;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.theory-list {
    font-size: 14px;
    color: #cbd5e0;
    padding-left: 20px;
}

    .theory-list li {
        margin-bottom: 8px;
    }

.theory-card-footer {
    padding: 12px 20px;
    border-top: 1px solid #1e3a8a;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: flex-start;
}

.math-n {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-size: 15px;
    font-weight: bold;
}

/* FIRMA IN CALCE AL FOOTER DELLA MODALE */
.theory-author-credits {
    text-align: center;
    font-size: 11px;
    font-style: italic;
    color: #a0aec0;
    margin-top: 2px;
    width: 100%;
}

/* TOOLTIP PER LE COORDINATE (x ; y) ACCANTO AL MOUSE */
.pos-xy {
    position: fixed;
    z-index: 2500;
    pointer-events: none;
    user-select: none;
    display: none;
    color: white;
    font-size: 14px;
    font-weight: 400;
    font-family: monospace, sans-serif;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 0, 0.3);
    white-space: nowrap;
}
