/* ------------------------- */
/* General page styling */
/* ------------------------- */

* {

    box-sizing: border-box;

}


html {

    scroll-behavior: smooth;

}


body {

    margin: 0;

    font-family: Arial, Helvetica, sans-serif;

    background-color: #0b0f14;

    color: #f2f2f2;

    line-height: 1.6;

}



/* ------------------------- */
/* Navigation */
/* ------------------------- */

.site-header {

    position: sticky;

    top: 0;

    background-color: rgba(11, 15, 20, 0.95);

    border-bottom: 1px solid #202832;

    z-index: 100;

}


.navbar {

    max-width: 1200px;

    margin: auto;

    padding: 18px 25px;

    display: flex;

    justify-content: space-between;

    align-items: center;

}


.logo {

    color: white;

    text-decoration: none;

    font-size: 21px;

    font-weight: 600;

}


.nav-links {

    display: flex;

    gap: 30px;

}


.nav-links a {

    color: #b9c1ca;

    text-decoration: none;

    font-size: 15px;

}


.nav-links a:hover {

    color: white;

}



/* ------------------------- */
/* Introduction */
/* ------------------------- */

.page-intro {

    max-width: 1100px;

    margin: auto;

    padding: 90px 25px 55px 25px;

}


.section-label {

    color: #78a9ff;

    text-transform: uppercase;

    letter-spacing: 2px;

    font-size: 12px;

}


.page-intro h1 {

    margin: 8px 0 15px 0;

    font-size: 52px;

}


.intro-text {

    max-width: 700px;

    font-size: 18px;

    color: #aab3bd;

}



/* ------------------------- */
/* Simulation layout */
/* ------------------------- */

.simulation-section {

    max-width: 1200px;

    margin: auto;

    padding: 20px 25px 100px 25px;

}


.simulation-container {

    display: grid;

    grid-template-columns: 2fr 1fr;

    gap: 25px;

}


.canvas-container {

    position: relative;

    background-color: #080b0f;

    border: 1px solid #202832;

    border-radius: 12px;

    min-height: 600px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

}

.simulation-hud {

    position: absolute;

    top: 18px;

    left: 20px;

    right: 20px;

    display: flex;

    justify-content: space-between;

    color: #8d99a6;

    font-size: 14px;

    z-index: 5;

    pointer-events: none;

}

#pendulum-canvas {

    width: 100%;

    height: auto;

    display: block;

}



/* ------------------------- */
/* Controls */
/* ------------------------- */

.controls-panel {

    background-color: #111820;

    border: 1px solid #202832;

    border-radius: 12px;

    padding: 28px;

}


.controls-panel h2 {

    margin-top: 0;

    font-size: 19px;

}


.secondary-heading {

    margin-top: 35px !important;

}


.control-group {

    margin-bottom: 24px;

}


.control-group label {

    display: flex;

    justify-content: space-between;

    color: #d8dee5;

    margin-bottom: 10px;

    font-size: 14px;

}


.control-group label span {

    color: #78a9ff;

}


.control-group input {

    width: 100%;

}

/* Disabled sliders */

input[type="range"]:disabled {

    opacity: 0.35;

    cursor: not-allowed;

}

/* Disabled chaos perturbation control */

#perturbation-control {

    transition: opacity 0.2s ease;

}


#perturbation-control.disabled {

    opacity: 0.4;

}



/* =========================
   INFORMATION TOOLTIPS
   ========================= */

   .label-with-info {

    display: inline-flex;

    align-items: center;

    gap: 7px;

}


.info-tooltip {

    position: relative;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    color: #78a9ff;

    font-size: 14px;

    cursor: help;

    outline: none;

}


.tooltip-text {

    position: absolute;

    left: 50%;

    bottom: calc(100% + 12px);

    transform: translateX(-50%);

    width: 260px;

    padding: 12px 14px;

    background-color: #18212b;

    border: 1px solid #2b3744;

    border-radius: 8px;

    color: #c3ccd6;

    font-size: 12px;

    font-weight: normal;

    line-height: 1.5;

    text-align: left;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;

    z-index: 20;

}


