#searchInput {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    border: 1px solid #333;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.video-card iframe,
.video-card video {
    width: 100%;
    height: 160px;
    pointer-events: none;
    display: block;
}

.video-card video {
    object-fit: cover;
    background: #000;
    pointer-events: none;
}

.video-card .title {
    padding: 10px;
    font-weight: bold;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
    gap: 10px;
}

.pagination-info {
    font-size: 14px;
    color: #555;
    padding: 0 10px;
}

.pagination button {
    padding: 6px 12px;
    border: none;
    color: var(--site-color-key) !important;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button:disabled {
    cursor: not-allowed;
    color: #aaa !important;
    pointer-events: none;
    opacity: .4
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: 50px auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content iframe,
.modal-content video {
    width: 100%;
    height: 100%;
    max-height: 90vh;
    /* prevent overflow */
    aspect-ratio: 16 / 9;
    /* keep proper YouTube ratio */
    border: none;
    object-fit: contain;
    /* for local videos */
}

/* Ensure the modal container matches video modal size */
.video-modal-content {
    width: 90%;
    max-width: 1000px;
    margin: 50px auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

.hidden {
    display: none;
}