/* ---------------------------------------------------------------------------------------
                                    NORMALIZE
--------------------------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}


html {
    scroll-behavior: smooth;
    line-height: 1.75;
    width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: initial;
    background: #000000;
    line-height: 1.4;
    font-size:18px;
    color:var(--text-color);
    font-family:"Nimbus Sans L";
}

img, picture, video, canvas, svg {
    max-width: 100%;
}

:is(a, a:hover, button) {
    color: inherit;
    text-decoration: none;
}

p {
    margin-bottom:20px;
}

/* ---------------------------------------------------------------------------------------
                                    APP
--------------------------------------------------------------------------------------- */

div#app {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    width: 100vw;
}

body {
    font-family: 'Roboto', sans-serif;
    margin:0;
    background: #080808;
    color: var(--text-color);
}

:root {
    --pdnogreen: #47c6ae;
    --pndorose: #d488cb;
    --pndoblue: #189dad;
    --ballsize: 100px;
    --text-color:#299dad;
    --text-color-dark:#060606;
    --dark:#060606;
}


.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* padding-top: 50px; */
    width: 100%;
}

.ball {
    width: var(--ballsize);
    height: var(--ballsize);
    border-radius: 50%;
    background-color: var(--pdnogreen);
    position: relative;
    animation-duration: var(--animation-inhale-duration);
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.18, 0, 0.42, 1.01);
    bottom: 0;
    opacity: 1;
}

.ball.inhale {
    animation-duration: var(--animation-inhale-duration);
    animation-name: inhale;
}

.ball.exhale {
    animation-duration: var(--animation-exhale-duration);
    animation-name: exhale;
}


.ball:after {
    content: "";
    display: block;
    position: absolute;
    width: calc(var(--ballsize) + 2px);
    height: calc(var(--ballsize) + 2px);
    left: -1px;
    top: -1px;
    border-radius: 50%;
    border: 1px solid #323232;
    animation: sonarWave 1s linear infinite;
    background: none;
    box-shadow: none;
    overflow: hidden;
    /* transform-origin: 0 0; */
    backface-visibility: hidden;
}

@keyframes sonarWave {
    from {
        opacity: 1;
        transform: scaleX(1) scaleY(1) scaleZ(1);
    }
    to {
        transform: scaleX(1.4) scaleY(1.4) scaleZ(1.4);
        opacity: 0;
    }
}

@keyframes inhale {
    0% {
        bottom: 0;
    }
    100% {
        bottom: calc(100% - var(--ballsize));
    }
}

@keyframes exhale {
    0% {
        bottom: calc(100% - var(--ballsize));
    }
    100% {
        bottom: 0;
    }
}


.ball-container {
    width: 100%;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: end;
    background: #89898914;
}

p {
    margin: 10px;
}

input {
    margin: 10px;
    padding: 5px;
    border: 1px solid var(--pndoblue);
    border-radius: 3px;
    outline: none;
    background: var(--dark);
    color: var(--text-color);
}

#app button {
    padding: 8px 16px;
    background-color: var(--pndoblue);
    color: var(--text-color-dark);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s;
    height: 40px;
    margin: 5px;
    min-width: 110px;
}

.controler-container.normal-mode.no-controls {
    margin-top: 50px;
}

.controler-container.normal-mode.no-controls {
    margin-top: 50px;
}

button:hover {
    background-color: var(--pndoblue);
}

progress {
    width: 100%;
    height: 10px;
    background-color: #eee;
    border: none;
    border-radius: 5px;
}

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

.input-group label {
    margin-right: 10px;
}

.input-group input {
    width: 50px;
    margin: 0 10px;
}

#app  .incdecr-control button {
    width: 20px;
    padding: 0;
    min-width: 0;
}

#app .incdecr-control button:first-of-type {
    border-radius: 4px 0 0 4px;
    margin-right: 0;
}

#app  .incdecr-control button:last-of-type {
    border-radius: 0 4px 4px 0;
    margin-left: 0;
}

.incdecr-control input {
    margin: 0;
    height: 40px;
    border-radius: 0;
    background: #030303;
    color: var(--text-color);
}

select {
    margin: 10px;
    padding: 5px;
    border: 1px solid var(--pndoblue);
    border-radius: 3px;
    outline: none;
    background-color: var(--pndoblue);
    cursor: pointer;
    height: 40px;
    margin: 5px;
    color: var(--text-color-dark);
}

.controler-container.no-controls .exercice-input {
    opacity: 0.3;
    pointer-events: none;
}

.controler-container.zen-mode .zen-hidden  {
    opacity: 0;
}

div#instruction {
    height: 110px;
    font-size: 50px;
    display: flex;
    align-items: center;
    color: var(--pndoblue);
}

.controler-container {
    margin-top: 50px;
}

.controler-buttons {
    display: flex;
    justify-content: center;
}

.remaining-timer-container {
    text-align: center;
    font-size: 20px;
}

.volume-control {
    display: flex;
    justify-content: center;
    align-items: center;
}


/* === range theme and appearance === */
input[type="range"] {
    font-size: 1.5rem;
    width: 10.5em;
}

input[type="range"] {
    color: #ef233c;
    --thumb-height: 1.125em;
    --track-height: 0.125em;
    --track-color: rgba(0, 0, 0, 0.2);
    --brightness-hover: 180%;
    --brightness-down: 80%;
    --clip-edges: 0.125em;
}

