:root {
    --primary-color: #173872;
    --accent-color: #59a5bb;
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --bg-soft-blue: #eff6ff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-blue: #dbeafe;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.06);

    /* Plugin notes colors */
    --note-yellow-bg: #fef9c3;
    --note-yellow-text: #854d0e;
    --note-green-bg: #dcfce7;
    --note-green-text: #166534;
    --note-blue-bg: #dbeafe;
    --note-blue-text: #1e40af;
    --note-purple-bg: #f3e8ff;
    --note-purple-text: #6b21a8;
    --note-red-bg: #fee2e2;
    --note-red-text: #991b1b;
}

body {
    font-family: 'Fredoka', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 5%;
    height: 80px;
    font-size: 1.5rem;
    color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 1px 3px var(--shadow-light);
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

header img {
    height: 50px;
    vertical-align: middle;
}

main {
    margin: 0 auto;
    max-width: 1400px;
    padding: 100px 20px 0 20px;
}

#accroche {
    text-align: center;
    margin-bottom: 2.5rem;
}

#accroche b {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.5rem;
}

#accroche span {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-muted);
}

#content {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 20px;
}

#left-col {
    flex: 1;
    max-width: 60%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#pres {
    padding: 20px 40px;
    border-radius: 16px;
    background: var(--bg-white);
    box-shadow: 0 4px 6px -1px var(--shadow-light), 0 2px 4px -1px var(--shadow-medium);
    font-size: 1.1rem;
    line-height: 1.6;
    min-height: 400px;
}

#pres h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
}

#pres p {
    margin-bottom: 1.2rem;
}

#pres ul {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
}

#pres li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.8rem;
}

#pres li::before {
    content: "\f058"; /* fa-check-circle */
    font-family: "Font Awesome 7 Free", "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

#pres li b {
    color: inherit;
}

#connect {
    padding: 0 0 0 10px;
    margin-bottom: 1vh;
    background: var(--bg-soft-blue);
    border-radius: 16px;
    border: 1px solid var(--border-blue);
    text-align: center;
}

#connect p:first-of-type {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

#connect b {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.connect-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 2rem 0;
}

.connect-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s;
    text-decoration: none;
    min-width: 180px;
}

.connect-button[href="/register"] {
    background-color: var(--primary-color);
    color: var(--bg-white) !important;
}

.connect-button[href="/register"]:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 56, 114, 0.3);
}

.connect-button[href="/login"] {
    background-color: var(--bg-white);
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
}

.connect-button[href="/login"]:hover {
    background-color: var(--bg-main);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-light);
    border-color: var(--accent-color);
    color: var(--accent-color) !important;
}

#plugin-notes-container {
    flex: 0 0 35%;
}

#plugin-notes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    align-content: start;
}

.plugin-note {
    aspect-ratio: 1/1;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px -1px var(--shadow-light);
    transition: all 0.3s;
    border-radius: 12px;
    cursor: pointer;
}

.plugin-note div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1em;
}

.plugin-note:hover {
    transform: scale(1.05) rotate(2deg);
    z-index: 10;
    box-shadow: 0 10px 15px -3px var(--shadow-light);
}

.plugin-note-link {
    text-decoration: none;
    color: inherit;
}

/* Couleurs des notes harmonisées */
.plugin-note-link:nth-child(5n+1) .plugin-note { background-color: var(--note-yellow-bg); color: var(--note-yellow-text); }
.plugin-note-link:nth-child(5n+2) .plugin-note { background-color: var(--note-green-bg); color: var(--note-green-text); }
.plugin-note-link:nth-child(5n+3) .plugin-note { background-color: var(--note-blue-bg); color: var(--note-blue-text); }
.plugin-note-link:nth-child(5n+4) .plugin-note { background-color: var(--note-purple-bg); color: var(--note-purple-text); }
.plugin-note-link:nth-child(5n+5) .plugin-note { background-color: var(--note-red-bg); color: var(--note-red-text); }

