html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Trebuchet MS', Helvetica, sans-serif;
}
#container {
    background-color: var(--color-color-0);
    margin: 0px;
    padding: 0px;
    display: flex;
    flex-direction: column;
    height: 100dvh;
}
#map {
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    flex: 1;
}
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    color: black;
    padding: 20px;
    flex-shrink: 0;
}
#titre_principal {
    display: flex;
    align-items: center;
    justify-content: space-around;
}
#content {
    display: flex;
    flex-direction: row;
    padding: 20px;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
}
#content[hidden] {
    display: none;
}
#podiumsButton[hidden],
#legalButton[hidden],
#userBtnAndName[hidden] {
    display: none;
}
.element:nth-child(1) {
    flex: 1;
}
#data {
    flex: 0 0 300px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}
#greatFinds {
    flex: 0 0 300px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: var(--color-color-1);
    border-radius: 10px;
    margin-top: 0px;
    margin-bottom: 10px;
    margin-right: 20px;
    padding: 30px;
    overflow-y: auto;
    min-height: 0;
    box-sizing: border-box;
}
#greatFinds h3 {
    margin-top: 0;
}
#greatFinds ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#greatFinds li img {
    display: block;
    height: 100px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
}
#greatFinds .great-find-title {
    font-weight: bold;
    margin: 0 0 6px;
}
#greatFinds .great-find-subtitle {
    margin: 6px 0 0;
    font-size: 0.85em;
    color: var(--color-color-2);
}
#form_waste {
    flex-shrink: 0;
}
#wastes {
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: var(--color-color-1);
    border-radius: 10px;
    margin-top: 0px;
    margin-bottom: 10px;
    margin-left: 20px;
    margin-right: 20px;
    padding: 30px 0 30px 30px;
    min-height: 0;
    overflow: hidden;
}
/* Le titre (et la ligne de date) générés par /views/wastes restent fixes ;
   seule la liste des types défile. Le padding droit est repris par chaque
   enfant plutôt que par #wastes, pour que l'ascenseur de la liste colle au
   bord droit de la colonne au lieu d'être décalé par le padding du conteneur. */
#wastes > h4,
#wastes > p {
    flex-shrink: 0;
    padding-right: 30px;
}
#wastes > ul {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 30px;
}
#wastes li.selected {
    padding: 10px;
    background-color: var(--color-color-2);
    color: white;
    border-radius: 8px;
}
#wastes li:not(.selected):hover {
    background-color: var(--color-color-1);
}
ul {
    list-style-type:none;
    text-align: left;
    padding: 0;
}
#brands {
    list-style-type: disc;
    padding-left: 20px;
}
#waste {
    text-align: center;
    background-color: var(--color-color-1);
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 0px;
    margin-left: 20px;
    margin-right: 20px;
    padding: 30px;
}
figure {
    margin: auto;
}
.scan-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-color-2);
    border: 2px solid white;
}
#headerLeft {
    justify-self: start;
    align-self: start;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
#infoButton2 {
    align-self: center;
}
#headerRight {
    justify-self: end;
    align-self: start;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}
#langSwitcher {
    display: flex;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}
#langSwitcher a {
    color: black;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
}
#langSwitcher a:hover {
    background-color: var(--color-color-1);
}
#langSwitcher a.lang-active {
    background-color: var(--color-color-1);
}
#userBtnAndName {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
#userName {
    margin: 0;
    font-size: 13px;
}

#userButton.logged-in {
    background-color: var(--color-color-2);
}

#userButton.logged-in svg circle,
#userButton.logged-in svg path {
    stroke: white;
}

.icon-button {
background: var(--color-color-1); /* jaune clair, à ajuster selon ta charte exacte */
border: none;
border-radius: 50%;
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
padding: 0;
}
svg[hidden] {
    display: none;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-content {
    background-color: var(--color-color-1);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}

.modal-body h3 {
    margin-top: 20px;
    margin-bottom: 8px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.tester-section {
    margin-top: 20px;
}

.link-button {
    background: none;
    border: none;
    color: var(--color-orange-accent);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
}

.tester-form[hidden] {
    display: none;
}

.tester-form, .login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-row {
    display: flex;
    gap: 12px;
}

#logoutModal .form-row {
    justify-content: center;
}

#logoutModal .form-row button {
    flex: 1;
}

