:root {
    --text-shadow: 0 0 2px rgb(51, 51, 51);
    --text-color: rgb(46, 46, 46);
    --linear-text-color: linear-gradient(90deg, blue, rgb(150, 150, 230));
    --box-shadow: 5px 5px 2px rgb(200, 200, 200);
    --header-footer-bg: rgb(190, 190, 190);
}

/* Reset et Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
    font-family: system-ui, Arial, Helvetica, sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* Layout Principal */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: rgb(245, 247, 250);
}

/* Header */
.app__header {
    height: 5rem;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.header__title {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.header__heading {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    background: var(--linear-text-color);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: website-name-move 1s ease-in-out;
}

.header__nav {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex: 1;
}

.header__actions {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.btn--language {
    display: none;
}

.btn__text {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

/* Main Content */
.app__main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.main__intro {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.intro__title {
    width: 100%;
    max-width: 800px;
    margin: 1rem 0 3rem;
    text-align: center;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    background: var(--linear-text-color);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-move 1.5s ease-in-out;
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn--primary {
    background: var(--linear-text-color);
    color: white;
}

.btn--primary:hover {
    background: rgb(0, 86, 179);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn--primary:active {
    transform: translateY(0);
}

#openBestPracticesModalBtn {
    margin-bottom: 3rem;
    animation: best-practices-btn--move 2s ease-in-out;
}

.intro__description {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-weight: 600;
    color: var(--text-color);
    animation: intro-description--move 2.5s ease-in-out;
}

.intro__description p {
    width: 100%;
    text-align: center;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Sections */
.main__container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    animation: main-container-move 3s ease-in-out;
}

.main__section {
    width: 100%;
    max-width: 900px;
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.section-header {
    height: 3rem;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid;
}

.section-header__icon {
    width: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 600;
}

.section-header__title {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: var(--text-color);
}

/* Forms */
.section-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group {
    width: 95%;
    display: flex;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.form-group--container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    /* margin-bottom: 0; */
    margin: 1rem 0;
    padding: 0 1rem;
}

.form-group--multiple {
    width: 45%;
    /* flex: 1; */
    min-width: 200px;
    display: flex;
    /* flex-direction: column-reverse; */
    align-items: center;
}

.form-group__content {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.form-group__content--multiple {
    margin-right: 0;
}

.form-group__content--output-textarea {
    /* margin: 0; */
    margin-left: 2rem;
}

.form-group__content--output-select {
    margin-left: 2rem;
}

.form-group__header {
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    gap: 0.5rem;
}

.form-group__label {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    padding-left: 0.5rem;
}

.help-button {
    display: flex;
    justify-content: center;
    align-items: center;
    /* padding: 0.2rem 0.5rem; */
    border-radius: 50px;
    border: none;
    font-size: 1.2rem;
    background-color: blue;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.help-button:hover {
    background: darkblue;
    transform: scale(1.1);
}

.form-group__textarea {
    min-height: 6rem;
    width: 100%;
    padding: 0.5rem;
    resize: vertical;
    border-radius: 8px;
    background-color: white;
    border: 1px solid #ccc;
    transition: border 0.2s;
}

.form-group__textarea:hover {
    border: 2px solid blue;
}

.form-group__select {
    width: 100%;
    max-width: 40%;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: white;
    border: 1px solid #ccc;
    transition: border 0.2s; /* ********************************* */
}

.form-group__select:hover {
    border: 2px solid blue;
}

.form-group__select--multiple {
    width: 95%;
    max-width: 100%;
}

.form-group__toggle {
    height: 2.5rem;
    width: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    accent-color: blue;
    cursor: pointer;
}

.toggle__input:hover {
    transform: scale(1.1);
    transition: 200ms linear;
}

.form-group__copy-btn {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* Sections spécifiques */
#task-section {
    background-color: rgba(50, 150, 250, 0.3);
    border: 2px solid rgb(50, 150, 250);
    box-shadow: 0 0 12px rgba(50, 150, 250, 0.6);
}

.section-header--task {
    border-bottom-color: rgba(50, 150, 250, 0.5);
}

.task-section__icon {
    color: rgb(50, 150, 250);
}

#context-section {
    background-color: rgba(30, 200, 50, 0.3);
    border: 2px solid rgb(30, 200, 50);
    box-shadow: 0 0 12px rgba(30, 200, 50, 0.6);
}

.section-header--context {
    border-bottom-color: rgba(30, 200, 50, 0.5);
}

.context-section__icon {
    color: rgb(30, 200, 50);
}

#references-section {
    background-color: rgb(248, 239, 197);
    border: 2px solid rgb(255, 166, 77);
    box-shadow: 0 0 12px rgba(255, 166, 77, 0.6);
}

.section-header--references {
    border-bottom-color: rgb(255, 166, 77);
}

.references-section__icon {
    color: rgb(255, 166, 77);
}

#output-section {
    background-color: rgba(132, 0, 255, 0.1);
    border: 2px solid rgba(132, 0, 255, 0.5);
    box-shadow: 0 0 12px rgba(132, 0, 255, 0.3);
}

.section-header--output {
    border-bottom-color: rgba(132, 0, 255, 0.5);
}

#output {
    min-height: 15rem;
}

.output-section__icon {
    color: rgba(132, 0, 255, 0.5);
}

.output-copy-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    position: absolute;
    right: 1.5rem;
    z-index: 5;
    transition: all 0.2s;
}

.output-copy-btn:hover {
    transform: scale(1.1);
    color: green;
}

.output-copy-btn__icon {
    color: rgb(70, 70, 70);
}

.copy-confirmation-msg-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    background-color: white;
    border: 2px solid blue;
    opacity: 1;
    transition: opacity 0.3s ease; /* Animation fluide */
}

.copy-confirmation-msg-container.is-hidden {
    display: none;
    opacity: 0;
}

.copy-confirmation-msg {
    padding: 1.2rem;
    font-size: 1rem;
    color: blue;
}

.output-section__tips-list-container {
    width: 90%;
    display: flex;
    justify-content: center;
    margin: 2rem 0;
        padding: 0 1rem;
}

.output-section__tips-list {
    padding: 0.5rem 2rem;
    border: 2px solid rgba(132, 0, 255, 0.5);
    border-radius: 8px;
}

.output-section__tips-list li {
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.tips-item {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-color);
    margin: 0.2rem;
    list-style-type: circle;
    margin-left: 1rem;
}

.tips-item strong {
    font-weight: bold;
}

/* Footer */
.app__footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    color: var(--text-color);
    font-size: clamp(0.8rem, 2vw, 1rem);
}

/* Scroll to Top Button */
#scrollToTop-btn {
    height: 3rem;
    width: 3rem;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--linear-text-color);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    animation: scrollToTop-btn-move 4s ease-in-out;
    transition: transform 0.2s;
    z-index: 7;
}

