:root {
    --background-color: #434343;
    --bg_transparent: #3e3e3ee3;
    --text-color: #ffffff;
    --article-title_a-color: #e8b656;
    --navbar_hover-color: #faf9f5;
    --article-title_h2: #fff;
    --date: #fff;
    --comment_form: #515151;
    --input: #2d2d2d;
    --input_text: #fff;
    --cadre: #4f4f4f;
    --filter: brightness(0) invert(1);
    --footer: #373737;
    --color: #8cb8f0;
    --col_date: #f0f0f0;
    --bg_comment_form: #3e3c3c;
    --filter_bg_image: brightness(50%);
    --filter_svg_chat: invert();
    --note-toolbar_button: #cbcbcb;
    --lien: #b0c8ee;
    --secondary-color: #6c757d;
}

[data-theme="light"] {
    --background-color: #fff;
    --bg_transparent: #ffffffdb;
    --text-color: #121212;
    --article-title_a-color: #121212;
    --navbar_hover-color: #121212;
    --article-title_h2: #2f2f2f;
    --date: #2f2f2f;
    --comment_form: #fafafa;
    --input: #fff;
    --input_text: #000;
    --cadre: #4f4f4f;
    --filter: initial;
    --footer: #f1f1f1;
    --col_date: #666;
    --bg_comment_form: #fff;
    --filter_bg_image: initial;
    --filter_svg_chat: initial;
    --lien: #073f97;
    --note-toolbar_button: #fff;
    --secondary-color: #6c757d;

}

html {
    background-color: var(--background-color);
}

.content {
    color: var(--text-color);
}

* {
    font-family: 'Inter', sans-serif;
}

@font-face {
    font-family: 'Rubik';
    src: url('/police/Rubik-Regular.woff2') format('woff2'),
    url('/police/Rubik-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Quicksand';
    src: url('/police/Quicksand-Regular.woff2') format('woff2'),
    url('/police/Quicksand-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Kaushan Script';
    src: url('/police/KaushanScript-Regular.woff2') format('woff2'),
    url('/police/KaushanScript-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/police/Inter-Regular.woff2') format('woff2'),
    url('/police/Inter-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Exo';
    src: url('/police/Exo-Regular.woff2') format('woff2'),
    url('/police/Exo-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alex Brush';
    src: url('/police/AlexBrush-Regular.woff2') format('woff2'),
    url('/police/AlexBrush-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {

    font-size: 15px; /* Base légèrement plus petite */
    line-height: 1.5; /* Interligne resserré */
    height: 100vh;
}

.smiley {
    display: inline-block;
    max-height: 2em; /* limite la hauteur à la hauteur de la police */
    height: auto;
    vertical-align: middle; /* ou text-bottom / baseline selon l'alignement souhaité */
}

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

html, body {
    margin: 0;
    height: 100%;
}


.conteneur {
    background-color: var(--background-color);
    color: var(--text-color);
    width: 860px;
    max-width: 95%;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: auto;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .conteneur {
        width: 100%;
        max-width: 95%;
        padding: 24px;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .conteneur {
        max-width: 100%;
        padding: 16px;
        border-radius: 0;
        margin: 0px;
    }

    body {
        padding: 0px;
    }
}

.info-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #96d8ff;
    color: black;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 40px;
}

.info-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.info-text {
    line-height: 1.4;
    color: black;
}

a {
    color: var(--lien);
}

.empty-state {
    padding: 45px 20px;
    text-align: center;
    border: 1px dashed rgba(128, 128, 128, .4);
    border-radius: 12px;
    opacity: .8;
}

.empty-state i {
    margin-bottom: 12px;
    font-size: 2rem;
}

/*.bouton_action,
.bouton_action_btn{
    margin: 20px 0;
}

button,
.bouton_action a,
.bouton_action span,
.bouton_action button{
    border: 1px solid #1a1a1a;
    color: black;
    display: inline-block;
    margin: 0 4px;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 5px;
    background-color: aliceblue;
    cursor: pointer;
}*/

button.danger {
    background-color: #ffcccc;
}

/* --- Card layout (shared: p_parametres, p_logs, etc.) --- */

.card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid grey;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}

.card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    color: var(--text-color);
}

/* --- Alert messages --- */

.alert {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: .9rem;
}

.alert.success {
    background: rgba(16, 185, 129, .2);
    border-left: 4px solid #10b981;
    color: #10b981;
}

.alert.error {
    background: rgba(220, 53, 69, .2);
    border-left: 4px solid #dc3545;
    color: #dc3545;
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    border: solid 1px;
    border-radius: 7px;
    color: var(--text-color);
    background-color: var(--background-color);
    font-size: .9rem;
    text-decoration: none;
    cursor: pointer;
    transition: filter .2s ease, transform .2s ease;
}

.btn:hover {
    filter: brightness(0.95);
}

.btn img {
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.btn.danger {
    background: transparent;
    color: #dc3545;
    border-color: #dc3545;
}

.btn.danger:hover {
    background: rgba(220, 53, 69, 0.15);
}

.btn.danger[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

.btn.success {
    background: transparent;
    color: #10b981;
    border-color: #10b981;
}

.btn.success:hover {
    background: rgba(16, 185, 129, 0.15);
}

.btn.warning {
    background: transparent;
    color: #f59e0b;
    border-color: #f59e0b;
}

.btn.warning:hover {
    background: rgba(245, 158, 11, 0.15);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
    border: none;
}

.btn-secondary:hover {
    filter: brightness(1.1);
}

/* --- Form actions row --- */

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

/* --- Modal overlay --- */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--background-color, #fff);
    color: var(--text-color, #000);
    padding: 28px 24px;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.modal-box p {
    margin: 0 0 20px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 120px;
}

/* --- Log cards --- */

.log-card {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, .03);
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

.log-card:hover {
    background: rgba(255, 255, 255, .07);
}

.log-card:last-child {
    margin-bottom: 0;
}


.log-card-time {
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: var(--text-color);
    opacity: 0.7;
    min-width: 110px;
}

.log-card-badge {
    flex-shrink: 0;
    font-size: 0.75rem;
    min-width: 70px;
}

.log-card-message {
    flex: 1;
    color: var(--text-color);
    word-break: break-word;
}

.log-card-table {
    flex-shrink: 0;
    font-size: 0.8rem;
    opacity: 0.8;
    color: var(--text-color);
}

.log-entries-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 4px;
}

.log-entries-list::-webkit-scrollbar {
    width: 6px;
}

.log-entries-list::-webkit-scrollbar-track {
    background: transparent;
}

.log-entries-list::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.4);
    border-radius: 3px;
}

.log-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.form-control {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(2, 2, 2, 0.3);
    border-radius: 6px;
    background: var(--input);
    color: var(--input_text);
    font-size: 0.95rem;
    line-height: 1.4;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-control:hover {
    border-color: rgba(37, 99, 235, 0.3);
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.log-toolbar .form-control {
    width: auto;
    min-width: 180px;
}

.add-tag-form .form-control {
    width: auto;
    min-width: 200px;
    max-width: 300px;
    flex: none;
}

.add-tag-form {
    justify-content: flex-end;
}

.empty-message {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

/* --- Load more button --- */

.load-more-container {
    text-align: center;
    padding: 10px 0 4px;
}

.load-more-btn {
    min-width: 160px;
}

/* --- Logs page container --- */

.logs-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

@media (max-width: 768px) {
    .log-card {
        flex-direction: column;
        gap: 4px;
        font-size: 0.8rem;
    }
    .log-card-time {
        min-width: auto;
        font-size: 0.7rem;
    }
    .logs-container {
        padding: 10px;
    }
}