.form-row .form-field {
    flex: 1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"] {
    background-color: var(--color-field-highlight);
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.15s ease;
}

.form-field input:focus {
    outline: none;
    border-color: var(--color-color-2);
}

.platform-toggle {
    display: flex;
    gap: 8px;
}

.platform-toggle input[type="radio"] {
    display: none;
}

.platform-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.platform-toggle input[type="radio"]:checked + .platform-option {
    background-color: var(--color-field-highlight);
    font-weight: 600;
}

#testerSubmit, #loginSubmit, #logoutSubmit, #logoutCancel, #contactSubmit {
    background-color: var(--color-color-2);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.15s ease;
}

#testerSubmit:hover, #loginSubmit:hover, #contactSubmit:hover {
    opacity: 0.9;
}

#testerSubmit:disabled, #loginSubmit:disabled, #contactSubmit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#testerStatus {
    font-size: 14px;
    text-align: center;
    margin: 0;
    color: #2e7d32;
}

#testerConfirmation {
    margin-top: 16px;
    font-size: 15px;
    color: #2e7d32;
    font-weight: 600;
}

.form-field input:-webkit-autofill,
.form-field input:-webkit-autofill:hover,
.form-field input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--color-field-highlight) inset;
    -webkit-text-fill-color: #000;
    transition: background-color 5000s ease-in-out 0s;
}

#podiumsView {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
}

#podiumsView[hidden] {
    display: none;
}

#legalView {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
}

#legalView[hidden] {
    display: none;
}

#legalContent {
    max-width: 640px;
    margin: 0 auto;
}

#legalContent h3 {
    margin-top: 24px;
    margin-bottom: 8px;
}

#legalContent h3:first-child {
    margin-top: 0;
}

#legalContent h4 {
    margin-top: 18px;
    margin-bottom: 6px;
}

#legalContent p {
    line-height: 1.5;
}

#legalContent hr {
    margin: 28px 0;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

#legalContent form {
    margin-top: 16px;
}

.form-field textarea {
    background-color: var(--color-field-highlight);
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.15s ease;
}

.form-field textarea:focus {
    outline: none;
    border-color: var(--color-color-2);
}

#podiumsTriangle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "types  types"
        "users  brands";
    gap: 32px 16px;
    max-width: 700px;
    margin: 0 auto;
}

.podium-section.podium-types {
    grid-area: types;
}

.podium-section.podium-users {
    grid-area: users;
}

.podium-section.podium-brands {
    grid-area: brands;
}

.podium-section {
    text-align: center;
}

@media (max-width: 480px) {
    #podiumsTriangle {
        grid-template-columns: 1fr;
        grid-template-areas:
            "types"
            "users"
            "brands";
    }
}

.podium-section h3 {
    margin-bottom: 16px;
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.podium-step {
    background-color: var(--color-color-1);
    border-radius: 10px 10px 0 0;
    width: 100px;
    box-sizing: border-box;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.podium-step.first {
    height: 170px;
    padding-top: 22px;
    background-color: var(--color-color-2);
    color: white;
    order: 2;
}

.podium-step.second {
    height: 130px;
    order: 1;
}

.podium-step.third {
    height: 100px;
    order: 3;
}

.podium-rank {
    font-size: 22px;
    font-weight: 700;
}

.podium-label {
    font-weight: 600;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.podium-types .podium-step {
    width: 130px;
}

.podium-types .podium-step.first {
    height: 210px;
}

.podium-types .podium-step.second {
    height: 170px;
}

.podium-types .podium-step.third {
    height: 140px;
}

.podium-count {
    font-size: 13px;
    opacity: 0.85;
}
.context-menu {
    position: fixed;
    z-index: 1100;
    background-color: var(--color-color-1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    padding: 4px;
    min-width: 150px;
}

.context-menu[hidden] {
    display: none;
}

.context-menu-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    color: #c0392b;
}

.context-menu-item:hover {
    background-color: var(--color-field-highlight);
}
