@import url('./delaGothicOne/stylesheet.css');
@import url('./cloitre/stylesheet.css');

body {
    font-family: Arial, sans-serif;
    background-color: #f6f2eb;
    margin: 0;
    padding: 0;
    display: flex;
    /* align-items: center; */
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}



/* if body has class "timer-finished" */
body.timer-finished,
body.timer-finished .main,
body.timer-finished .controls button,
body.timer-finished .task-input,
body.timer-finished .remove-validation,
body.timer-finished #session-name {
    cursor: none;
    user-select: none;
     -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* vieux Edge */

}

body::selection {
    color: currentColor;
    background: transparent;
}

body.timer-finished .task-item {
    pointer-events: none;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f6f2eb;
    pointer-events: none;
    user-select: none;
}

.background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    mix-blend-mode: luminosity;
    transform: scale(1.2) translateY(-1vw) rotate(5deg);
    pointer-events: none;
    user-select: none;
}


/* blend mode -----------------*/
/* Valeurs par défaut — tous navigateurs sauf Safari */
.pomodoro-container,
.tasks-container,
.completed-tasks-container,
.mode-switch,
.crosshair{
    mix-blend-mode: darken;
}

/* Safari uniquement */
@supports (-webkit-hyphens: none) and (not (-ms-accelerator: true)) and (not (-moz-appearance: none)) {

    .pomodoro-container,
    .tasks-container,
    .completed-tasks-container,
    .mode-switch,
    .crosshair {
        mix-blend-mode: plus-darker;
        filter: brightness(1.03) contrast(0.9);
    }
}

/* blend mode -----------------*/

.main {
    display: flex;
    margin-top: -1vw;
    margin-left: 3.2vw;
    gap: 5vw;
    width: calc(100% - 4vw - 380px);
    justify-content: start;
}

.pomodoro-container {
    border-radius: 10px;
    text-align: center;
    width: 450px;
}

h1 {
    margin: 0 0 20px;
    /* font-size: 80px; */
    font-size: 17vw;
    color: #333;
    font-family: 'Dela Gothic One', cursive;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;

    pointer-events: none;
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* vieux Edge */
    user-select: none;

    margin-top: -3vw;
}

h1 span {
    opacity: 0;
    animation: title-appear-1-3 0.2s linear forwards;
    pointer-events: none;
    user-select: none;
}

h1 span:nth-of-type(1) {
    animation: title-appear-1-3 0.2s linear forwards;
    animation-delay: 0.8s;
}

h1 span:nth-of-type(2) {
    animation: title-appear-2-4 0.2s linear forwards;
    animation-delay: 1s;
}

h1 span:nth-of-type(3) {
    animation: title-appear-1-3 0.2s linear forwards;
    animation-delay: 1.2s;
}

h1 span:nth-of-type(4) {
    animation: title-appear-2-4 0.2s linear forwards;
    animation-delay: 1.4s;
}

@keyframes title-appear-1-3 {
    0% {
        opacity: 0;
        transform: translateY(-20px) translateX(-10px) scale(1.3) rotate(-10deg);
    }

    1% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateX(0px) scale(1) rotate(0deg);
    }
}

@keyframes title-appear-2-4 {
    0% {
        opacity: 0;
        transform: translateY(-20px) translateX(10px) scale(1.3) rotate(10deg);
    }

    1% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateX(0px) scale(1) rotate(0deg);
    }
}


h1 img {
    /* height: 130px; */
    margin: -12%;
    z-index: 1;
    will-change: transform, opacity, content, url;
    backface-visibility: hidden;
    transform: translateZ(0);
    animation-fill-mode: forwards;
    opacity: 0;
    content: url('/tomatoes-title/tomato-clear.png');
}

h1 img:first-of-type {
    /* margin-right: -16%; */
    /* width: 136px; */
    margin-right: -10vw;
    margin-left: -7vw;
    margin-top: -7vw;
    width: 23vw;
    animation: tomato-throw-1 1s cubic-bezier(0.550, 0.085, 0.680, 0.530);
    animation-delay: 0.3s;
    animation-fill-mode: forwards;
}




h1 img:nth-of-type(2) {
    /* width: 112px; */
    margin-right: -8vw;
    margin-left: -5vw;
    width: 21vw;
    animation: tomato-throw-2 1s cubic-bezier(0.550, 0.085, 0.680, 0.530);
    animation-delay: 0.5s;
    animation-fill-mode: forwards;
}

h1 img:nth-of-type(3) {
    /* width: 127px; */
    margin-right: -9vw;
    margin-left: -9vw;
    margin-top: -7vw;
    width: 24vw;
    animation: tomato-throw-3 1s cubic-bezier(0.550, 0.085, 0.680, 0.530);
    animation-delay: 0.6s;
    animation-fill-mode: forwards;
}

h1 img:nth-of-type(4) {
    /* width: 124px; */
    margin-right: -5vw;
    margin-left: -8vw;
    width: 22vw;
    animation: tomato-throw-4 1s cubic-bezier(0.550, 0.085, 0.680, 0.530);
    animation-delay: 0.8s;
    animation-fill-mode: forwards;
}

