/* --- Variables Globales (Thèmes) --- */
:root {
    --bg-color: #f4f7f6;
    --text-color: #111;
    --header-bg: #ffffff;
    --border-color: #ddd;
    --card-bg: #ffffff;
    --accent-color: #007bff;
    --primary-color: #1a73e8;
}

body.dark-theme {
    --bg-color: #121212;
    --text-color: #f1f1f1;
    --header-bg: #1e1e1e;
    --border-color: #333;
    --card-bg: #1e1e1e;
}

/* --- Styles de Base --- */
* {
    transition: all 0.15s ease-in-out;
    font-family: "Open Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
}

header .controls {
    display: flex;
    gap: 1rem;
}

main {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    gap: 2rem;
}

main>div {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#qr-generator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#history {
    flex-basis: 30%;
}

#history h2 {
    text-align: center;
    margin-top: 0;
}

footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    transition: all 0.3s;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* --- Contrôles --- */
.controls input,
.controls select,
.controls button {
    margin: 0.5rem;
    padding: 0.4rem;
    border-radius: 500px;
    border: solid 1px var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    outline: none;
}

.controls input:hover,
.controls select:hover,
.controls button:hover {
    background-color: var(--border-color);
}

.controls input:active,
.controls select:active,
.controls button:focus-visible {
    border-color: var(--primary-color);
}

#qr-code svg {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

ul {
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

li {
    list-style: none;
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* --- Style pour le bouton d'effacement de l'historique --- */
#clear-history {
    display: block;
    margin: 1rem auto 0 auto;
    padding: 0.4rem 1rem;
    border-radius: 500px;
    border: solid 1px var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.15s ease-in-out;
}

#clear-history:hover {
    background-color: var(--border-color);
}

#clear-history:active,
#clear-history:focus-visible {
    border-color: var(--primary-color);
}