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

body {
    /* #363532, rgb(88, 111, 112) */
    align-items: center;
    display: flex;
    flex-direction: column;
    font-family: 'Work Sans', sans-serif;
    min-height: 100vh;
    padding-top: 3%;
}

/* Transition lors du changement de thème */
.theme-transition {
    transition: background 400ms ease, color 400ms ease;
}

/* Body light or darker themes */
.standard {
    background-image: linear-gradient(100deg, #575656, #062e3f);
    color: #ffdfdb;
    transition: 0.3s linear;
}

.light {
    background-image: linear-gradient(100deg, #d4f1ff, #ffffff);
    color: #1a150e;
    transition: 0.3s linear;
}

.darker {
    background-image: linear-gradient(100deg, #001214, #001f29);
    color: white;
    transition: 0.3s linear;
}

/* Thème néon - flashy */
.neon {
    background: radial-gradient(circle at 10% 10%, #001f3f, #000014), linear-gradient(45deg, #0ff, #f0f);
    color: #eaffff;
    animation: neon-glow 4s ease-in-out infinite;
}

/* Thème pastel - doux */
.pastel {
    background-image: linear-gradient(120deg, #ffefba, #ffffff, #d1ffd6);
    color: #2a2a2a;
}

#header, #form, #datetime {
    margin: 0 1rem;
    min-height: 10vh;
    width: 100%;
}

#header {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    font-size: 3rem;
    min-height: 25vh;
    width: 100%;
}

/* Theme buttons div */
.flexrow-container {
    align-items: center;
    align-self: flex-end;
    display: flex;
    justify-content: space-around;
    margin-right: 3%;
}

/* Hamburger and mobile menu */
#hamburger {
    display: none;
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 1200;
    background: rgba(0,0,0,0.6);
    color: white;
    border: 0;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 20px;
}

#mobile-menu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 260px;
    background: rgba(255,255,255,0.98);
    box-shadow: 2px 0 20px rgba(0,0,0,0.2);
    transform: translateX(-120%);
    transition: transform 300ms ease;
    z-index: 1199;
    padding: 20px;
}

#mobile-menu[aria-hidden="false"] { transform: translateX(0); }

.mobile-section { margin-bottom: 18px; }
.mobile-themes { display:flex; gap:10px; flex-wrap:wrap; }
.mobile-theme-btn { width:36px; height:36px; border-radius:50%; border:0; }

@media only screen and (max-width: 800px) {
    .flexrow-container { display: none; } /* hide desktop theme selector */
    #hamburger { display: block; }
}

.theme-selector {
    border: 1px solid #d1dae3;
    border-radius: 100%;
    height: 35px;
    margin: 0 8px;
    transition: tranform 150ms ease-in-out, box-shadow 200ms ease-in-out;
    width: 35px;
}

.theme-selector:hover { 
    box-shadow: white 0 0 8px;
    cursor: pointer;
}

.theme-selector:active {
    transform: scale(0.95);
}

.standard-theme {
    background-image: linear-gradient(100deg, #575656, #062e3f);
}

.light-theme {
    background-image: linear-gradient(100deg, #d4f1ff, #ffffff);
}

.darker-theme {
    background-image: linear-gradient(100deg, #001214, #001f29);
}

.neon-theme {
    background: linear-gradient(90deg, #0ff, #f0f);
}

.pastel-theme {
    background: linear-gradient(90deg, #ffd6e0, #d6fff0);
}

/* Animation */
#title {
    border-right: solid 3px rgba(0, 0, 0, 0.75);
    white-space: pre;
    overflow: hidden;     
    letter-spacing: 0.20rem;
    margin-top: 50px;
    margin-bottom: 20px;
    max-width: 480px;
  }
  
  /* Animation */
#title {
    animation: animated-text 2s steps(11,end) 0.5s 1 normal both,
        animated-cursor 750ms steps(11,end) infinite;
  }

#title.darker-title {
    animation: animated-text 2s steps(11,end) 0.5s 1 normal both, darker-animated-cursor 750ms steps(11,end) infinite;
}

/* animation néon pour glow */
@keyframes neon-glow {
    0% { filter: drop-shadow(0 0 6px rgba(0,255,255,0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(255,0,255,0.45)); }
    100% { filter: drop-shadow(0 0 6px rgba(0,255,255,0.3)); }
}

/* version image (coin) */
.version {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px;
}

/* .version-image rules removed: image no longer used */

/* animation 'de ouf' pour les todos: floating + pop */
.todo {
    transition: transform 300ms cubic-bezier(.2,.8,.2,1), box-shadow 300ms ease;
}

.todo:hover {
    transform: translateY(-6px) rotate(-0.4deg) scale(1.01);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

/* Fall animation already exists; add a more spectaculaire animation when deleting */
.fall {
    transition: transform 0.8s cubic-bezier(.2,.8,.2,1), opacity 0.8s ease;
    transform: translateY(100vh) rotateZ(50deg) scale(0.1);
    opacity: 0;
}
  
  /* text animation */
  
  @keyframes animated-text{
    from{width: 0%;}
    to{width: 480px;}
  }
  
  /* cursor animations */
  
  @keyframes animated-cursor{
    from{border-right-color: rgba(0, 0, 0, 0.75);}
    to{border-right-color: transparent;}
  }

  @keyframes darker-animated-cursor {
    from{border-right-color: #01394c;}
    to{border-right-color: transparent;}
  }

form {
    display: flex;
    font-size: 1.7rem;
    justify-content: center;
    margin: 15px 0;
    padding: 0.8rem;
    width: 100%;
}

form input {
    padding: 10px;
    font-size: 17px;
    border: none;
    outline: none;
    /* border-radius: 15; */
    border-top-left-radius: 17px;
    border-bottom-left-radius: 17px;
    max-width: 500px;
    transition: background-color 200ms ease-in-out;
    width: 100%;
}

/* Input themes */
form input.standard-input {
    background-color: #181a1a;
    color: rgb(247, 226, 223);
}

/* Neon input/button/todo styles */
form input.neon-input {
    background: rgba(0,0,0,0.6);
    color: #eaffff;
    border: 1px solid rgba(0,255,255,0.2);
}

button.neon-button {
    background: linear-gradient(90deg,#00ffff,#ff00ff);
    color: #001;
    box-shadow: 0 6px 20px rgba(0,255,255,0.12);
}

.neon-todo {
    background: linear-gradient(90deg,#07202a,#0f2540);
    color: #eaffff;
    border: 1px solid rgba(0,255,255,0.08);
}

/* Pastel input/button/todo styles */
form input.pastel-input {
    background: #f6f9f4;
    color: #2a2a2a;
    border: 1px solid #e8f3ea;
}

button.pastel-button {
    background: linear-gradient(90deg,#ffd6e0,#d6fff0);
    color: #2a2a2a;
}

.pastel-todo {
    background: linear-gradient(90deg,#fff7f0,#f0fff7);
    color: #2a2a2a;
}


form input.light-input {
    background-color: #AEB1B4;
    color: #1a150e;
}

form input.light-input::placeholder {
    color: #1a150e;
    opacity: 0.7;
}

form input.darker-input {
    background-color: #01394c;
    color: white;
}

form input.darker-input::placeholder {
    color: white;
    opacity: 0.7;
}

form input:hover {
    cursor: text;
}

form input.standard-input:hover {
    background-color: rgb(0, 0, 0);
}

form input.light-input:hover {
    background-color: #919699;
}

form input.darker-input:hover {
    background-color: #013141;
}

button {
    border: none;
    outline: none; 
    transition: box-shadow 200ms ease, background-color 200ms ease-in-out;
}

button:hover {
    cursor: pointer;
}

/* Button themes */
button.standard-button {
    background-color: rgb(247, 226, 223);
    color: rgb(0, 0, 0);
}

button.standard-button:hover {
    background-color: white;
    box-shadow: #fff8 0 0 10px;
}

button.light-button {
    background-color: white;
    color: #1a150e;
}

button.light-button:hover {
    background-color: #f0f0f0;
}

button.darker-button {
    background-color: #002837;
    color: white;
}

button.darker-button:hover {
    background-color: #001f29;
}

form button {
    padding: 10px;
    font-size: 17px;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    min-width: 100px;
}

#myUnOrdList {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
}

.todo-list {
    min-width: 25%;
    overflow: hidden;
    /* To remove the bullets of unordered list */
    list-style: none;
}

.todo {
    margin: 1rem;
    /* background: rgb(247, 226, 223); */
    /* color: black; */
    font-size: 19px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25em 0.5em;
    border-radius: 30px;
    transition: background-color 200ms ease-in-out;
}

/* Items themes */
.standard-todo {
    background-color: rgb(26, 27, 27);
}

.light-todo {
    background-color:#AEB1B4;
}

.darker-todo {
    background-color: #01394c;
}

.todo li{
    padding: 7px;
    /* word-wrap: break-word; */
    /* flex-wrap: wrap; */
    font-size: 20px;
    flex: 1; /* To push the trash and the check button to the right */
    border-radius: 30px;

    /* wraps the links */
    overflow-wrap: anywhere;
}

.check-btn, .delete-btn {
    font-size: 19px;
    cursor: pointer;
    width: 2em;
    height: 2em;
    border-radius: 80%;
    margin: 0 5px;
}

.todo-item {
    padding: 0rem 0.5rem;
}

.fa-trash, .fa-check { 
    pointer-events: none;
}


.completed {
    transition: 0.2s;
    text-decoration: line-through;
    opacity: 0.5;
}

.fall {
    transition: 0.5s;
    transform: translateY(45rem) rotateZ(45deg);
    opacity: 0;
}

/* Responsive design */
@media only screen and (max-width: 1000px) {
    .flexrow-container {
        align-self: unset;
        margin-right: 0;
    }
}

@media only screen and (max-width: 800px) {
    #header {
        font-size: 2rem;
    }

    #title {
        animation: 
            animated-text 3s steps(16,end) 0.5s 1 normal both,
            animated-cursor 750ms steps(16,end) infinite;
        margin-bottom: 10px;
        margin-top: 30px;
        max-width: 330px;
    }
}

@media only screen and (max-width: 400px) {
    #header {
        font-size: 1.5rem;
    }

    #title {
        animation: 
            animated-text 3.5s steps(16,end) 0.5s 1 normal both,
            animated-cursor 750ms steps(16,end) infinite;
        max-width: 255px;
    }
}

/* Footer styles */
#site-footer { background: #0b2230; color: #dfeff6; padding: 18px 12px; margin-top: 24px; }
#site-footer .footer-inner { display:flex; justify-content:space-between; gap:12px; max-width:1200px; margin: 0 auto; }
#site-footer h4 { margin: 0 0 6px 0; }
#site-footer ul { list-style: none; padding: 0; margin: 0; }

@media only screen and (max-width: 800px) {
    #site-footer .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Accessibility: visible focus outlines and larger touch targets */
button:focus, input:focus, a:focus { outline: 3px solid rgba(3,102,214,0.35); outline-offset: 2px; }
.floating-btn { min-width: 44px; min-height:44px; }


/* Festive overlay styles */
#festive {
    pointer-events: none; /* allow clicks through unless on controls */
    position: fixed;
    inset: 0;
    z-index: 999;
}

/* Floating controls (snow + music) */
.floating-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg,#fff,#eee);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    font-size: 22px;
    cursor: pointer;
    z-index: 1201;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

#music-btn { right: 80px; }

#floating-snow[aria-pressed="true"] { background: linear-gradient(180deg,#cceeff,#99ddff); }

/* Music panel */
#music-panel {
    position: fixed;
    right: 18px;
    bottom: 86px;
    width: 320px;
    max-width: calc(100% - 36px);
    background: white;
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.25);
    padding: 12px;
    z-index: 1202;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: opacity 220ms ease, transform 220ms ease;
}

#music-panel[aria-hidden="false"] { transform: translateY(0) scale(1); opacity: 1; }

#music-panel input { width: 100%; padding: 8px; margin: 6px 0; }
#playlist { list-style: none; padding: 0; max-height: 140px; overflow: auto; }
#playlist li { display:flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #eee; }

.music-row { margin-top: 8px; }
.music-controls { margin-top: 8px; display:flex; gap:8px; }

/* Music panel styles */
#music-panel h3 { margin: 0 0 8px 0; font-size: 1.1rem; }
#music-panel p { margin: 0 0 8px 0; font-size: 0.95rem; color: #444; }
#music-panel input[type="url"], #music-panel input[type="file"] {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    background: #fafafa;
}

#add-track, #save-playlist, #load-playlist, #clear-playlist, #close-music {
    background: linear-gradient(180deg,#f6f6f6,#e9e9e9);
    border: 1px solid #ddd;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

#add-track:hover, #save-playlist:hover, #load-playlist:hover, #clear-playlist:hover, #close-music:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

#playlist li { display:flex; align-items:center; justify-content: space-between; gap:8px; }
#playlist li span { display:inline-block; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#playlist li button { margin-left: 6px; border: none; background: transparent; cursor: pointer; font-size: 1rem; }
#playlist li button.play { color: #057; }
#playlist li button.remove { color: #a00; }

/* make saved playlist buttons smaller on mobile */
@media only screen and (max-width: 600px) {
    #music-panel { width: 260px; }
    #playlist li span { max-width: 50%; }
}

/* Additional responsive tweaks for music panel and background music controls */
@media only screen and (max-width: 480px) {
    #music-panel {
        left: 12px;
        right: 12px;
        bottom: 64px;
        width: auto;
        padding: 10px;
    }
    #music-panel audio { width: 100%; }
    .music-controls { flex-direction: column; gap:6px; }
}

.music-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.music-header .bg-label { display:flex; align-items:center; gap:8px; font-weight:600; }
.music-header .bg-label input { transform: scale(1.1); }
.music-header .small { padding:6px 8px; font-size:0.9rem; border-radius:6px; }

@media only screen and (max-width: 600px) {
    .floating-btn { width:44px; height:44px; font-size:18px; }
    #music-panel { width: 260px; right: 12px; bottom: 72px; }
}

#snow-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* NOTE: tree styles removed per user request; snow canvas and toggle styles remain.
    Responsive adjustments for festive overlay (trees removed) */
@media only screen and (max-width: 600px) {
    #toggle-snow { right: 8px; top: 8px; padding: 6px 8px; font-size: 13px; }
    #festive { z-index: 800; }
}

@media only screen and (max-width: 400px) {
    #toggle-snow { right: 6px; top: 6px; padding: 5px 7px; font-size: 12px; }
}

#toggle-snow {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 1000;
    pointer-events: auto; /* allow clicks */
    background: rgba(255,255,255,0.85);
    border: 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

#toggle-snow[aria-pressed="true"] {
    box-shadow: 0 8px 22px rgba(0,0,0,0.2);
}

/* trees removed: no twinkle effect required */

@media only screen and (max-width: 400px) {
    form {
        align-items: center;
        flex-direction: column;
    }

    form input {
        border-radius: 17px;
    }

    form button {
        border-radius: 15px;
        margin-top: 15px;
        width: 50%;
    }
    form > button.light-button {
        box-shadow: 0 0 5px lightgray;
    }
}