#scrollToTop-btn:hover {
    transform: scale(1.1);
}

/* Accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.modal__backdrop {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(2px);
    z-index: 999;
}

/* Animations */
@keyframes website-name-move {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes title-move {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes best-practices-btn--move {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes intro-description--move {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes main-container-move {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scrollToTop-btn-move {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes copy-pop {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* === RESPONSIVE === */

/* Tablettes */
@media (max-width: 768px) {
    .app__header {
        height: auto;
        flex-direction: column;
        padding: 1rem;
    }

    .header__title {
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
    }

    .header__nav {
        width: 100%;
        margin: 1rem 0;
    }

    .header__actions {
        width: 100%;
    }

    .intro__title {
        margin: 1rem 0 2rem;
    }

    .main__section {
        padding: 1rem 0.5rem;
    }

    .form-group--container {
        flex-direction: column;
        padding: 0;
    }

    .form-group--multiple {
        width: 100%;
        min-width: 100%;
    }

    .form-group__select {
        max-width: 100%;
    }

    .copy-confirmation-msg{
        padding: 1rem;
        font-size: 0.8rem;
    }

    #scrollToTop-btn {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    .app__main {
        padding: 1rem 0.5rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    #openBestPracticesModalBtn {
        margin-bottom: 2rem;
    }

    .intro__description {
        gap: 0.75rem;
    }

    .main__section {
        margin-bottom: 1.5rem;
        padding: 0.75rem 0.5rem;
    }

    .section-header {
        height: auto;
        padding: 0.5rem 0;
    }

    .section-header__icon {
        width: 2.5rem;
        font-size: 1.2rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-group__header {
        /* flex-direction: column; */
        align-items: flex-start;
        gap: 0.3rem;
    }

    .help-button{
        margin-top: 0.2rem;
    }

    .form-group__textarea {
        min-height: 5rem;
        font-size: 0.9rem;
    }

    .output-section__tips-list {
        padding: 0.5rem 1rem;
    }

    #scrollToTop-btn {
        height: 2.5rem;
        width: 2.5rem;
        bottom: 0.75rem;
        right: 0.75rem;
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    .app__main {
        padding: 0.75rem 0.25rem;
    }

    .main__section {
        padding: 0.5rem 0.25rem;
    }

    .form-group--container {
        padding: 0;
    }

    .copy-confirmation-msg{
        padding: 0.6rem;
        font-size: 0.8rem;
    }

}