.timer-display {
    font-size: 230px;
    max-height: 220px;
    color: #D42113;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    margin: 10px 0px;
    text-align: center;
    width: 90%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: 'Cloitre Italique';
    font-weight: normal;
    font-style: italic;
    font-display: swap;
    transition: hover 0.3s ease;
    cursor: text;

    animation: timer-display-appear 2s ease forwards;
    opacity: 0;
}

@keyframes timer-display-appear {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    40% {
        opacity: 0;
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}

.timer-display:hover {
    border-color: #D42113;
    background: rgba(212, 33, 19, 0.05);
    /* Ajustement pour correspondre à #D42113 */
}

.timer-display.no-hover {
    pointer-events: none;
    opacity: 0.8;
}

.timer-display:focus {
    outline: none;
    border-color: #D42113;
    /* Harmonisation */
    background: rgba(212, 33, 19, 0.1);
    /* Ajustement pour correspondre à #D42113 */
    box-shadow: 0 0 0 3px rgba(212, 33, 19, 0.2);
    /* Harmonisation */
}

.controls {
    display: flex;
    animation: controls-appear 0.3s cubic-bezier(0.76, 0, 0.24, 1) forwards;
    animation-delay: 1.6s;
    opacity: 0;
}

/* Make sure controls and their buttons are on top and receive pointer events
   (mix-blend-mode earlier can make color changes invisible; override it here) */
.controls {
    position: relative;
    z-index: 30;
}

.controls button {
    mix-blend-mode: normal;
    pointer-events: auto;
    transition: background 0.15s ease, transform 0.08s ease;
}

@keyframes controls-appear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }

}

.controls button {
    background: #D42113;
    /* Harmonisation */
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: none;
}

.controls button:hover {
    background: #B71C10;
    /* Teinte plus foncée pour le hover */
}

.controls button:active {
    transition: scale 0.3s ease;
    transform: scale(0.9);
}

.controls button.primary {
    background: #D42113;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Dela Gothic One', cursive;
    text-transform: uppercase;
    /* width: 100%; */
    flex: 1;

}

.controls button.primary:hover {
    background: #a91a0f;
}

.controls button.secondary {
    background: transparent;
    color: #bdc3c7;

    border: 3px solid #bdc3c7;
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'dela Gothic One', cursive;
    text-transform: uppercase;
}

.controls button.secondary:hover {
    background: #bdc3c7;
    color: #fff;
}

.session-name-input {
    font-size: 18px;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    font-family: 'Dela Gothic One', cursive;
    text-transform: uppercase;
    background-color: transparent;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    animation: session-name-appear 0.3s cubic-bezier(0.76, 0, 0.24, 1) forwards;
    animation-delay: 1.6s;
    opacity: 0;
}

@keyframes session-name-appear {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }

}

.session-name-input:focus {
    outline: none;
    border-color: #bbb;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}
.session-name-input:hover {
    outline: none;
    border-color: #bbb;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.session-name-input:disabled {
    background-color: transparent;
    /* color: #aaa; */
    border-color: transparent;
    padding: 0%;
    font-size: 30px;
    cursor: not-allowed;
}

.mode-switch {
    font-size: 14px;
    margin-bottom: 10px;
    padding: 6px 12px;
    border: 2px solid #333;
    border-radius: 5px;
    background-color: transparent;
    color: #333;
    cursor: pointer;
    font-family: 'Dela Gothic One', cursive;
    text-transform: uppercase;
    transition: all 0.3s ease;
    animation: mode-switch-appear 0.3s ease forwards;
    animation-delay: 1.8s;
    opacity: 0;
}

@keyframes mode-switch-appear {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.mode-switch:hover {
    background-color: #333;
    color: #fff;
    transform: scale(1.05);
}

.mode-switch:active {
    transform: scale(0.95);
}

.tasks-container {
    /* margin-top: 20px; */
    text-align: left;
    /* width: 340px; */
    flex-grow: 1;

    animation: task-container-appear 0.5s cubic-bezier(0.76, 0, 0.24, 1) forwards;
    animation-delay: 1s;
    opacity: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px 0px;
    border-radius: 8px;
}

@keyframes task-container-appear {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }

}

.task-input-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0px 20px;
}

.tasks-container .task-input-container h3 {
    margin-bottom: 10px;
    font-family: 'Dela Gothic One', cursive;
    text-transform: uppercase;
    color: #333;
}


#add-task {
    background: transparent;
    color: #D42113;
    border: 2px solid #D42113;
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'dela Gothic One', cursive;
    text-transform: uppercase;
    transition: none;
}


#add-task:hover {
    background: #D42113;
    color: #fff;
}

#add-task:active {
    transition: scale 0.1s ease;
    transform: scale(0.95);
}


#add-task.disabled {
    display: none;
}

#tasks-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

#tasks-list #no-tasks-message {
    font-family: 'Dela Gothic One', cursive;
    text-transform: uppercase;
    color: #aaa;
    text-align: center;
    margin: 20px 0;
}

#tasks-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;

    animation: task-list-list-appear 0.3s ease forwards;
    opacity: 0;
    padding: 0 20px;
}

