html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e0e0e0; /* Blanc légèrement foncé */
}

.container {
    text-align: center;
    padding: 20px;
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
}

.timer {
    font-size: 36px;
    margin-bottom: 100px;
}

button {
    font-size: 16px;
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    background-color: #ddd;
    color: black;
}

button .icon {
    margin-right: 8px;
    vertical-align: middle;
    transition: transform 0.3s, color 0.3s;
}

button:hover {
    background-color: #ccc;
    transform: scale(1.05);
}

button:hover .icon {
    transform: scale(1.2);
}

button:active {
    background-color: #bbb;
    transform: scale(0.95);
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.saved-times {
    margin-top: 20px;
    text-align: left;
}

.saved-times ul {
    max-height: 200px;
    overflow-y: auto;
    list-style-type: none;
    padding: 0;
    scroll-behavior: smooth;
    margin-top: 10px;
}

.saved-times li {
    background: #f9f9f9;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.saved-times li.show {
    opacity: 1;
    transform: translateY(0);
}

.saved-times-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    height: 0;
    overflow: hidden;
}

.saved-times-header.show {
    opacity: 1;
    height: auto;
    overflow: visible;
}

.notification-form {
    margin-top: 20px;
    text-align: left;
}

.notification-form input,
.notification-form textarea {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.notification-form .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.notification-form .form-group label {
    flex: 1;
}

.notification-form .form-group select {
    flex: 1;
    margin-left: 10px;
    width: auto;
}

.notification-form button:hover {
    background-color: #ccc;
    transform: scale(1.05);
}

.notification-form button:active {
    background-color: #bbb;
    transform: scale(0.95);
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 400px;
    width: 90%;
    font-size: 16px;
    border: 2px solid #444;
}

.popup.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

.popup h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
    color: #333;
}

.popup .form-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.popup .form-group .time-unit-selector {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    font-size: 16px;
    border: 2px solid #444;
    padding: 10px;
}

.popup .form-group label {
    margin-right: 10px;
    font-weight: bold;
}

.popup .form-group input,
.popup .form-group select,
.popup textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    resize: none;
}

.popup .form-group select {
    padding-right: 10px;
}

.popup button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-size: 16px;
}

.popup button[type="submit"]:hover {
    background-color: #666;
    transform: scale(1.05);
}

.popup button[type="submit"]:active {
    background-color: #333;
    transform: scale(0.95);
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    display: block;
    opacity: 1;
}

.notification-permission-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 400px;
    width: 90%;
    font-size: 16px;
    border: 2px solid #444;
}

.notification-permission-popup.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

.notification-permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-permission-overlay.active {
    display: block;
    opacity: 1;
}

.error-message {
    color: blue;
    margin-top: 10px;
}

