*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    padding: 20px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.container {
    background: #ffffff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    max-width: 1100px;
    width: 100%;
    position: relative;
    border: 1px solid #e9ecef;
}

#details-analysis-container {
    /* hidden by default */
    display: none;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    max-width: 1100px;
    width: 100%;
    position: relative;
    border: 1px solid #e9ecef;
}


#lang-theme-selector-container {
    /* above all the text*/
    position: static;
    margin-bottom: 12px;
    text-align: right;
}

/* Adjust the lang selector for small screens @media (max-width: 720px) {} */

#theme-toggle-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

#theme-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #dee2e6;
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

.lang-btn:hover {
    background: #f1f5f9;
    border-color: #dee2e6;
}


.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: center;
}

.input-group {
    display: flex;
    flex-direction: column;
}

p {
    text-align: center;
    margin-bottom: 24px;
    color: #495057;
}

h1 {
    color: #0056b3;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 16px;
    margin-bottom: 24px;
    font-weight: 600;
}

h2 {
    color: #095cb6;
    font-weight: 300;
    text-align: center;
    padding-top: 16px;
    margin-bottom: 24px;
}

h3 {
    color: #343a40;
    font-weight: 500;
    margin-top: 16px;
    margin-bottom: 8px;
    text-align: center;
}

li {
    color: #333;
    margin-bottom: 12px;
    line-height: 1.7;
}

ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

code {
    background-color: #e9ecef;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.equation {
    display: block;
    text-align: center;
    font-family: "Times New Roman", Times, serif;
    font-size: 1.2rem;
    padding: 15px;
    margin: 15px 0;
    background-color: #f8f9fa;
    border-radius: 6px;
    overflow-x: auto;
}

.inline-equation {
    font-family: "Times New Roman", Times, serif;
    font-weight: bold;
}

img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

a {
    color: #007bff;
    text-decoration: underline;
}

a:hover {
    color: #014d9e;
    text-decoration: underline;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #343a40;
}

input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    margin-top: 12px;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Canvas */
#decoCanvas {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 800px;
    max-height: 800px;
    margin: 0 auto 24px auto;
    display: block;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fdfdfd;
    cursor: crosshair;
}

/* Analysis details */
#plan-as-string {
    margin-top: 16px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    min-height: 40px;
    color: #333;
    /* Préserve le formatage */
    white-space: pre-wrap;
}


#plotly-plot {
    width: 100%;
    height: 1000px;
    margin: 0 auto;
}

/* DARK */
body.dark-mode {
    background-color: #2c2c2c;
    color: #e0e0e0;
}

body.dark-mode .container {
    background: #3a3a3a;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border-color: #4a4a4a;
}

body.dark-mode #details-analysis-container {
    background: #3a3a3a;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border-color: #4a4a4a;
}


body.dark-mode h1 {
    color: #90caf9;
    border-bottom-color: #4a4a4a;
}

body.dark-mode h2 {
    color: #a7d9ff;
}

body.dark-mode h3 {
    color: #e0e0e0;
}

body.dark-mode li {
    color: #cccccc;
}

body.dark-mode p {
    color: #cccccc;
}

body.dark-mode a {
    color: #64b5f6;
}

body.dark-mode label {
    color: #e0e0e0;
}

body.dark-mode input[type="number"] {
    background-color: #4a4a4a;
    border-color: #5a5a5a;
    color: #e0e0e0;
}

body.dark-mode input[type="range"] {
    background: #5a5a5a;
}

body.dark-mode input[type="range"]::-webkit-slider-thumb {
    background: #64b5f6;
    /* Lighter blue thumb */
    border-color: #3a3a3a;
}

body.dark-mode input[type="range"]::-moz-range-thumb {
    background: #64b5f6;
    /* Lighter blue thumb */
    border-color: #3a3a3a;
}



body.dark-mode #plan-as-string {
    background: #4a4a4a;
    border-color: #5a5a5a;
    color: #e0e0e0;
}

body.dark-mode code {
    background-color: #4a4a4a;
    color: #e0e0e0;
}

body.dark-mode .equation {
    background-color: #3a3a3a;
    border-color: #5a5a5a;
    color: #e0e0e0;
}

/* Adjust body flex-direction for small screens :mobile */
@media (max-width: 1200px) {
    body {
        flex-direction: column;
        align-items: center;
    }
}
