@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@500&display=swap');

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

body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
}

#mainWrapper {
    transition: transform 0.5s ease, margin-top 0.5s ease;
    margin-top: -50px;
    height: 88vh;
}

#mainWrapper.moved-up {
    margin-top: 10px;
}

#mainWrapper {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in, transform 0.5s ease-in;
}

#mainWrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    font-family: 'Ubuntu', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

h1 {
    font-family: 'Source Sans Pro', sans-serif;
    color: #3A3A3A;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.9rem;
    font-weight: 600;
}

.container {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 20px;
    justify-content: center;
    align-items: center;
}

form {
    border-radius: 8px;
    display: inline-block;
    padding: 20px;
    margin-left: 100px auto;
    width: 100%;
    max-width: 600px;
    justify-self: center;
    text-align: center;
}

input[type="text"] {
    width: 100%;
    font-family: 'Nunito', sans-serif;
    padding: 10px;
    padding-left: 20px;
    padding-right: 60px;
    margin-bottom: 10px;
    background-color: #F4F4F4;
    border-radius: 50px;
    border: none;
    box-sizing: border-box;
    font-size: 1rem;
    height: 50px;
}

.input-container {
    position: relative;
    display: inline-block;
    width: calc(100% - 22px);
}

.clear-btn {
    position: absolute;
    right: 25px;
    top: 40%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #898989;
    display: none;
    z-index: 1;
}

input[type="text"]:not(:placeholder-shown) + .clear-btn {
    display: block;
}

button {
    background-color: #000000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    margin-top: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s;
    font-family: 'Ubuntu', sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

button:hover {
    background-color: #252525;
}

select {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#formats {
    justify-content: center;
    text-align: center;
    z-index: 0;
    display: flex;
    gap: 10px;
}

#available-qualities {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    font-family: 'Ubuntu', sans-serif;   
}

#downloadForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#downloadForm div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#downloadForm select {
    padding: 10px 20px;
    font-size: 1.2rem;
    border: 1px solid #444;
    border-radius: 20px;
    width: 230px;
    text-align: center;
    margin: 0 auto;
    background-color: #0b0b0b;
    color: #ffffff;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="white"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    font-family: 'Ubuntu', sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

#downloadForm select:hover {
    border-color: #0b0b0b;
    background-color: #333333;
}

#downloadForm select:focus {
    outline: none;
    border-color: #1b1b1b;
}

#downloadForm button {
    padding: 15px 30px;
    background-color: #0b0b0b;
    color: #fff;
    margin: 0 auto;
    font-size: 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#downloadForm button:hover {
    background-color: #333333;
}

#downloadForm button i {
    transition: 0.3s ease all;
}

#downloadForm button:focus {
    outline: none;
}

#hidden_url {
    display: none;
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 22px;
}

.loader {
    display: flex;
    justify-content: space-between;
    width: 40px;
}

.loader div {
    width: 8px;
    height: 8px;
    background-color: #000000;
    border-radius: 50%;
    animation: grow-shrink 1.5s infinite;
}

.loader div:nth-child(1) {
    animation-delay: 0s;
}

.loader div:nth-child(2) {
    animation-delay: 0.3s;
}

.loader div:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes grow-shrink {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
    }
}

.error-message {
    color: #ff0000;
    background-color: #ffe5e5;
    border: 1px solid #ff0000;
    padding: 10px;
    bottom: 50px;
    border-radius: 5px;
    text-align: center;
    justify-self: center;
}

.video-embed-container {
    text-align: center;
    margin-bottom: 40px auto;
}

.video-embed-container h2 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

iframe {
    width: 100%;
    max-width: 560px;
    height: 315px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.error-message {
    position: absolute;
    bottom: 0;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
    background: #ff3737;
    padding: 15px;
    border-radius: 20px;
    color: #fff;
    gap: 10px;
    user-select: none;
}

.animate {
    animation: popup 0.5s forwards;
}
  
@keyframes popup {
    0% {
      transform: translateY(0);
      opacity: 0;
    }
    50% {
      transform: translateY(-15px);
      opacity: 1;
    }
    100% {
      transform: translateY(0);
      opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(15px);
    }
}

@media only screen and (max-width: 480px) {
    h1 {
        /* font-size: 1.4em; */
        margin-top: 250px;
    }

    form {
        margin: 0 auto;
        padding: 15px;
    }

    button {
        width: fit-content;
    }

    .container {
        margin-top: 10px;
    }

    .video-embed-container {
        margin-top: 120px;
    }

    .video-embed-container h2 {
        font-size: 1.5em;
        margin-top: 40px;
        font-size: 1.2em;
    }

    iframe {
        height: 200px;
    }

    .error-message {
        bottom: 30px;
    }
}

@media only screen and (min-width: 481px) and (max-width: 768px) {
    h1 {
        font-size: 2em;
        margin-top: 180px;
    }

    form {
        margin: 0 auto;
        padding: 20px;
    }

    button {
        width: 100%;
    }

    .container {
        margin-top: 30px;
    }
}

@media only screen and (min-width: 769px) and (max-width: 1024px) {
    h1 {
        font-size: 2.2em;
        margin-top: 180px;
    }

    form {
        margin: 0 auto;
        padding: 25px;
    }

    button {
        width: 100%;
    }

    .container {
        margin-top: 40px;
    }
}

@media only screen and (min-width: 1025px) {
    h1 {
        font-size: 2.5em;
        margin-top: 230px;
    }

    form {
        padding: 30px;
    }

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