@keyframes task-list-list-appear {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }

}

.task-input {
    flex: 1;
    padding: 8px;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 20px;
    font-family: 'Dela Gothic One', cursive;
    border: 1px solid #ddd;
    box-sizing: border-box;
    background-color: transparent;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    max-width: 100%;
}

.task-input:focus {
    outline: none;
    border-color: #bbb;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}
.task-input:hover {
    outline: none;
    border-color: #bbb;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.task-input:disabled {
    background-color: transparent;
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
}

.task-input.validated {
    background-color: #ebdede;
    /* color: #d42113; */
    box-shadow: transparent;
}

.delete-task {
    background: #D42113;
    /* Harmonisation */
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.delete-task:hover {
    background: #B71C10;
    /* Teinte plus foncée pour le hover */
}

.delete-task:active {
    transition: scale 0.1s ease;
    transform: scale(0.95);
}

.delete-task.disabled {
    display: none;
}

.remove-validation {
    background: #D42113;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.completed-tasks-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    border: none;
    padding: 10px;
    width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Dela Gothic One', cursive;
}

.completed-tasks-container h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
    text-transform: uppercase;
}

#completed-tasks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0px;
    overflow-y: auto;

    animation: task-container 0.5s ease forwards;
    animation-delay: 0.5s;
}

@keyframes task-container {
    0% {
        max-height: 0px;
        opacity: 0;
    }

    100% {
        max-height: 320px;
        opacity: 1;
    }
}


#completed-tasks-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    color: #555;
    position: relative;
}

#completed-tasks-list li.date-header {
    font-weight: bold;
    border-bottom: 2px solid #ddd;
    margin-top: 10px;
}

#completed-tasks-list li.task-item {
    font-weight: bold;
    color: #555555d2;
    border-bottom: 0.5px solid #ddd;
    margin-left: 30px;
    cursor: pointer;
}

.delete-completed-task {
    display: none;
    background: #D42113;
    color: #fff;
    border: none;
    padding: 2px 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    align-items: center;
    justify-content: center;
}

#completed-tasks-list li:hover .delete-completed-task {
    display: flex;
}


#completed-tasks-list li:hover .delete-completed-task:hover {
    background: #a91a0f;
}


.delete-completed-task img {
    width: 16px;
    height: 16px;
}


/* carret color */
.session-name-input,
.task-input {
    caret-color: #918e89;
}



@keyframes tomato-throw-1 {
  0% {
        -webkit-transform: translateY(600px) translateX(100px) rotate(-30deg) scale(6.5);
        transform: translateY(600px) translateX(100px) rotate(-30deg) scale(6.5);
        transform-origin: 50% -100%;
        content: url('/tomatoes-title/tomato-clear.png');
        opacity: 0;
  }
  10% {
        opacity: 1;
    }
  99% {
        content: url('/tomatoes-title/tomato-clear.png');
    }
  100% {
        -webkit-transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform-origin: 50% 500px;
        content: url('/tomatoes-title/tomato-1.png');
        opacity: 1;
  }
}
@keyframes tomato-throw-2 {
  0% {
        -webkit-transform: translateY(600px) translateX(100px) rotate(-50deg) scale(6.5);
        transform: translateY(600px) translateX(100px) rotate(-50deg) scale(6.5);
        transform-origin: 50% -100%;
        content: url('/tomatoes-title/tomato-clear.png');
        opacity: 0;
  }
  10% {
        opacity: 1;
    }
  99% {
        content: url('/tomatoes-title/tomato-clear.png');
    }
  100% {
        -webkit-transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform-origin: 50% 500px;
        content: url('/tomatoes-title/tomato-2.png');
        opacity: 1;
  }
}
@keyframes tomato-throw-3 {
  0% {
        -webkit-transform: translateY(600px) translateX(100px) rotate(60deg) scale(6.5);
        transform: translateY(600px) translateX(100px) rotate(60deg) scale(6.5);
        transform-origin: 50% -100%;
        content: url('/tomatoes-title/tomato-clear.png');
        opacity: 0;
  }
  10% {
        opacity: 1;
    }
  99% {
        content: url('/tomatoes-title/tomato-clear.png');
    }
  100% {
        -webkit-transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform-origin: 50% 500px;
        content: url('/tomatoes-title/tomato-3.png');
        opacity: 1;
  }
}
@keyframes tomato-throw-4 {
  0% {
        -webkit-transform: translateY(600px) translateX(-100px) rotate(-90deg) scale(6.5);
        transform: translateY(600px) translateX(-100px) rotate(-90deg) scale(6.5);
        transform-origin: 50% -100%;
        content: url('/tomatoes-title/tomato-clear.png');
        opacity: 0;
  }
  10% {
        opacity: 1;
    }
  99% {
        content: url('/tomatoes-title/tomato-clear.png');
    }
  100% {
        -webkit-transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform: translateY(0) translateX(0) rotate(0) scale(1);
        transform-origin: 50% 500px;
        content: url('/tomatoes-title/tomato-4.png');
        opacity: 1;
  }
}