input[type="range"].win10-thumb {
    color: #2b2d42;

    --thumb-height: 1.375em;
    --thumb-width: 0.5em;
    --clip-edges: 0.0125em;
}

@media (prefers-color-scheme: dark) {
    html {
        background-color: #000;
    }

    html::before {
        background: radial-gradient(circle at center, #101112, #000);
    }

    input[type="range"] {
        color: #f07167;
        --track-color: rgba(255, 255, 255, 0.1);
    }

    input[type="range"].win10-thumb {
        color: var(--pndoblue);
    }
}

/* === range commons === */
input[type="range"] {
    position: relative;
    background: #fff0;
    overflow: hidden;
}

input[type="range"]:active {
    cursor: grabbing;
}

input[type="range"]:disabled {
    filter: grayscale(1);
    opacity: 0.3;
    cursor: not-allowed;
}

/* === WebKit specific styles === */
input[type="range"],
input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    transition: all ease 100ms;
    height: var(--thumb-height);
    border: none;
}

input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-webkit-slider-thumb {
    position: relative;
}

input[type="range"]::-webkit-slider-thumb {
    --thumb-radius: calc((var(--thumb-height) * 0.5) - 1px);
    --clip-top: calc((var(--thumb-height) - var(--track-height)) * 0.5 - 0.5px);
    --clip-bottom: calc(var(--thumb-height) - var(--clip-top));
    --clip-further: calc(100% + 1px);
    --box-fill: calc(-100vmax - var(--thumb-width, var(--thumb-height))) 0 0
    100vmax currentColor;

    width: var(--thumb-width, var(--thumb-height));
    background: linear-gradient(currentColor 0 0) scroll no-repeat left center /
		50% calc(var(--track-height) + 1px);
    background-color: currentColor;
    box-shadow: var(--box-fill);
    border-radius: var(--thumb-width, var(--thumb-height));

    filter: brightness(100%);
    clip-path: polygon(
            100% -1px,
            var(--clip-edges) -1px,
            0 var(--clip-top),
            -100vmax var(--clip-top),
            -100vmax var(--clip-bottom),
            0 var(--clip-bottom),
            var(--clip-edges) 100%,
            var(--clip-further) var(--clip-further)
    );
}

input[type="range"]:hover::-webkit-slider-thumb {
    filter: brightness(var(--brightness-hover));
    cursor: grab;
}

input[type="range"]:active::-webkit-slider-thumb {
    filter: brightness(var(--brightness-down));
    cursor: grabbing;
}

input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(var(--track-color) 0 0) scroll no-repeat center /
		100% calc(var(--track-height) + 1px);
}

input[type="range"]:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}

/* === Firefox specific styles === */
input[type="range"],
input[type="range"]::-moz-range-track,
input[type="range"]::-moz-range-thumb {
    appearance: none;
    transition: all ease 100ms;
    height: var(--thumb-height);
}

input[type="range"]::-moz-range-track,
input[type="range"]::-moz-range-thumb,
input[type="range"]::-moz-range-progress {
    background: #fff0;
}

input[type="range"]::-moz-range-thumb {
    background: currentColor;
    border: 0;
    width: var(--thumb-width, var(--thumb-height));
    border-radius: var(--thumb-width, var(--thumb-height));
    cursor: grab;
}

input[type="range"]:active::-moz-range-thumb {
    cursor: grabbing;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    background: var(--track-color);
}

input[type="range"]::-moz-range-progress {
    appearance: none;
    background: currentColor;
    transition-delay: 30ms;
}

input[type="range"]::-moz-range-track,
input[type="range"]::-moz-range-progress {
    height: calc(var(--track-height) + 1px);
    border-radius: var(--track-height);
}

input[type="range"]::-moz-range-thumb,
input[type="range"]::-moz-range-progress {
    filter: brightness(100%);
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:hover::-moz-range-progress {
    filter: brightness(var(--brightness-hover));
}

input[type="range"]:active::-moz-range-thumb,
input[type="range"]:active::-moz-range-progress {
    filter: brightness(var(--brightness-down));
}

input[type="range"]:disabled::-moz-range-thumb {
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------------------------
                                    YOUTUBE PLAYER
--------------------------------------------------------------------------------------- */

.youtube-controls {
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(25, 25, 25, 0.5);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
}

.youtube-controls h3 {
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: center;
}

.youtube-video-select {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.youtube-video-select label {
    margin-bottom: 5px;
}

.youtube-video-select select {
    padding: 8px;
    background-color: var(--dark);
    color: var(--text-color);
    border: 1px solid var(--pndoblue);
    border-radius: 4px;
    outline: none;
}

.youtube-playback-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.youtube-volume-control {
    display: flex;
    align-items: center;
    width: 60%;
}

.youtube-volume-control span {
    margin-right: 10px;
}

#youtube-player-container {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 0;
    height: 0;
    visibility: hidden;
}

/* Responsive adjustments for YouTube controls */
@media (max-width: 768px) {
    .youtube-playback-controls {
        flex-direction: column;
        gap: 10px;
    }

    .youtube-volume-control {
        width: 100%;
    }

    .ball-container, div#instruction {
        display: none;
    }
    .controler-container {
        margin-top:0;
    }
}