.language-selector {
    margin-right: 20px;
    position: relative;
    display: inline-block;
}

.language-btn {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.language-btn:hover {
    border-color: var(--border-medium);
    background-color: var(--bg-main);
}

.language-btn::after {
    content: "\f078";
    font-family: "Font Awesome 7 Free", "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.7rem;
    margin-left: 4px;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 4px 10px var(--shadow-light);
    z-index: 1000;
    min-width: 150px;
    margin-top: 5px;
}

.language-dropdown.show {
    display: block;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
    white-space: nowrap;
    font-size: 1rem;
}

.language-item:hover {
    background-color: var(--border-light);
}

.language-item.active {
    background-color: var(--bg-soft-blue);
    color: var(--primary-color);
    font-weight: 600;
}

.language-item img, .language-btn img {
    width: 20px;
    height: auto;
    display: block;
    border-radius: 2px;
}

.header-title {
    font-weight: 500;
    letter-spacing: -0.025em;
    font-size: 2.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.acosof-logo {
    /*height: 40px;*/
}

.connect-button i {
    margin-right: 10px;
}

.free-workspace-hint {
    /*color: var(--text-muted);*/
    /*font-size: 0.95rem;*/
}

.plugin-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.loading-spinner {
    color: var(--accent-color);
}

b {
    color: var(--primary-color);
}

.only-mobile {
    display: none;
}

@media screen and (max-width: 991px) {
    header {
        height: auto;
        padding: 10px 20px;
        flex-direction: column;
        gap: 10px;
        position: relative; /* On libère l'en-tête fixe sur petit écran pour gagner de la place */
    }

    .header-title {
        font-size: 1.5rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    main {
        padding-top: 20px;
    }

    #accroche b {
        font-size: 1.8rem;
    }

    .connect-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .connect-button {
        width: 100%;
        max-width: 300px;
    }

    #content {
        flex-direction: column;
        gap: 20px;
    }

    #plugin-notes-container {
        order: -1;
        position: relative;
        margin: 0 -15px; /* On garde la compensation */
        padding: 0;
        flex: none; /* Annule le flex 35% du mode desktop */
        width: 100%; /* Prend toute la largeur en colonne */
    }

    #plugin-notes-container::before,
    #plugin-notes-container::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 60px;
        z-index: 20;
        pointer-events: none;
        transition: opacity 0.3s;
        opacity: 0;
    }

    #plugin-notes-container::before {
        left: 0;
        background: linear-gradient(to right, var(--bg-main), transparent);
    }

    #plugin-notes-container::after {
        right: 0;
        background: linear-gradient(to left, var(--bg-main), transparent);
    }

    #plugin-notes-container.can-scroll-left::before {
        opacity: 1;
    }

    #plugin-notes-container.can-scroll-right::after {
        opacity: 1;
    }

    #plugin-notes {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 5px 5px 15px 5px; /* Ajout d'un padding latéral pour éviter que les vignettes collent aux bords */
        gap: 40px;
        /*scroll-snap-type: x mandatory;*/
        /*-webkit-overflow-scrolling: touch;*/
        scrollbar-width: none; /* Cache la scrollbar sur Firefox */
    }

    #plugin-notes::-webkit-scrollbar {
        display: none; /* Cache la scrollbar sur Chrome/Safari */
    }

    .plugin-note-link:first-child {
        margin-left: 20px;
    }

    .plugin-note-link:last-child {
        margin-right: 20px;
    }

    .plugin-note-link {
        flex: 0 0 100px;
        scroll-snap-align: start;
    }

    .plugin-note {
        aspect-ratio: 1/1;
        width: 100%;
    }

    #left-col {
        max-width: 100%;
    }

    #pres {
        padding: 20px;
        min-height: auto;
    }

    .language-dropdown {
        right: auto;
        left: 0;
    }

    .language-selector {
        margin-right: 0;
    }

    .only-mobile {
        display: flex;
    }
}
