* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    width: 100vw;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 20px 0;
}

.wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    width: 100%;
    margin: 0 20px;
    max-width: 800px;
}

.content h1 {
    margin-bottom: 30px;
    font-size: 2.5em;
}

.content form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group {
    width: 100%;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: left;
}

.content form input, .content form select {
    width: 100%;
    height: 45px;
    padding: 10px 15px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1em;
}

.content form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.content form select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M1.41%200.58L6%205.17L10.59%200.58L12%202L6%208L0%202L1.41%200.58Z%22%20fill%3D%22%23ffffff%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.content form select option {
    background: #5c5291;
    color: #fff;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 90%;
    margin-bottom: 20px;
}

#query {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px calc(20% + 15px) 10px 15px;
    font-size: 1em;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#query:focus {
    outline: none;
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #fff;
}

.search-button svg {
    width: 20px;
    height: 20px;
}

#searchButton, #submitButton {
    width: 20%;
    border-radius: 25px 15px 15px 25px;
    background: #ff7e5f;
    border: none;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

#searchSpan {
    margin-left: 5px;
}

#searchButton:hover, #submitButton:hover {
    background: #feb47b;
}

.video-list {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
    background: transparent;
}

.video-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 15px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.video-item:hover {
    /*transform: translateY(5px);*/
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.35);
    scale: 0.99;
}

.video-item img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}

.video-item h3 {
    margin-top: 0;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
}

.video-item p {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.video-item button {
    margin-top: 15px;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    background: #ff7e5f;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 500;
}

.video-item button:hover {
    background: #feb47b;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 15% auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.modal-content .input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: left;
}

.modal-content form input, .modal-content form select {
    width: 100%;
    height: 45px;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1em;
    margin-bottom: 20px;
}

.modal-content form select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M1.41%200.58L6%205.17L10.59%200.58L12%202L6%208L0%202L1.41%200.58Z%22%20fill%3D%22%23ffffff%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.modal-content form select option {
    background: #5c5291;
    color: #fff;
}

.modal-content #submitButton {
    width: 100%;
    height: 50px;
    border-radius: 25px;
    margin-top: 20px;
    background: #ff7e5f;
    border: none;
    color: #fff;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal-content #submitButton:hover {
    background: #feb47b;
}

.close-button {
    color: #fff;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    transform: scale(1.2);
    color: #ff7e5f;
    text-decoration: none;
    cursor: pointer;
}

.loader-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #ff7e5f;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-list::-webkit-scrollbar {
    width: 8px;
}

.video-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.video-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.video-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.thumbnail-container {
    position: relative;
}

.duration {
    position: absolute;
    bottom: 28px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6em;
}

@media (max-width: 768px) {
    .content {
        padding: 30px;
        margin: 0 auto;
        width: 90%;
    }

    .video-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 1.8em;
    }

    .search-button span {
        display: none;
    }

    .search-button svg {
        margin-right: 0;
    }
}

@media (max-width: 600px) {
    .content {
        padding: 20px;
        margin: 0 10px;
        width: 95%;
    }

    .content h1 {
        font-size: 2em;
    }

    .video-list {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin-top: 55%;
        width: 95%;
        padding: 15px;
    }

    .modal-content h2 {
        font-size: 1.5em;
    }

    .search-input {
        padding: 10px 40px 10px 10px;
    }

    .search-button {
        padding: 0 10px;
    }

    .search-button span {
        display: none;
    }

    .search-button svg {
        margin-right: 0;
    }
}