.confirmation-message {
    color: green;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.confirmation-message.show {
    opacity: 1;
}

.clear-history {
    margin-top: 0;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 5px 10px;
    transition: background-color 0.3s, color 0.3s;
    background-color: black;
    align-self: flex-end;
}

.clear-history:hover {
    color: black;
}

.dark-mode .clear-history:hover {
    color: white;
}

.clear-history-cross {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
    display: none;
}

.clear-history-cross.show {
    display: inline-block;
}

.clear-history-cross .icon {
    font-size: 15px;
    padding-left: 7px;
    padding-bottom: 4px;
}

.fullscreen-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.fullscreen-button .icon {
    fill: white;
    width: 24px;
    height: 15px;
    margin: 0;
}

.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

.dark-mode button,
.dark-mode .saved-times li,
.dark-mode .notification-form input,
.dark-mode .notification-form textarea,
.dark-mode .popup {
    background-color: #1e1e1e;
    color: #ffffff;
    border: 1px solid #333333;
}

.dark-mode .popup {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.dark-mode .fullscreen-button {
    background-color: #333333;
}

.dark-mode .fullscreen-button:hover {
    background-color: #555555;
}

.dark-mode .icon {
    fill: white;
}

.dark-mode .clear-history {
    background-color: #333333;
}

.dark-mode button:hover .icon {
    color: white;
}

.toggle-dark-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ddd;
    color: black;
    border: none;
    border-radius: 50%;
    padding: 10px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.toggle-dark-mode:hover {
    background-color: #ccc;
    transform: scale(1.05);
}

.toggle-dark-mode:active {
    background-color: #bbb;
    transform: scale(0.95);
}

.toggle-dark-mode .icon {
    fill: black;
    width: 24px;
    height: 15px;
    margin: 0;
}

.toggle-dark-mode:hover .icon {
    fill: black;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.time-input-group select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    font-size: 14px;
    cursor: pointer;
}

.time-input-group span {
    font-size: 18px;
    font-weight: bold;
}

.time-input-group input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.dark-mode .popup h3 {
    color: #ffffff;
}

#play-pause {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
}

body.blur-background {
    filter: none;
    transition: none;
}

body.blur-background .popup,
body.blur-background .popup-overlay {
    filter: none;
    z-index: auto;
    position: static;
}

.paused {
    color: orange;
    box-shadow: 0 0 10px orange;
}

.paused .timer,
.paused button,
.paused .saved-times li,
.paused .notification-form input,
.paused .notification-form textarea,
.paused .popup {
    color: orange;
    border-color: orange;
}

.paused .popup {
    box-shadow: 0 0 20px orange;
}

body:not(.dark-mode).paused {
    color: blue;
    box-shadow: 0 0 10px blue;
}

body:not(.dark-mode).paused .timer,
body:not(.dark-mode).paused button,
body:not(.dark-mode).paused .saved-times li,
body:not(.dark-mode).paused .notification-form input,
body:not(.dark-mode).paused .notification-form textarea,
body:not(.dark-mode).paused .popup {
    color: blue;
    border-color: blue;
}

body:not(.dark-mode).paused .notification-reminder {
    border: 2px solid blue;
    color: blue;
}

body:not(.dark-mode).paused .popup {
    box-shadow: 0 0 20px blue;
}

body:not(.paused) {
    color: inherit;
}

body.dark-mode:not(.paused) {
    color: #ffffff;
}

body:not(.dark-mode):not(.paused) {
    color: #000000;
}

.notification-reminder {
    position: fixed;
    top: 10px;
    left: 10px;
    font-size: 16px;
    padding: 15px 25px; /* Augmenté pour une meilleure visibilité */
    margin: 5px;
    border: none;
    border-radius: 8px; /* Augmenté pour un style plus arrondi */
    background-color: #f0f0f0; /* Couleur de fond plus claire */
    color: black;
    transition: background-color 0.3s, transform 0.3s, opacity 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 1;
    opacity: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Ajouté pour une ombre subtile */
}

.notification-reminder.show {
    opacity: 1;
}

.notification-reminder span {
    display: block;
    margin-bottom: 5px;
}

.notification-reminder:hover {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

.dark-mode .notification-reminder {
    background-color: #2c2c2c;
    color: #ffffff;
    border: 1px solid #444444;
}

body:not(.dark-mode).paused .notification-reminder {
    border: 2px solid blue;
    color: blue;
}

.paused .notification-reminder {
    border: 2px solid orange;
    color: orange;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .timer {
        font-size: 24px;
        margin-bottom: 50px;
    }

    button {
        font-size: 14px;
        padding: 8px 16px;
        margin: 3px;
    }

    .button-container {
        gap: 5px;
    }

    .saved-times ul {
        max-height: 150px;
    }

    .popup {
        padding: 15px;
        max-width: 90%;
    }

    .popup h3 {
        font-size: 1.2em;
    }

    .popup .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .popup .form-group label,
    .popup .form-group select,
    .popup .form-group input,
    .popup .form-group textarea {
        width: 100%;
        margin-top: 5px;
    }

    .fullscreen-button {
        width: 40px;
        height: 40px;
    }

    .toggle-dark-mode {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .timer {
        font-size: 18px;
        margin-bottom: 30px;
    }

    button {
        font-size: 12px;
        padding: 6px 12px;
        margin: 2px;
    }

    .saved-times ul {
        max-height: 100px;
    }

    .popup {
        padding: 10px;
    }

    .popup h3 {
        font-size: 1em;
    }

    .fullscreen-button,
    .toggle-dark-mode {
        width: 30px;
        height: 30px;
    }
}