.info-tooltip:hover .tooltip-text,
.info-tooltip:focus .tooltip-text {

    opacity: 1;

    visibility: visible;

    transform:
        translateX(-50%)
        translateY(-3px);

}

input[type="range"] {

    accent-color: #78a9ff;

    cursor: pointer;

}



/* ------------------------- */
/* Buttons */
/* ------------------------- */

.button-row {

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 35px;

}


button {

    padding: 11px 18px;

    border-radius: 6px;

    cursor: pointer;

    font-size: 14px;

}


.primary-button {

    background-color: #78a9ff;

    border: 1px solid #78a9ff;

    color: #09101a;

}


.primary-button:hover {

    background-color: #9bbfff;

}


.secondary-button {

    background-color: transparent;

    border: 1px solid #384655;

    color: white;

}


.secondary-button:hover {

    border-color: #78a9ff;

}



/* ------------------------- */
/* Simulation status */
/* ------------------------- */

.simulation-status {

    margin-top: 25px;

    display: flex;

    align-items: center;

    gap: 8px;

    color: #aab3bd;

    font-size: 13px;

}


.status-dot {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background-color: #78a9ff;

}



/* ------------------------- */
/* Theory sections */
/* ------------------------- */

.content-section {

    max-width: 1100px;

    margin: auto;

    padding: 90px 25px;

    border-top: 1px solid #202832;

}


.content-section h2 {

    font-size: 34px;

    margin-top: 5px;

}


.content-section > p {

    max-width: 800px;

    color: #aab3bd;

    font-size: 17px;

}


.information-grid {

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 20px;

    margin-top: 45px;

}


.information-card {

    background-color: #111820;

    border: 1px solid #202832;

    border-radius: 10px;

    padding: 28px;

}


.information-card h3 {

    margin-top: 0;

}


.information-card p {

    color: #aab3bd;

}


.equation {

    margin-top: 20px;

    padding: 18px;

    background-color: #080b0f;

    border-radius: 6px;

    text-align: center;

    font-size: 18px;

}



/* ------------------------- */
/* Placeholder graph */
/* ------------------------- */

.placeholder-graph {

    min-height: 260px;

    margin-top: 35px;

    border: 1px dashed #384655;

    border-radius: 10px;

    display: flex;

    align-items: center;

    justify-content: center;

    color: #65717e;

}

.graph-container {

    margin-top: 35px;

    background-color: #111820;

    border: 1px solid #202832;

    border-radius: 10px;

    padding: 25px;

    height: 420px;

}

.analysis-heading {

    margin-top: 55px;

}


.analysis-heading h3 {

    font-size: 23px;

    margin-bottom: 8px;

}


.analysis-heading p {

    color: #aab3bd;

}


.energy-summary {

    margin-top: 18px;

    padding: 16px 20px;

    background-color: #111820;

    border: 1px solid #202832;

    border-radius: 8px;

    display: flex;

    justify-content: space-between;

    gap: 20px;

    color: #aab3bd;

}


.energy-summary strong {

    color: #78a9ff;

}

#angle-chart {

    width: 100% !important;

    height: 100% !important;

}


/* ------------------------- */
/* Footer */
/* ------------------------- */

footer {

    border-top: 1px solid #202832;

    padding: 30px;

    text-align: center;

    color: #65717e;

    font-size: 14px;

}



/* ------------------------- */
/* Mobile layout */
/* ------------------------- */

@media (max-width: 900px) {

    .simulation-container {

        grid-template-columns: 1fr;

    }


    .canvas-container {

        min-height: auto;

    }


    .controls-panel {

        max-width: none;

    }

}


@media (max-width: 700px) {

    .navbar {

        flex-direction: column;

        gap: 15px;

    }


    .nav-links {

        gap: 20px;

    }


    .page-intro h1 {

        font-size: 40px;

    }


    .information-grid {

        grid-template-columns: 1fr;

    }


    .button-row {

        flex-direction: column;

    }


    button {

        width: 100%;

    }

}